2 * ownCloud Android client application
5 * Copyright (C) 2015 ownCloud Inc.
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.
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.
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/>.
21 package com
.owncloud
.android
.test
.ui
.testSuites
;
24 import static org
.junit
.Assert
.*;
25 import io
.appium
.java_client
.android
.AndroidDriver
;
27 import org
.junit
.After
;
28 import org
.junit
.Before
;
29 import org
.junit
.Rule
;
30 import org
.junit
.Test
;
31 import org
.junit
.experimental
.categories
.Category
;
32 import org
.junit
.rules
.TestName
;
34 import com
.owncloud
.android
.test
.ui
.actions
.Actions
;
35 import com
.owncloud
.android
.test
.ui
.groups
.NoIgnoreTestCategory
;
36 import com
.owncloud
.android
.test
.ui
.groups
.SmokeTestCategory
;
37 import com
.owncloud
.android
.test
.ui
.models
.LoginForm
;
38 import com
.owncloud
.android
.test
.ui
.models
.FileListView
;
39 import com
.owncloud
.android
.test
.ui
.models
.MenuList
;
40 import com
.owncloud
.android
.test
.ui
.models
.SettingsView
;
42 public class LogoutTestSuite
{
47 @Rule public TestName name
= new TestName();
50 public void setUp() throws Exception
{
52 driver
=common
.setUpCommonDriver();
56 @Category({NoIgnoreTestCategory
.class, SmokeTestCategory
.class})
57 public void testLogout () throws Exception
{
58 FileListView fileListView
= Actions
.login(Config
.URL
, Config
.user
,
59 Config
.password
, Config
.isTrusted
, driver
);
60 common
.assertIsInFileListView();
61 MenuList menulist
= fileListView
.clickOnMenuButton();
62 SettingsView settingsView
= menulist
.clickOnSettingsButton();
63 settingsView
.tapOnAccountElement(1, 1000);
64 LoginForm loginForm
= settingsView
.clickOnDeleteAccountElement();
65 assertEquals("Server address https://…",
66 loginForm
.gethostUrlInput().getText());
67 assertEquals("Username", loginForm
.getUserNameInput().getText());
68 assertEquals("", loginForm
.getPasswordInput().getText());
72 public void tearDown() throws Exception
{
73 common
.takeScreenShotOnFailed(name
.getMethodName());
74 //driver.removeApp("com.owncloud.android");