1 package com
.owncloud
.android
.test
.ui
.testSuites
;
3 import static org
.junit
.Assert
.*;
4 import io
.appium
.java_client
.android
.AndroidDriver
;
6 import org
.junit
.After
;
7 import org
.junit
.Before
;
9 import org
.junit
.experimental
.categories
.Category
;
10 import org
.junit
.rules
.TestName
;
11 import org
.junit
.runners
.MethodSorters
;
12 import org
.junit
.FixMethodOrder
;
13 import org
.junit
.Test
;
14 import org
.openqa
.selenium
.By
;
15 import org
.openqa
.selenium
.support
.ui
.ExpectedConditions
;
17 import com
.owncloud
.android
.test
.ui
.actions
.Actions
;
18 import com
.owncloud
.android
.test
.ui
.groups
.NoIgnoreTestCategory
;
19 import com
.owncloud
.android
.test
.ui
.groups
.SmokeTestCategory
;
20 import com
.owncloud
.android
.test
.ui
.models
.FileListView
;
23 @FixMethodOrder(MethodSorters
.NAME_ASCENDING
)
24 public class DeleteFileTestSuite
{
28 private final String FILE_NAME
= Config
.fileToTestName
;
30 @Rule public TestName name
= new TestName();
33 public void setUp() throws Exception
{
35 driver
=common
.setUpCommonDriver();
39 @Category({NoIgnoreTestCategory
.class, SmokeTestCategory
.class})
40 public void testDeleteFile () throws Exception
{
41 FileListView fileListView
= Actions
.login(Config
.URL
, Config
.user
,Config
.password
, Config
.isTrusted
, driver
);
42 common
.assertIsInFileListView();
44 //TODO. if the file already exists, do not upload
45 FileListView fileListViewAfterUploadFile
= Actions
.uploadFile(FILE_NAME
, fileListView
);
47 fileListViewAfterUploadFile
.scrollTillFindElement(FILE_NAME
);
48 Common
.waitTillElementIsNotPresent(fileListViewAfterUploadFile
.getProgressCircular(), 1000);
49 common
.wait
.until(ExpectedConditions
.visibilityOf(fileListViewAfterUploadFile
.getFileElementLayout().findElement(By
.id(FileListView
.getLocalFileIndicator()))));
51 Actions
.deleteElement(FILE_NAME
,fileListViewAfterUploadFile
, driver
);
52 assertFalse(fileListViewAfterUploadFile
.getFileElement().isDisplayed());
56 public void tearDown() throws Exception
{
57 common
.takeScreenShotOnFailed(name
.getMethodName());
58 driver
.removeApp("com.owncloud.android");