This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodecept.config.ts
75 lines (72 loc) · 2.03 KB
/
codecept.config.ts
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
import config from './config'
const { adminUser, frontendUrl, isCI, browser } = config
const isChromium = browser === 'chromium'
exports.config = {
tests: 'tests/**.ts',
output: './output', // we are not using any artifacts right now, but still need an output directory
helpers: {
Playwright: {
url: frontendUrl,
restart: 'keep',
keepBrowserState: true,
keepCookies: true,
show: isCI ? false : true,
...(isCI && isChromium
? {
chromium: {
args: ['--no-sandbox'], // this is needed for github CI to work
},
}
: { browser }),
},
},
name: 'frontend-e2e-tests',
plugins: {
// https://codecept.io/locators/#custom-locators
customLocator: {
enabled: true,
// Allows data-qa attributes to be selected with $ prefix. E.g
// `I.click({ css: '[data-qa=register_button]'})` becomes `I.click('$register_button')`
attribute: 'data-qa',
},
autoLogin: {
enabled: true,
saveToFile: false,
inject: 'login',
users: {
admin: {
login: (I) => {
I.amOnPage('/')
I.see('Anmelden')
I.click('Anmelden')
I.waitForText('Benutzername oder E-Mailadresse', 10)
I.fillField('Benutzername oder E-Mailadresse', adminUser)
I.fillField('Passwort', '123456')
I.click('Anmelden', "button[value='password']")
I.waitForText(`Willkommen ${adminUser}!`, 30)
},
check: (I) => {
I.amOnPage('/')
I.waitForElement(
`header nav img[title='Benutzer*in ${adminUser}']`,
15,
)
},
// see https://github.com/codeceptjs/CodeceptJS/issues/1591#issuecomment-480800333
fetch: () => 'whatever',
restore: () => {},
},
},
},
pauseOnFail: {},
retryFailedStep: {
enabled: true,
},
tryTo: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
},
},
}