@qavajs/playwright-runner-adapter 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
10
10
  :pencil: - chore
11
11
  :microscope: - experimental
12
12
 
13
+ ## [0.5.0]
14
+ - :rocket: updated gherkin dependency
15
+ - :rocket: added _expect_ to default world
16
+
13
17
  ## [0.4.0]
14
18
  - :rocket: added support of _requireModules_ option
15
19
  - :rocket: improved _defineCucumber_ function to encapsulate adapter path
package/README.md CHANGED
@@ -35,7 +35,7 @@ export default defineConfig({
35
35
  Custom test instance can be passed to world constructor as _test_ property.
36
36
  And then fixtures can be connected with world instance via _init_ property.
37
37
  ```typescript
38
- import { test as base } from '@playwright/test';
38
+ import { test as base, expect as baseExpect } from '@playwright/test';
39
39
  import { SettingsPage } from './settings-page';
40
40
  import { setWorldConstructor } from '@cucumber/cucumber';
41
41
  import { PlaywrightWorld } from '@qavajs/playwright-runner-adapter/PlaywrightWorld';
@@ -50,6 +50,12 @@ const customTest = base.extend<MyFixtures>({
50
50
  },
51
51
  });
52
52
 
53
+ const customExpect = baseExpect.extend({
54
+ async customMatcher() {
55
+ // implementation
56
+ }
57
+ });
58
+
53
59
  class ExtendedPlaywrightWorld extends PlaywrightWorld {
54
60
  settingsPage: SettingsPage;
55
61
  constructor(options: any) {
@@ -58,6 +64,7 @@ class ExtendedPlaywrightWorld extends PlaywrightWorld {
58
64
 
59
65
  // set test property with extened one
60
66
  test = customTest;
67
+ expect = customExpect;
61
68
 
62
69
  // init arrow function connects fixtures with Cucumber world instance
63
70
  init = ({ settingsPage }) => {
@@ -8,6 +8,7 @@ const test_1 = require("@playwright/test");
8
8
  class PlaywrightWorld {
9
9
  constructor(options) {
10
10
  this.test = test_1.test;
11
+ this.expect = test_1.expect;
11
12
  this.init = ({ browser, context, page }) => {
12
13
  this.browser = browser;
13
14
  this.context = context;
@@ -1 +1 @@
1
- {"version":3,"file":"PlaywrightWorld.js","sourceRoot":"","sources":["../src/PlaywrightWorld.ts"],"names":[],"mappings":";;;AAAA,2CAA0F;AAE1F;;GAEG;AACH,MAAa,eAAe;IAWxB,YAAY,OAAY;QAFxB,SAAI,GAAG,WAAI,CAAC;QAQZ,SAAI,GAAiC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAA6D,EAAE,EAAE;YAC3H,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC,CAAA;QATG,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACzC,CAAC;CAOJ;AAtBD,0CAsBC"}
1
+ {"version":3,"file":"PlaywrightWorld.js","sourceRoot":"","sources":["../src/PlaywrightWorld.ts"],"names":[],"mappings":";;;AAAA,2CAAkG;AAElG;;GAEG;AACH,MAAa,eAAe;IAYxB,YAAY,OAAY;QAHxB,SAAI,GAAG,WAAI,CAAC;QACZ,WAAM,GAAG,aAAM,CAAC;QAQhB,SAAI,GAAiC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAA6D,EAAE,EAAE;YAC3H,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC,CAAA;QATG,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACzC,CAAC;CAOJ;AAvBD,0CAuBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qavajs/playwright-runner-adapter",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "adapter for playwright test runner",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -10,13 +10,13 @@
10
10
  "author": "Alexandr Galichenko",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@cucumber/gherkin": "^28.0.0",
13
+ "@cucumber/gherkin": "^29.0.0",
14
14
  "glob": "^11.0.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@cucumber/cucumber": "^10.8.0",
18
- "@playwright/test": "^1.45.3",
19
- "@types/node": "^22.1.0",
17
+ "@cucumber/cucumber": "^11.0.0",
18
+ "@playwright/test": "^1.46.1",
19
+ "@types/node": "^22.5.4",
20
20
  "typescript": "^5.5.4"
21
21
  }
22
22
  }
@@ -1,4 +1,4 @@
1
- import { APIRequestContext, Browser, BrowserContext, Page, test } from '@playwright/test';
1
+ import { APIRequestContext, Browser, BrowserContext, Page, test, expect } from '@playwright/test';
2
2
 
3
3
  /**
4
4
  * Cucumber world for playwright adapter
@@ -13,6 +13,7 @@ export class PlaywrightWorld {
13
13
  attach!: (data: any, details?: { fileName?: string, mediaType: string }) => void;
14
14
  parameters!: string;
15
15
  test = test;
16
+ expect = expect;
16
17
 
17
18
  constructor(options: any) {
18
19
  this.log = options.log;