Skip to content

Commit f8a36dd

Browse files
author
Oleksandr_Halichenko
committed
fixed bug with custom fixture assignment
1 parent eeb680e commit f8a36dd

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1414

1515
:microscope: - experimental
1616

17+
## [1.9.1]
18+
- :beetle: fixed bug with custom fixture assignment
19+
1720
## [1.9.0]
1821
- :rocket: changed logic to construct world in every test case
1922

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/playwright-runner-adapter",
3-
"version": "1.9.0",
3+
"version": "1.9.1",
44
"description": "adapter for playwright test runner",
55
"main": "adapter/index.js",
66
"types": "adapter/index.d.ts",

src/cucumber.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ for (const feature of features) {
6363
attach,
6464
supportCodeLibrary
6565
});
66-
Object.assign(world, fixtures);
66+
world.init(fixtures);
6767
worlds.set(getTestId(test.info()), world);
6868
};
6969
worldFactory.toString = () => { return fixture.init.toString() }

test/step_definitions/steps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ const customExpect = baseExpect.extend({
3939

4040
class ExtendedPlaywrightWorld extends PlaywrightWorld {
4141
customFixture!: number;
42+
renamedCustomFixture!: number;
4243
test = fixture;
4344
expect = customExpect;
4445

4546
init = ({ page, customFixture }: { page: Page, customFixture: number }) => {
4647
this.page = page;
4748
this.customFixture = customFixture;
49+
this.renamedCustomFixture = customFixture;
4850
}
4951
}
5052

@@ -77,6 +79,7 @@ When('attach', async function () {
7779

7880
When('custom fixture', async function (this: ExtendedPlaywrightWorld) {
7981
this.expect(this.customFixture).toEqual(42);
82+
this.expect(this.renamedCustomFixture).toEqual(42);
8083
});
8184

8285
When('custom expect', async function (this: ExtendedPlaywrightWorld) {

0 commit comments

Comments
 (0)