forked from pombredanne/taiga-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.e2e.js
137 lines (119 loc) · 4 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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/',
attachments: {
unix: './upload-file-test.txt',
windows: 'C:\\test\\upload-file-test.txt',
unixImg: './upload-image-test.png',
windowsImg: 'C:\\test\\upload-image-test.png'
}
}
},
mochaOpts: {
timeout: 45000,
compilers: 'js:babel/register'
},
// capabilities: {
// browserName: 'internet explorer',
// version: '11'
// },
suites: {
auth: "e2e/suites/auth/*.e2e.js",
public: "e2e/suites/public/**/*.e2e.js",
wiki: "e2e/suites/wiki.e2e.js",
admin: "e2e/suites/admin/**/*.e2e.js",
issues: "e2e/suites/issues/*.e2e.js",
tasks: "e2e/suites/tasks/*.e2e.js",
userProfile: "e2e/suites/user-profile/*.e2e.js",
userStories: "e2e/suites/user-stories/*.e2e.js",
backlog: "e2e/suites/backlog.e2e.js",
home: "e2e/suites/home.e2e.js",
kanban: "e2e/suites/kanban.e2e.js",
projectHome: "e2e/suites/project-home.e2e.js",
search: "e2e/suites/search.e2e.js",
team: "e2e/suites/team.e2e.js",
discover: "e2e/suites/discover/*.e2e.js"
},
onPrepare: function() {
// track mouse movements
var trackMouse = function() {
angular.module('trackMouse', []).run(function($document) {
function addDot(ev) {
var color = 'black',
size = 6;
switch (ev.type) {
case 'click':
color = 'red';
break;
case 'dblclick':
color = 'blue';
break;
case 'mousemove':
color = 'green';
break;
}
var dotEl = $('<div></div>')
.css({
position: 'fixed',
height: size + 'px',
width: size + 'px',
'background-color': color,
top: ev.clientY,
left: ev.clientX,
'z-index': 9999,
// make sure this dot won't interfere with the mouse events of other elements
'pointer-events': 'none'
})
.appendTo('body');
setTimeout(function() {
dotEl.remove();
}, 1000);
}
$document.on({
click: addDot,
dblclick: addDot,
mousemove: addDot
});
});
};
browser.addMockModule('trackMouse', trackMouse);
require('./e2e/capabilities.js');
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 utils.common.closeJoyride();
})
.then(function() {
return browser.getCapabilities();
}).then(function (cap) {
browser.browserName = cap.caps_.browserName;
})
.then(function() {
return browser.get(browser.params.glob.host);
});
}
}