-
Notifications
You must be signed in to change notification settings - Fork 0
/
codecept.conf.js
75 lines (70 loc) · 1.78 KB
/
codecept.conf.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
const fs = require('fs');
const settings = require('./settings.js').config;
const include = {
I: './steps_file.js'
}
const pages = fs.readdirSync('./pages');
for(let i = 0; i < pages.length; i++) {
const file = pages[i];
if(fs.statSync('./pages/'+file).isFile()) {
const name = file.split('.');
if(fs.existsSync('./pages/'+settings.version+'/'+file) && fs.statSync('./pages/'+settings.version+'/'+file)) {
include[name[0]] = './pages/'+settings.version+'/'+file;
} else {
include[name[0]] = './pages/'+file;
}
}
}
const url = 'http://localhost:' + (settings.port ? settings.port: 4502 + '/aem/start.html');
console.log('testing aem instance at', url);
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: url,
windowSize: "1280x960",
show: true,
restart: true,
chrome: {
args: ['--no-sandbox', '--window-size=1280,960'],
defaultViewport: {
width: 1280,
height: 960
}
}
}
},
plugins: {
"stepByStepReport": {
"enabled": true,
"deleteSuccessful": false,
animateSlides: false
},
autoLogin: {
enabled: true,
saveToFile: true,
inject: 'login',
users: {
admin: {
login: (I) => {
console.log('login')
I.amOnPage('/libs/granite/core/content/login.html');
I.fillField('j_username', 'admin');
I.fillField('j_password', 'admin');
I.click('Sign In');
},
check: async (I) => {
console.log('check')
I.amOnPage('/aem/start.html');
I.see('Navigation');
}
}
}
}
},
include: include,
bootstrap: null,
mocha: {},
name: 'aem-test-suite'
}