15015c0699a5533fd3bfbc59ed8807d953d0ac35
[pub/Android/ownCloud.git] / automationTest / src / test / java / com / owncloud / android / test / ui / testSuites / RefreshFolderTestSuite.java
1 package com.owncloud.android.test.ui.testSuites;
2
3 import static org.junit.Assert.*;
4 import io.appium.java_client.android.AndroidDriver;
5
6 import org.junit.After;
7 import org.junit.Before;
8 import org.junit.Rule;
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
15 import com.owncloud.android.test.ui.actions.Actions;
16 import com.owncloud.android.test.ui.groups.UnfinishedTestCategory;
17 import com.owncloud.android.test.ui.models.FileListView;
18
19
20 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
21 public class RefreshFolderTestSuite{
22 AndroidDriver driver;
23 Common common;
24
25 @Rule public TestName name = new TestName();
26
27 @Before
28 public void setUp() throws Exception {
29 common=new Common();
30 driver=common.setUpCommonDriver();
31 }
32
33
34 @Test
35 @Category({UnfinishedTestCategory.class})
36 public void testPulldownToRefreshFolder () throws Exception {
37 FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
38 common.assertIsInFileListView();
39 //TODO. Remove the sleep and check why is not working the assert when using waitTillElementIsNotPresent
40 Thread.sleep(5000);
41 //waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
42 fileListView.pulldownToRefresh();
43 assertTrue(fileListView.getProgressCircular().isDisplayed());
44 //TODO insert a file in the web, and check that it's shown here
45 }
46
47
48 @After
49 public void tearDown() throws Exception {
50 common.takeScreenShotOnFailed(name.getMethodName());
51 driver.removeApp("com.owncloud.android");
52 driver.quit();
53 }
54
55 }