X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2d95a83959c77a0c4820c6668b439f8e1b0d038a..a52fc9424444400d4c774b76cf9f59ba43f9dc12:/automationTest/src/test/java/androidtest/tests/MoveFileTestSuite.java diff --git a/automationTest/src/test/java/androidtest/tests/MoveFileTestSuite.java b/automationTest/src/test/java/androidtest/tests/MoveFileTestSuite.java index 502d45f4..3d57ee07 100644 --- a/automationTest/src/test/java/androidtest/tests/MoveFileTestSuite.java +++ b/automationTest/src/test/java/androidtest/tests/MoveFileTestSuite.java @@ -1,12 +1,20 @@ package androidtest.tests; +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + import org.junit.After; import org.junit.Before; import org.junit.FixMethodOrder; +import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; import org.junit.runners.MethodSorters; import androidtest.actions.Actions; +import androidtest.groups.NoIgnoreTestCategory; +import androidtest.groups.SmokeTestCategory; import androidtest.models.ElementMenuOptions; import androidtest.models.MainView; import androidtest.models.MoveView; @@ -15,23 +23,28 @@ import androidtest.models.WaitAMomentPopUp; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class MoveFileTestSuite extends Common{ +public class MoveFileTestSuite{ + AndroidDriver driver; + Common common; private String FOLDER_WHERE_MOVE = "folderWhereMove"; private String FILE_NAME = "test"; - + @Rule public TestName name = new TestName(); + @Before public void setUp() throws Exception { - setUpCommonDriver(); + common=new Common(); + driver=common.setUpCommonDriver(); } @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) public void testMoveFile () throws Exception { WaitAMomentPopUp waitAMomentPopUp; MainView mainView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver); - assertTrue(waitForTextPresent("ownCloud", mainView.getTitleTextElement())); + common.assertIsInMainView(); - waitTillElementIsNotPresent(mainView.getProgressCircular(), 1000); + Common.waitTillElementIsNotPresent(mainView.getProgressCircular(), 1000); //check if the folder already exists and if true, delete them Actions.deleteElement(FOLDER_WHERE_MOVE, mainView, driver); @@ -39,7 +52,7 @@ public class MoveFileTestSuite extends Common{ //Create the folder where the other is gone to be moved waitAMomentPopUp = Actions.createFolder(FOLDER_WHERE_MOVE, mainView); - waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100); + Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100); mainView.scrollTillFindElement(FOLDER_WHERE_MOVE); assertTrue(mainView.getFileElement().isDisplayed()); @@ -54,11 +67,11 @@ public class MoveFileTestSuite extends Common{ //to move to a folder moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1); waitAMomentPopUp = moveView.clickOnChoose(); - waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100); + Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100); //check that the folder moved is inside the other mainView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1); - waitTillElementIsNotPresent(mainView.getProgressCircular(), 1000); + Common.waitTillElementIsNotPresent(mainView.getProgressCircular(), 1000); Thread.sleep(1000); mainView.scrollTillFindElement(FILE_NAME); assertEquals(FILE_NAME , mainView.getFileElement().getText()); @@ -67,7 +80,7 @@ public class MoveFileTestSuite extends Common{ @After public void tearDown() throws Exception { - takeScreenShotOnFailed(getName()); + common.takeScreenShotOnFailed(name.getMethodName()); MainView mainView = new MainView(driver); driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK); Actions.deleteElement(FOLDER_WHERE_MOVE, mainView, driver);