public IEnumerator ShouldChangeTextOnButtonClick() { yield return(new WaitForSeconds(2)); GameObject display = _arium.FindGameObject("Display"); // string display = _arium.GetText("Display"); Assert.AreEqual("New Text", _arium.FindGameObject("Display").GetText()); _arium.PerformAction(new UnityPointerClick(), "Button"); yield return(null); Assert.AreEqual("Button Clicked!", display.GetText()); }
public IEnumerator ShouldMoveToPosition() { Transform playertr = _arium.GetComponent <Transform>("Player"); // get tranform component for player object Transform walltr = _arium.GetComponent <Transform>("East Wall"); //get tranform component for walls object PlayerMovement move = new PlayerMovement(Vector2.right, 10); //set an action for player to move right direction _arium.PerformAction(move, "Player"); //Perform an action float distancebefore = playertr.position.x - walltr.position.x; Console.WriteLine(distancebefore); yield return(new WaitUntil(() => (playertr.position.x - walltr.position.x > distancebefore))); Assert.AreEqual(0.5f, playertr.position.y); }