-
-
Notifications
You must be signed in to change notification settings - Fork 261
/
app.login.spec.ts
39 lines (34 loc) · 1.59 KB
/
app.login.spec.ts
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
import TabBar from '../screenobjects/components/TabBar.js';
import LoginScreen from '../screenobjects/LoginScreen.js';
import NativeAlert from '../screenobjects/components/NativeAlert.js';
describe('WebdriverIO and Appium, when interacting with a login form,', () => {
beforeEach(async () => {
await TabBar.waitForTabBarShown();
await TabBar.openLogin();
await LoginScreen.waitForIsShown(true);
});
it('should be able login successfully', async () => {
// Always make sure you are on the right tab
await LoginScreen.tapOnLoginContainerButton();
// Submit the data
await LoginScreen.submitLoginForm({ username: '[email protected]', password: 'Test1234!' });
// Wait for the alert and validate it
await NativeAlert.waitForIsShown();
await expect(await NativeAlert.text()).toContain('Success');
// Close the alert
await NativeAlert.topOnButtonWithText('OK');
await NativeAlert.waitForIsShown(false);
});
it('should be able sign up successfully', async () => {
// Always make sure you are on the right tab
await LoginScreen.tapOnSignUpContainerButton();
// Submit the data
await LoginScreen.submitSignUpForm({ username: '[email protected]', password: 'Test1234!' });
// Wait for the alert and validate it
await NativeAlert.waitForIsShown();
await expect(await NativeAlert.text()).toContain('Signed Up');
// Close the alert
await NativeAlert.topOnButtonWithText('OK');
await NativeAlert.waitForIsShown(false);
});
});