Skip to content

Commit 71485a5

Browse files
authored
fix: session acceptance test (#4040)
1 parent 3d9b894 commit 71485a5

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

test/acceptance/codecept.Playwright.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports.config = {
2323
require: '../support/ScreenshotSessionHelper.js',
2424
outputPath: 'test/acceptance/output',
2525
},
26+
Expect: {},
2627
},
2728
include: {},
2829
bootstrap: false,

test/acceptance/codecept.Puppeteer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports.config = {
1919
require: '../support/ScreenshotSessionHelper.js',
2020
outputPath: './output',
2121
},
22+
Expect: {},
2223
},
2324
include: {},
2425
bootstrap: false,

test/acceptance/codecept.Testcafe.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports.config = {
99
url: TestHelper.siteUrl(),
1010
show: true,
1111
},
12+
Expect: {},
1213
},
1314
include: {},
1415
bootstrap: false,

test/acceptance/codecept.WebDriver.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports.config = {
2121
require: '../support/ScreenshotSessionHelper.js',
2222
outputPath: './output',
2323
},
24+
Expect: {},
2425
},
2526
include: {},
2627
bootstrap: async () => new Promise(done => {

test/acceptance/session_test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Feature('Session');
77
Scenario('simple session @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
88
I.amOnPage('/info');
99
session('john', () => {
10-
I.amOnPage('https://github.com');
10+
I.amOnPage('https://codecept.io/');
1111
I.dontSeeInCurrentUrl('/info');
12-
I.see('GitHub');
12+
I.see('CodeceptJS');
1313
});
1414
I.dontSee('GitHub');
1515
I.seeInCurrentUrl('/info');
@@ -38,11 +38,11 @@ Scenario('screenshots reflect the current page of current session @Puppeteer @Pl
3838
]);
3939

4040
// Assert that screenshots of same page in same session are equal
41-
assert.equal(default1Digest, default2Digest);
42-
assert.equal(john1Digest, john2Digest);
41+
I.expectEqual(default1Digest, default2Digest);
42+
I.expectEqual(john1Digest, john2Digest);
4343

4444
// Assert that screenshots of different pages in different sessions are not equal
45-
assert.notEqual(default1Digest, john1Digest);
45+
I.expectNotEqual(default1Digest, john1Digest);
4646
});
4747

4848
Scenario('Different cookies for different sessions @WebDriverIO @Playwright @Puppeteer', async ({ I }) => {
@@ -72,9 +72,9 @@ Scenario('Different cookies for different sessions @WebDriverIO @Playwright @Pup
7272
assert(cookies.default);
7373
assert(cookies.john);
7474
assert(cookies.mary);
75-
assert.notEqual(cookies.default, cookies.john);
76-
assert.notEqual(cookies.default, cookies.mary);
77-
assert.notEqual(cookies.john, cookies.mary);
75+
I.expectNotEqual(cookies.default, cookies.john);
76+
I.expectNotEqual(cookies.default, cookies.mary);
77+
I.expectNotEqual(cookies.john, cookies.mary);
7878
});
7979

8080
Scenario('should save screenshot for active session @WebDriverIO @Puppeteer @Playwright', async function ({ I }) {
@@ -94,7 +94,7 @@ Scenario('should save screenshot for active session @WebDriverIO @Puppeteer @Pla
9494
]);
9595

9696
// Assert that screenshots of same page in same session are equal
97-
assert.equal(original, failed);
97+
I.expectEqual(original, failed);
9898
});
9999

100100
Scenario('should throw exception and close correctly @WebDriverIO @Puppeteer @Playwright', ({ I }) => {
@@ -160,7 +160,7 @@ Scenario('change page emulation @Playwright', async ({ I }) => {
160160
}, async () => {
161161
I.amOnPage('/');
162162
const width = await I.executeScript('window.innerWidth');
163-
assert.equal(width, 300);
163+
I.expectEqual(width, 300);
164164
});
165165
});
166166

0 commit comments

Comments
 (0)