This repository has been archived by the owner on Jan 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
login.po.js
56 lines (36 loc) · 1.47 KB
/
login.po.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
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
BrowserUtils = require('../utils/browser.utils.js')
class Login extends BrowserUtils {
constructor() {
super(by.css('.button'), true);
this._userNameField = by.css('#username');
this._passwordField = by.css('#password');
this._signIn = by.css('.button');
let EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(element(by.css('#username'))), 7000);
browser.wait(EC.visibilityOf(element(by.css('#password'))), 7000);
}
isLoaded() {
}
inputCredentials(username, password) {
let EC = protractor.ExpectedConditions;
browser.wait(EC.elementToBeClickable(element(this._userNameField)), 3000);
element(this._userNameField).isDisplayed();
element(this._userNameField).click();
element(this._userNameField).sendKeys(username);
element(this._passwordField).isDisplayed();
element(this._passwordField).click();
element(this._passwordField).sendKeys(password);
}
clickSignIn() {
browser.wait(10000);
element(this._signIn).click();
}
signInTo() {
this.waitForUrlToChangeTo(RegExp('login'))
this.inputCredentials(process.env.CCD_CASEWORKER_AUTOTEST_EMAIL, process.env.CCD_CASEWORKER_AUTOTEST_PASSWORD);
this.clickSignIn()
this.waitForUrlToChangeTo(RegExp("list"))
// browser.sleep(1000).then(function() { browser.ignoreSynchronization = false })
}
}
module.exports = Login