public IEnumerator UserCanRenameSceneTest() { yield return(StartCoroutine(Q.driver.Click(sceneseBtn, "Click on scenes."))); SceneTile sceneTile = MainScreen.Instance.GetSceneTile("test scene"); yield return(StartCoroutine(Q.assert.IsTrue(sceneTile != null, "Scene not found!"))); yield return(StartCoroutine(Q.driver.Click(sceneTile.GetOptionButton().gameObject, "Click on option menu."))); yield return(StartCoroutine(Q.assert.IsTrue(sceneOptionMenu.GetComponent <SimpleSideMenu>().CurrentState == SimpleSideMenu.State.Open, "Option menu not opened!"))); yield return(StartCoroutine(Q.driver.Click(sceneRename, "Click on scene rename."))); inputDialog.GetComponent <InputDialog>().SetInputValue("test scene renamed"); yield return(StartCoroutine(Q.driver.Click(inputDialogOKButton, "Click on Got it button"))); // wait for server to respond yield return(new WaitForSeconds(2)); sceneTile = MainScreen.Instance.GetSceneTile("test scene renamed"); yield return(StartCoroutine(Q.assert.IsTrue(sceneTile != null, "Scene not found!"))); bool sceneExist = false; foreach (IO.Swagger.Model.ListScenesResponseData scene in Base.GameManager.Instance.Scenes) { if (scene.Name == "test scene renamed") { sceneExist = true; } } yield return(StartCoroutine(Q.assert.IsTrue(sceneExist, "Test scene does not exist"))); }
public IEnumerator UserCanRemoveSceneTest() { yield return(StartCoroutine(Q.driver.Click(sceneseBtn, "Click on scenes."))); SceneTile sceneTile = MainScreen.Instance.GetSceneTile("test scene renamed"); yield return(StartCoroutine(Q.assert.IsTrue(sceneTile != null, "Scene not found!"))); yield return(StartCoroutine(Q.driver.Click(sceneTile.GetOptionButton().gameObject, "Click on option menu."))); yield return(StartCoroutine(Q.assert.IsTrue(sceneOptionMenu.GetComponent <SimpleSideMenu>().CurrentState == SimpleSideMenu.State.Open, "Option menu not opened!"))); yield return(StartCoroutine(Q.driver.Click(sceneRemove, "Click on scene remove."))); yield return(StartCoroutine(Q.driver.Click(confirmationDialogOKButton, "Click on ok button"))); // wait for server to respond yield return(new WaitForSeconds(2)); try { sceneTile = MainScreen.Instance.GetSceneTile("test scene renamed"); } catch (ItemNotFoundException) { sceneTile = null; } yield return(StartCoroutine(Q.assert.IsTrue(sceneTile == null, "Scene should be removed but it is not!"))); bool sceneExist = false; foreach (IO.Swagger.Model.ListScenesResponseData scene in Base.GameManager.Instance.Scenes) { if (scene.Name == "test scene renamed") { sceneExist = true; } } yield return(StartCoroutine(Q.assert.IsTrue(!sceneExist, "Test scene should not exist"))); }