Vanessa M
unread,Dec 22, 2021, 6:16:19 PM12/22/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AltUnity - UI test automation tool for Unity3D
I am trying to use AltUnity but I am not been successful so far. I wrote a very simple test (load a scene and tap a button), which sometimes passes, but sometimes doesn't, although no code has changed between the tests. I get the error ALTUNITYTESTERnotaddedasdefinevariable error, any idea what is going on? I am attaching a screenshot and a copy of the code in case it might help, really appreciate any advice, thanks!
using NUnit.Framework;
using Altom.AltUnityDriver;
public class MyFirstTest
{
private AltUnityDriver altUnityDriver;
[OneTimeSetUp]
public void SetUp()
{
altUnityDriver = new AltUnityDriver();
}
[OneTimeTearDown]
public void TearDown()
{
altUnityDriver.Stop();
}
private void TestHomeButton(string sceneName)
{
Log.Debug("TestHomeButton: " + sceneName);
altUnityDriver.LoadScene(sceneName);
altUnityDriver.WaitForCurrentSceneToBe(sceneName);
var icon = altUnityDriver.FindObject(By.NAME, "HomeButton");
Assert.IsTrue(icon.enabled);
icon.Tap();
altUnityDriver.WaitForCurrentSceneToBe(Defines.cScene_Home);
}
[Test]
public void TestMenuBarIcons()
{
TestHomeButton(Defines.cScene_Menu);
TestHomeButton(Defines.cScene_ModuleTableOfContents);
TestHomeButton(Defines.cScene_MultipleChoice);
}
}
Bildschirmfoto 2021-12-22 um 23.59.51.png