@wdio/cucumber-framework 7.31.0 → 7.32.3

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.
@@ -5,6 +5,7 @@ import { Pickle, TestCase, TestStepResult, TestCaseStarted, GherkinDocument, Tes
5
5
  import type { Capabilities } from '@wdio/types';
6
6
  import { HookParams } from './types';
7
7
  export default class CucumberEventListener extends EventEmitter {
8
+ #private;
8
9
  private _pickleFilter;
9
10
  private _gherkinDocEvents;
10
11
  private _scenarios;
@@ -1 +1 @@
1
- {"version":3,"file":"cucumberEventListener.d.ts","sourceRoot":"","sources":["../src/cucumberEventListener.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAU,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EACH,MAAM,EAAE,QAAQ,EAAY,cAAc,EAAE,eAAe,EAAE,eAAe,EAC5E,eAAe,EAAE,gBAAgB,EACpC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMpC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAWd,OAAO,CAAC,aAAa;IAVlE,OAAO,CAAC,iBAAiB,CAAwB;IACjD,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,gBAAgB,CAAC,CAAiB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,WAAW,CAAoC;IACvD,OAAO,CAAC,gBAAgB,CAAe;gBAE1B,gBAAgB,EAAE,YAAY,EAAU,aAAa,EAAE,YAAY;IAuChF,gBAAgB;IAIhB,gBAAgB,CAAC,OAAO,EAA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BAAgB,EAAE,YAAY,EAAU,aAAa,EAAE,YAAY;IAuChF,gBAAgB;IAIhB,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAoDhC,iBAAiB,CAAE,eAAe,EAAE,eAAe;IAgCnD,gBAAgB,CAAE,WAAW,EAAE,MAAM;IAgBrC,gBAAgB;IA4EhB,kBAAkB,CAAE,QAAQ,EAAE,QAAQ;IAetC,iBAAiB,CAAE,QAAQ,EAAE,eAAe;IAkD5C,iBAAiB,CAAE,oBAAoB,EAAE,eAAe;IAoCxD,kBAAkB,CAAE,qBAAqB,EAAE,gBAAgB;IA6B3D,kBAAkB,CACd,OAAO,EAAE,cAAc,EAAE;IA4B7B,iBAAiB;IAkBjB,aAAa;IAIb;;;OAGG;IACH,YAAY,CAAE,IAAI,EAAE,YAAY,CAAC,gBAAgB;CAoBpD"}
@@ -1,17 +1,25 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
2
7
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
9
  };
10
+ var _CucumberEventListener_cwd;
5
11
  Object.defineProperty(exports, "__esModule", { value: true });
6
12
  const events_1 = require("events");
7
13
  const cucumber_1 = require("@cucumber/cucumber");
8
14
  const logger_1 = __importDefault(require("@wdio/logger"));
9
15
  const utils_1 = require("./utils");
16
+ const node_path_1 = __importDefault(require("node:path"));
10
17
  const log = (0, logger_1.default)('CucumberEventListener');
11
18
  class CucumberEventListener extends events_1.EventEmitter {
12
19
  constructor(eventBroadcaster, _pickleFilter) {
13
20
  super();
14
21
  this._pickleFilter = _pickleFilter;
22
+ _CucumberEventListener_cwd.set(this, process.cwd());
15
23
  this._gherkinDocEvents = [];
16
24
  this._scenarios = [];
17
25
  this._testCases = [];
@@ -409,11 +417,16 @@ class CucumberEventListener extends events_1.EventEmitter {
409
417
  /**
410
418
  * match based on Cucumber pickle filter
411
419
  */
412
- .filter(([, fakeId]) => this._pickleFilter.matches({
413
- gherkinDocument,
414
- pickle: this._scenarios.find(s => s.id === fakeId)
415
- }))
420
+ .filter(([, fakeId]) => {
421
+ const pickle = { ...this._scenarios.find(s => s.id === fakeId) };
422
+ pickle.uri = node_path_1.default.relative(__classPrivateFieldGet(this, _CucumberEventListener_cwd, "f"), pickle.uri);
423
+ return this._pickleFilter.matches({
424
+ gherkinDocument,
425
+ pickle
426
+ });
427
+ })
416
428
  .map(([id]) => id);
417
429
  }
418
430
  }
431
+ _CucumberEventListener_cwd = new WeakMap();
419
432
  exports.default = CucumberEventListener;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/cucumber-framework",
3
- "version": "7.31.0",
3
+ "version": "7.32.3",
4
4
  "description": "A WebdriverIO plugin. Adapter for Cucumber.js testing framework.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cucumber-framework",
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "types": "./build/index.d.ts",
50
- "gitHead": "1e3f2b5062ba5a07ec6c26b12d73c7ea36116c0b"
50
+ "gitHead": "3a7c50384510c295547b9a69dd26bf5b1723d07c"
51
51
  }