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
;
9 import androidtest
.actions
.Actions
;
10 import androidtest
.models
.MainView
;
11 import androidtest
.models
.WaitAMomentPopUp
;
14 @FixMethodOrder(MethodSorters
.NAME_ASCENDING
)
15 public class DeleteFolderTestSuite
extends Common
{
16 private Boolean folderHasBeenCreated
= false
;
17 private final String FOLDER_NAME
= "testCreateFolder";
21 public void setUp() throws Exception
{
26 public void testDeleteFolder () 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 folder already exists, do no created
32 WaitAMomentPopUp waitAMomentPopUp
= Actions
.createFolder(FOLDER_NAME
, mainView
);
33 waitTillElementIsNotPresent(waitAMomentPopUp
.getWaitAMomentTextElement(), 100);
34 mainView
.scrollTillFindElement(FOLDER_NAME
);
35 assertTrue(folderHasBeenCreated
= mainView
.getFileElement().isDisplayed());
38 Actions
.deleteElement(FOLDER_NAME
, mainView
, driver
);
39 assertFalse(folderHasBeenCreated
=mainView
.getFileElement().isDisplayed());
43 public void tearDown() throws Exception
{
44 if(folderHasBeenCreated
){
45 MainView mainView
= new MainView(driver
);
46 Actions
.deleteElement(FOLDER_NAME
, mainView
, driver
);
48 driver
.removeApp("com.owncloud.android");