X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2d95a83959c77a0c4820c6668b439f8e1b0d038a..a52fc9424444400d4c774b76cf9f59ba43f9dc12:/automationTest/src/test/java/androidtest/tests/DeleteFileTestSuite.java diff --git a/automationTest/src/test/java/androidtest/tests/DeleteFileTestSuite.java b/automationTest/src/test/java/androidtest/tests/DeleteFileTestSuite.java index a07bb976..d30b4c6c 100644 --- a/automationTest/src/test/java/androidtest/tests/DeleteFileTestSuite.java +++ b/automationTest/src/test/java/androidtest/tests/DeleteFileTestSuite.java @@ -1,7 +1,13 @@ 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.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; import org.junit.runners.MethodSorters; import org.junit.FixMethodOrder; import org.junit.Test; @@ -9,30 +15,38 @@ import org.openqa.selenium.By; import org.openqa.selenium.support.ui.ExpectedConditions; import androidtest.actions.Actions; +import androidtest.groups.NoIgnoreTestCategory; +import androidtest.groups.SmokeTestCategory; import androidtest.models.MainView; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class DeleteFileTestSuite extends Common{ +public class DeleteFileTestSuite{ + AndroidDriver driver; + Common common; private final 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 testDeleteFile () throws Exception { MainView mainView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver); - waitForTextPresent("ownCloud", mainView.getTitleTextElement()); + common.assertIsInMainView(); //TODO. if the file already exists, do not upload MainView mainViewAfterUploadFile = Actions.uploadFile(FILE_NAME, mainView); mainViewAfterUploadFile.scrollTillFindElement(FILE_NAME); - waitTillElementIsNotPresent(mainViewAfterUploadFile.getProgressCircular(), 1000); - wait.until(ExpectedConditions.visibilityOf(mainViewAfterUploadFile.getFileElementLayout().findElement(By.id(MainView.getLocalFileIndicator())))); + Common.waitTillElementIsNotPresent(mainViewAfterUploadFile.getProgressCircular(), 1000); + common.wait.until(ExpectedConditions.visibilityOf(mainViewAfterUploadFile.getFileElementLayout().findElement(By.id(MainView.getLocalFileIndicator())))); Actions.deleteElement(FILE_NAME,mainViewAfterUploadFile, driver); assertFalse(mainViewAfterUploadFile.getFileElement().isDisplayed()); @@ -40,7 +54,7 @@ public class DeleteFileTestSuite extends Common{ @After public void tearDown() throws Exception { - takeScreenShotOnFailed(getName()); + common.takeScreenShotOnFailed(name.getMethodName()); driver.removeApp("com.owncloud.android"); driver.quit(); }