forked from pombredanne/taiga-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.e2e.js
59 lines (51 loc) · 1.53 KB
/
conf.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
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
require("babel/register")({
stage: 1
});
var utils = require('./e2e/utils');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
framework: 'mocha',
params: {
glob: {
host: 'http://localhost:9001/'
}
},
mochaOpts: {
timeout: 30000,
compilers: 'js:babel/register'
},
// capabilities: {
// 'browserName': 'firefox'
// },
suites: {
auth: 'e2e/auth/*.e2e.js',
full: 'e2e/full/**/*.e2e.js',
public: 'e2e/public/**/*.e2e.js'
},
onPrepare: function() {
browser.driver.manage().window().maximize();
browser.getCapabilities().then(function (cap) {
browser.browserName = cap.caps_.browserName;
});
browser.get(browser.params.glob.host + 'login');
var username = $('input[name="username"]');
username.sendKeys('admin');
var password = $('input[name="password"]');
password.sendKeys('123123');
$('.submit-button').click();
return browser.driver.wait(function() {
return utils.common.closeCookies()
.then(function() {
return browser.driver.getCurrentUrl();
})
.then(function(url) {
return url === browser.params.glob.host;
});
}, 10000)
.then(function() {
return browser.getCapabilities();
}).then(function (cap) {
browser.browserName = cap.caps_.browserName;
});
}
}