1 package androidtest
.tests
;
3 import org
.junit
.After
;
4 import org
.junit
.Before
;
5 import org
.junit
.runners
.MethodSorters
;
6 import org
.junit
.FixMethodOrder
;
8 import org
.openqa
.selenium
.By
;
9 import org
.openqa
.selenium
.support
.ui
.ExpectedConditions
;
11 import androidtest
.actions
.Actions
;
12 import androidtest
.models
.MainView
;
15 @FixMethodOrder(MethodSorters
.NAME_ASCENDING
)
16 public class DeleteFileTestSuite
extends Common
{
18 private final String FILE_NAME
= "test";
21 public void setUp() throws Exception
{
26 public void testDeleteFile () throws Exception
{
27 MainView mainView
= Actions
.login(Config
.URL
, Config
.user
,Config
.password
, Config
.isTrusted
, driver
);
28 waitForTextPresent("ownCloud", mainView
.getTitleTextElement());
30 //TODO. if the file already exists, do not upload
31 MainView mainViewAfterUploadFile
= Actions
.uploadFile(FILE_NAME
, mainView
);
33 mainViewAfterUploadFile
.scrollTillFindElement(FILE_NAME
);
34 waitTillElementIsNotPresent(mainViewAfterUploadFile
.getProgressCircular(), 1000);
35 wait
.until(ExpectedConditions
.visibilityOf(mainViewAfterUploadFile
.getFileElementLayout().findElement(By
.id(MainView
.getLocalFileIndicator()))));
37 Actions
.deleteElement(FILE_NAME
,mainViewAfterUploadFile
, driver
);
38 assertFalse(mainViewAfterUploadFile
.getFileElement().isDisplayed());
42 public void tearDown() throws Exception
{
43 driver
.removeApp("com.owncloud.android");