1d4c76c02ce4f0c5a148cd49411801cd8eecf8f0
[pub/Android/ownCloud.git] / automationTest / src / test / java / com / owncloud / android / test / ui / testSuites / RefreshFolderTestSuite.java
1 /**
2 * ownCloud Android client application
3 *
4 * @author purigarcia
5 * Copyright (C) 2015 ownCloud Inc.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2,
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 package com.owncloud.android.test.ui.testSuites;
22
23 import static org.junit.Assert.*;
24 import io.appium.java_client.android.AndroidDriver;
25
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Rule;
29 import org.junit.experimental.categories.Category;
30 import org.junit.rules.TestName;
31 import org.junit.runners.MethodSorters;
32 import org.junit.FixMethodOrder;
33 import org.junit.Test;
34
35 import com.owncloud.android.test.ui.actions.Actions;
36 import com.owncloud.android.test.ui.groups.UnfinishedTestCategory;
37 import com.owncloud.android.test.ui.models.FileListView;
38
39
40 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
41 public class RefreshFolderTestSuite{
42 AndroidDriver driver;
43 Common common;
44
45 @Rule public TestName name = new TestName();
46
47 @Before
48 public void setUp() throws Exception {
49 common=new Common();
50 driver=common.setUpCommonDriver();
51 }
52
53
54 @Test
55 @Category({UnfinishedTestCategory.class})
56 public void testPulldownToRefreshFolder () throws Exception {
57 FileListView fileListView = Actions.login(Config.URL, Config.user,
58 Config.password, Config.isTrusted, driver);
59 common.assertIsInFileListView();
60 //TODO. Remove the sleep and check why is not working the assert
61 //when using waitTillElementIsNotPresent
62 Thread.sleep(5000);
63 //waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
64 fileListView.pulldownToRefresh();
65 assertTrue(fileListView.getProgressCircular().isDisplayed());
66 //TODO insert a file in the web, and check that it's shown here
67 }
68
69
70 @After
71 public void tearDown() throws Exception {
72 common.takeScreenShotOnFailed(name.getMethodName());
73 driver.removeApp("com.owncloud.android");
74 driver.quit();
75 }
76
77 }