blob: cd6b8f673383299a438dd67295f219d31129b474 (
plain)
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
|
import { $, $$, browser, ElementFinder } from 'protractor';
export class Helper {
static EC = browser.ExpectedConditions;
static TIMEOUT = 10000;
/**
* Checks if there are any errors on the browser
*
* @static
* @memberof Helper
*/
static checkConsole() {
browser
.manage()
.logs()
.get('browser')
.then(function(browserLog) {
browserLog = browserLog.filter((log) => {
return log.level.value > 900; // SEVERE level
});
if (browserLog.length > 0) {
console.log('\n log: ' + require('util').inspect(browserLog));
}
expect(browserLog.length).toEqual(0);
});
}
static getBreadcrumb() {
return $('.breadcrumb-item.active');
}
static getTabText(idx) {
return $$('.nav.nav-tabs li')
.get(idx)
.getText();
}
static getTabsCount() {
return $$('.nav.nav-tabs li').count();
}
static waitTextToBePresent(elem: ElementFinder, text: string, message?: string) {
return browser.wait(Helper.EC.textToBePresentInElement(elem, text), Helper.TIMEOUT, message);
}
}
|