-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.e2e.js
26 lines (21 loc) · 975 Bytes
/
example.e2e.js
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
const LoginPage = require('../pageobjects/login.page');
const InventoryPage = require('../pageobjects/inventory.page');
const LoginData = require('../../data/logindata');
const allureReporter = require('@wdio/allure-reporter').default;
describe('UserStory: Login', () => {
allureReporter.addFeature('Login');
it(`Login_1: Should be able to login with valid credentials`, async ()=> {
await LoginPage.open();
await LoginPage.login(LoginData.userName, LoginData.password);
await expect(InventoryPage.secondaryTitle).toHaveTextContaining('PRODUCTS');
})
});
describe(`UserStory: Login`, ()=>{
allureReporter.addFeature('Login');
it(`Login_2: Should be able to login, then logout`, async ()=>{
await LoginPage.open();
await LoginPage.login(LoginData.userName, LoginData.password);
await expect(InventoryPage.secondaryTitle).toHaveTextContaining('PRODUCTS');
await LoginPage.logout();
})
})