-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogout.e2e.js
More file actions
61 lines (53 loc) · 2.43 KB
/
Copy pathlogout.e2e.js
File metadata and controls
61 lines (53 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { browser, driver, expect } from '@wdio/globals';
import ForYouScreen from '../pageobjects/Home/ForYouScreen.page';
import SidebarScreen from '../pageobjects/Home/SidebarScreen.page';
import LoginEmailScreen from '../pageobjects/Login/LoginEmail.page';
import LoginPasswordScreen from '../pageobjects/Login/LoginPassword.page';
import AccountInformationScreen from '../pageobjects/Settings/AccountInformationScreen.page';
import AccountSettingsScreen from '../pageobjects/Settings/AccountSettingsScreen.page';
import SettingsScreen from '../pageobjects/Settings/SettingsScreen.page';
import StartScreen from '../pageobjects/StartScreen.page';
import { createTestUser } from '../utils/createTestUser';
let testUser;
describe('Logout Flow', () => {
const login = async () => {
testUser = await createTestUser();
await StartScreen.openLoginScreen();
await LoginEmailScreen.enterEmail(testUser.email);
await LoginEmailScreen.clickNext();
await LoginPasswordScreen.enterPassword(testUser.password);
await LoginPasswordScreen.clickLogin();
await ForYouScreen.forYouTab.waitForDisplayed();
};
beforeEach(async () => {
await login();
await ForYouScreen.openSideMenu();
});
it('should log out successfully from sidebar', async () => {
await SidebarScreen.logout();
await StartScreen.welcomeText.waitForDisplayed();
await expect(await StartScreen.isDisplayed()).toBe(true);
});
it('should log out successfully from account switcher drawer', async () => {
await browser.pause(500);
await SidebarScreen.openAccountSwitcherDrawer();
await SidebarScreen.logoutFromAccountSwitcher();
await StartScreen.welcomeText.waitForDisplayed();
await expect(await StartScreen.isDisplayed()).toBe(true);
});
it('should log out successfully from account information settings', async () => {
await SidebarScreen.goToSettings();
await SettingsScreen.goToAccountSettings();
await AccountSettingsScreen.goToAccountInformation();
await AccountInformationScreen.logout();
await StartScreen.welcomeText.waitForDisplayed();
await expect(await StartScreen.isDisplayed()).toBe(true);
});
it('should not show start screen when side swiping and logged in', async () => {
await driver.back();
await driver.back();
await driver.activateApp('space.cmp27.raven');
await ForYouScreen.forYouTab.waitForDisplayed();
await expect(await ForYouScreen.isDisplayed()).toBe(true);
});
});