Skip to content

Commit

Permalink
Update scene path in samples
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Apr 9, 2024
1 parent a9d86e0 commit a306689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Samples~/uGUI Demo/Tests/Runtime/MonkeyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace TestHelper.Monkey.Samples.UGUIDemo
public class MonkeyTest
{
[Test]
[LoadScene("Assets/Samples/Monkey Test Helper/0.10.0/uGUI Demo/Scenes/uGUIDemo.unity")]
[LoadScene("Assets/Samples/Monkey Test Helper/0.11.0/uGUI Demo/Scenes/uGUIDemo.unity")]
public async Task Run()
{
var config = new MonkeyConfig
Expand Down
5 changes: 4 additions & 1 deletion Samples~/uGUI Demo/Tests/Runtime/ScenarioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ScenarioTest
[TestCase("Difficulty")]
[TestCase("Help")]
[TestCase("Credit")]
[LoadScene("Assets/Samples/Monkey Test Helper/0.10.0/uGUI Demo/Scenes/uGUIDemo.unity")]
[LoadScene("Assets/Samples/Monkey Test Helper/0.11.0/uGUI Demo/Scenes/uGUIDemo.unity")]
[TakeScreenshot]
public async Task OpenSubScreens(string target)
{
Expand All @@ -33,20 +33,23 @@ public async Task OpenSubScreens(string target)
var startComponent = CreateInteractableComponent(startButton.GetComponent<Button>());
var startClickOperator = startComponent.GetOperatorsByType(OperatorType.Click).First();
startClickOperator.OperateAsync(startComponent.component);

await _finder.FindByNameAsync("Home");

// When click target button, then open target screen.
var targetButton = await _finder.FindByNameAsync($"{target}Button", interactable: true);
var targetComponent = CreateInteractableComponent(targetButton.GetComponent<Button>());
var targetClickOperator = targetComponent.GetOperatorsByType(OperatorType.Click).First();
targetClickOperator.OperateAsync(targetComponent.component);

await _finder.FindByNameAsync(target);

// When click Back button, then return Home screen.
var backButton = await _finder.FindByPathAsync($"**/{target}/BackButton", interactable: true);
var backComponent = CreateInteractableComponent(backButton.GetComponent<Button>());
var backClickOperator = backComponent.GetOperatorsByType(OperatorType.Click).First();
backClickOperator.OperateAsync(backComponent.component);

await _finder.FindByNameAsync("Home");
}

Expand Down

0 comments on commit a306689

Please sign in to comment.