-
-
Notifications
You must be signed in to change notification settings - Fork 750
Expand file tree
/
Copy pathconfig_test.js
More file actions
47 lines (40 loc) · 1.44 KB
/
config_test.js
File metadata and controls
47 lines (40 loc) · 1.44 KB
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
Feature('Dynamic Config').config({ url: 'https://google.com' })
Scenario('change config 1 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.dontSeeInCurrentUrl('github.com')
I.seeInCurrentUrl('google.com')
})
Scenario('change config 2 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.seeInCurrentUrl('codecept.io')
}).config({ url: 'https://codecept.io' })
Scenario('change config 3 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.dontSeeInCurrentUrl('codecept.io')
I.seeInCurrentUrl('google.com')
})
Scenario('change config 4 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.seeInCurrentUrl('codecept.io')
}).config(test => {
return { url: 'https://codecept.io/', capabilities: { 'moz:title': test.title } }
})
Scenario('change config 5 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.dontSeeInCurrentUrl('codecept.io')
I.seeInCurrentUrl('google.com')
})
Scenario('make API call and check response @Playwright', ({ I }) => {
I.amOnPage('/')
I.makeApiRequest('get', 'https://reqres.in/api/users?page=2', { headers: {'x-api-key': 'reqres-free-v1'}})
I.seeResponseCodeIsSuccessful()
})
Scenario('change config 6 @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
I.amOnPage('/')
I.seeInCurrentUrl('codecept.io')
}).config(async () => {
await new Promise(r => {
setTimeout(r, 50)
})
return { url: 'https://codecept.io' }
})