wdio-rerun-service 2.0.7 โ†’ 3.0.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
@@ -13,6 +13,54 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
13
13
 
14
14
  ---
15
15
 
16
+ ## v3.0.0 (2025-12-25)
17
+
18
+ #### :boom: Breaking Change
19
+ * **Node.js 20+ required** - Dropped support for Node.js 18 to leverage native APIs (`crypto.randomUUID()`, `util.parseArgs()`)
20
+
21
+ #### :house: Internal
22
+ * **Zero runtime dependencies** - Faster installs, smaller `node_modules`, no supply chain risk from transitive dependencies
23
+ * **Comprehensive E2E test suite** - 46 tests covering Cucumber (26), Jasmine (10), and Mocha (10) scenarios running real WebdriverIO processes, ensuring the service works correctly in actual usage
24
+ * **Cross-platform CI** - 12 GitHub Actions jobs testing Node 20/22/24 across macOS, Windows, and Linux, catching platform-specific bugs before release
25
+ * **ESLint v9** - Migrated to flat config with typescript-eslint unified tooling for modern, maintainable linting
26
+
27
+ #### :memo: Documentation
28
+ * Updated README with quality badges (coverage, E2E tests, zero deps)
29
+
30
+ #### Committers: 1
31
+ - [@esaari](https://github.com/esaari)
32
+
33
+ ---
34
+
35
+ ## v2.1.0 (2025-12-22)
36
+ #### :rocket: New Feature
37
+ * Support for Cucumber scenarios nested inside `Rule:` blocks - line numbers are now correctly extracted for reruns
38
+
39
+ #### :bug: Bug Fix
40
+ * Fixed WebdriverIO v9 compatibility - updated `@cucumber/messages` enum comparison to work with both v8 and v9
41
+
42
+ #### :house: Internal
43
+ * Migrated from Jest to Vitest - faster test execution, no experimental flags needed
44
+ * Switched to pnpm for development (enforced via `packageManager` field)
45
+ * Updated all dependencies to latest versions
46
+ * Removed deprecated `@types/uuid` - uuid v13 includes its own types
47
+ * Achieved 100% unit test coverage
48
+ * Node.js 18+ required (compatible with both WDIO v8 and v9)
49
+
50
+ #### Committers: 1
51
+ - [@esaari](https://github.com/esaari)
52
+
53
+ ## v2.0.7 (2023-7-24)
54
+ #### :bug: Bug Fix
55
+ * [[#67]](https://github.com/webdriverio-community/wdio-rerun-service/pull/67) Update some dependencies ([@esaari](https://github.com/esaari))
56
+
57
+ #### :memo: Documentation
58
+ * [[#63]](https://github.com/webdriverio-community/wdio-rerun-service/pull/63) Update Readme ([@mikesalvia](https://github.com/mikesalvia))
59
+
60
+ #### Committers: 3
61
+ - [@esaari](https://github.com/esaari)
62
+ - [@mikesalvia](https://github.com/mikesalvia)
63
+
16
64
  ## v2.0.6 (2023-1-19)
17
65
  #### :bug: Bug Fix
18
66
  * [[#56]](https://github.com/webdriverio-community/wdio-rerun-service/pull/56) [v8] Generate failure line number at Example data line ([@cesar-rivera](https://github.com/cesar-rivera), [@wenzhhu](https://github.com/wenzhhu))
package/README.md CHANGED
@@ -1,27 +1,57 @@
1
- WebdriverIO Re-run Service
2
- ==========================
3
-
4
- [![wdio-rerun-service CI](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml/badge.svg)](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml)
5
- ![npm](https://img.shields.io/npm/dm/wdio-rerun-service)
6
- ![npm bundle size](https://img.shields.io/bundlephobia/min/wdio-rerun-service)
7
- ![GitHub issues](https://img.shields.io/github/issues/webdriverio-community/wdio-rerun-service)
1
+ # WebdriverIO Re-run Service
2
+
3
+ [![CI](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml/badge.svg)](https://github.com/webdriverio-community/wdio-rerun-service/actions/workflows/test.yml)
4
+ ![Unit Test Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
5
+ ![E2E Tests](https://img.shields.io/badge/e2e-46%20tests-brightgreen)
6
+ ![npm](https://img.shields.io/npm/v/wdio-rerun-service)
7
+ ![npm downloads](https://img.shields.io/npm/dm/wdio-rerun-service)
8
+ ![node](https://img.shields.io/node/v/wdio-rerun-service)
9
+ ![TypeScript](https://img.shields.io/badge/TypeScript-100%25-blue)
10
+ ![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)
11
+ ![License](https://img.shields.io/github/license/webdriverio-community/wdio-rerun-service)
8
12
 
9
13
  This service tracks failing Mocha or Jasmine tests and Cucumber scenarios executed within the [WebdriverIO](https://webdriver.io) test framework. It will allow failing or unstable tests or scenarios to be re-run.
10
14
 
11
- _NOTE_: Users running WebdriverIO `7.x.x`, use version `1.7.x` version of this service. If you are on the latest major version of `8.x.x`, use the latest `2.x.x` version of this service.
15
+ ## Features
16
+
17
+ - ๐Ÿ”„ Re-run failed Mocha, Jasmine, or Cucumber tests after the main test run completes
18
+ - ๐Ÿฅ’ Full Cucumber support including scenarios inside `Rule:` blocks
19
+ - ๐Ÿท๏ธ Filter out scenarios with specific tags from re-runs
20
+ - ๐ŸชŸ Cross-platform support (generates `rerun.sh` on Unix, `rerun.bat` on Windows)
21
+ - โš™๏ธ Configurable command prefix and custom parameters
22
+
23
+ ## Quality & Reliability
24
+
25
+ - โœ… **100% test coverage** โ€” comprehensive unit and E2E tests
26
+ - ๐Ÿงช **E2E tests** โ€” real WebdriverIO runs across Cucumber, Mocha, and Jasmine
27
+ - ๐Ÿ–ฅ๏ธ **Cross-platform CI** โ€” tested on macOS, Windows, and Linux
28
+ - ๐Ÿ“ฆ **Zero dependencies** โ€” only WebdriverIO peer dependencies, minimal footprint
29
+ - ๐Ÿ”ท **100% TypeScript** โ€” fully typed for great IDE support
30
+ - ๐Ÿš€ **Modern Node.js** โ€” uses native APIs (`crypto.randomUUID`, `util.parseArgs`)
31
+
32
+ ## Compatibility
33
+
34
+ | wdio-rerun-service | WebdriverIO | Node.js |
35
+ |--------------------|-------------|---------|
36
+ | `^3.0.0` | `^8.0.0 \|\| ^9.0.0` | `>=20` |
37
+ | `^2.1.0` | `^8.0.0 \|\| ^9.0.0` | `>=18` |
38
+ | `^2.0.0` | `^8.0.0` | `>=18` |
39
+ | `^1.7.0` | `^7.0.0` | `>=14` |
12
40
 
13
41
  ## Re-run vs. Retry
14
42
 
15
- The `retry` logic built into WebdriverIO for Cucumber and Mocha/Jasmine is helpful for handling flaky steps in Cucumber and Mocha/Jasmine. Retrying in each framework has caveats:
16
- * Cucumber: It does not take into account that some steps may not be able to be retried in the middle of a test. Running a step twice may break the rest of the Scenario or it may not be possible in the test context.
17
- * Mocha/Jasmine: The `retry` logic may be applied to an individual test, however, this is still done in real-time and perhaps does not account for temporal issues or network connectivity problems.
43
+ The `retry` logic built into WebdriverIO for Cucumber and Mocha/Jasmine is helpful for handling flaky steps in Cucumber and Mocha/Jasmine. Retrying in each framework has caveats:
44
+
45
+ - **Cucumber:** It does not take into account that some steps may not be able to be retried in the middle of a test. Running a step twice may break the rest of the Scenario or it may not be possible in the test context.
46
+ - **Mocha/Jasmine:** The `retry` logic may be applied to an individual test, however, this is still done in real-time and perhaps does not account for temporal issues or network connectivity problems.
18
47
 
19
48
  The main distinctions of the `re-run`:
20
- * Will re-run an entire individual Cucumber Scenario and not just a single step
21
- * Enables an entire spec file to be re-run after a main test execution is complete
22
- * May be copied and executed locally (`retry` cannot)
23
- * Can still be used in conjunction with `retry` methods
24
- * Does not require any code change to apply `retry` logic to flaky or problematic tests
49
+
50
+ - Will re-run an entire individual Cucumber Scenario and not just a single step
51
+ - Enables an entire spec file to be re-run after a main test execution is complete
52
+ - May be copied and executed locally (`retry` cannot)
53
+ - Can still be used in conjunction with `retry` methods
54
+ - Does not require any code change to apply `retry` logic to flaky or problematic tests
25
55
 
26
56
  It is recommended to take some time to evaluate the options available. A hybrid solution may be the best solution to provide the best real and actionable test results.
27
57
 
@@ -33,12 +63,18 @@ Using `npm`:
33
63
  npm install wdio-rerun-service
34
64
  ```
35
65
 
36
- or using `yarn`:
66
+ Using `yarn`:
37
67
 
38
68
  ```bash
39
69
  yarn add wdio-rerun-service
40
70
  ```
41
71
 
72
+ Using `pnpm`:
73
+
74
+ ```bash
75
+ pnpm add wdio-rerun-service
76
+ ```
77
+
42
78
  After package installation is complete, add it to `services` array in `wdio.conf.js`:
43
79
 
44
80
  ```js
@@ -46,52 +82,75 @@ After package installation is complete, add it to `services` array in `wdio.conf
46
82
  import RerunService from 'wdio-rerun-service';
47
83
  export const config = {
48
84
  // ...
49
- services: [RerunService, {
50
- // ...
51
- }]
85
+ services: [
86
+ [RerunService, {
87
+ // Re-run service options here...
88
+ }]
89
+ ],
90
+ // ...
52
91
  };
53
92
  ```
54
93
 
55
- Instructions on how to install `WebdriverIO` can be found [here.](https://webdriver.io/docs/gettingstarted.html)
94
+ Instructions on how to install `WebdriverIO` can be found in the [official documentation](https://webdriver.io/docs/gettingstarted.html).
56
95
 
57
96
  ## Usage
97
+
58
98
  By design, this service does not automatically re-run failed tests.
59
99
 
60
- After WebDriver.IO has completed execution, if failures or unstable tests/scenarios are found a file will be at **rerunScriptPath** or by default `./rerun.sh` (see Configuration).
100
+ After WebdriverIO has completed execution, if failures are found, a re-run script will be generated at **rerunScriptPath** (default: `./rerun.sh` on Unix, `./rerun.bat` on Windows).
101
+
102
+ You can then execute this script manually or integrate it into your CI pipeline.
103
+
104
+ ### Disabling Re-run
105
+
106
+ Set the environment variable `DISABLE_RERUN=true` to disable the service (useful during re-run execution to prevent infinite loops).
61
107
 
62
108
  ### Conditional Re-run
63
- Every teams re-run needs will differ execution could be based on any number of factors, this is an example of how to accomplish a conditional re-run based on # of failures.
64
109
 
65
- ##### attemptRerun.sh
66
- Executes `./rerun.sh` if less than 25 failures have been found in last execution of WebDriver.IO.
110
+ Every team's re-run needs will differโ€”execution could be based on any number of factors. This is an example of how to accomplish a conditional re-run based on number of failures.
111
+
112
+ #### attemptRerun.sh
113
+
114
+ Executes `./rerun.sh` if less than 25 failures have been found in the last execution of WebdriverIO.
115
+
67
116
  ```sh
68
117
  #!/usr/bin/env bash
69
118
  MAX_TO_RERUN=${MAX_TO_RERUN:=25}
70
119
  if [ -f "rerun.sh" ]; then
71
- echo "[rerun.sh] file exits, checking total failures."
120
+ echo "[rerun.sh] file exists, checking total failures."
72
121
  NUMBER_OF_FAILURES=$(grep "\-\-spec" -o rerun.sh | wc -l | xargs)
73
- if [ "$MAX_TO_RERUN" -gt "$NUMBER_OF_FAILURES" ]; then
122
+ if [ "$MAX_TO_RERUN" -gt "$NUMBER_OF_FAILURES" ]; then
74
123
  echo "Re-running $NUMBER_OF_FAILURES failed scenarios!"
75
124
  . ./rerun.sh
76
- else
77
- echo "Skipping re-run, expected < $MAX_TO_RERUN failures to qualify execution for re-run, got $NUMBER_OF_FAILURES failures."
78
- fi
125
+ else
126
+ echo "Skipping re-run, expected < $MAX_TO_RERUN failures."
127
+ echo "Got $NUMBER_OF_FAILURES failures."
128
+ fi
79
129
  else
80
- echo "No [rerun.sh] file exits, skipping re-run!"
130
+ echo "No [rerun.sh] file exists, skipping re-run!"
81
131
  fi
82
132
  ```
83
- ##### Bash Re-run Command
84
- Execute in shell
133
+
134
+ #### Bash Re-run Command
135
+
136
+ Execute in shell:
137
+
85
138
  ```sh
86
139
  . ./attemptRerun.sh
87
140
  ```
88
- ##### Integrate with NPM
89
- Add task in `package.json`
90
- ```sh
141
+
142
+ #### Integrate with NPM
143
+
144
+ Add task in `package.json`:
145
+
146
+ ```json
91
147
  "attempt-rerun": ". ./attemptRerun.sh"
92
- ````
93
- ##### NPM Re-run Command
94
- Execute in shell
148
+ ```
149
+
150
+ #### NPM Re-run Command
151
+
152
+ Execute in shell:
153
+
95
154
  ```sh
96
155
  npm run attempt-rerun
97
156
  ```
@@ -115,6 +174,7 @@ export const config = {
115
174
  ```
116
175
 
117
176
  ### rerunDataDir
177
+
118
178
  Directory where all the re-run JSON data will be kept during execution.
119
179
 
120
180
  Type: `String`
@@ -122,6 +182,7 @@ Type: `String`
122
182
  Default: `./results/rerun`
123
183
 
124
184
  Example:
185
+
125
186
  ```js
126
187
  import RerunService from 'wdio-rerun-service';
127
188
  export const config = {
@@ -136,13 +197,15 @@ export const config = {
136
197
  ```
137
198
 
138
199
  ### rerunScriptPath
139
- Path to write re-run Bash script.
200
+
201
+ Path to write the re-run script.
140
202
 
141
203
  Type: `String`
142
204
 
143
- Default: `./rerun.sh`
205
+ Default: `./rerun.sh` (Unix) or `./rerun.bat` (Windows)
144
206
 
145
207
  Example:
208
+
146
209
  ```js
147
210
  import RerunService from 'wdio-rerun-service';
148
211
  export const config = {
@@ -157,6 +220,7 @@ export const config = {
157
220
  ```
158
221
 
159
222
  ### ignoredTags
223
+
160
224
  (Cucumber-only) Set of Cucumber tags to exclude. If scenario contains a tag, the re-run service will skip analysis.
161
225
 
162
226
  Type: `Array`
@@ -164,6 +228,7 @@ Type: `Array`
164
228
  Default: `[]`
165
229
 
166
230
  Example:
231
+
167
232
  ```js
168
233
  import RerunService from 'wdio-rerun-service';
169
234
  export const config = {
@@ -178,6 +243,7 @@ export const config = {
178
243
  ```
179
244
 
180
245
  ### commandPrefix
246
+
181
247
  Prefix which will be added to the re-run command that is generated.
182
248
 
183
249
  Type: `String`
@@ -185,6 +251,7 @@ Type: `String`
185
251
  Default: `''`
186
252
 
187
253
  Example:
254
+
188
255
  ```js
189
256
  import RerunService from 'wdio-rerun-service';
190
257
  export const config = {
@@ -199,6 +266,7 @@ export const config = {
199
266
  ```
200
267
 
201
268
  ### customParameters
269
+
202
270
  Parameters which will be added to the re-run command that is generated.
203
271
  Can be used with `commandPrefix`.
204
272
 
@@ -207,6 +275,7 @@ Type: `String`
207
275
  Default: `''`
208
276
 
209
277
  Example:
278
+
210
279
  ```js
211
280
  import RerunService from 'wdio-rerun-service';
212
281
  export const config = {
@@ -219,5 +288,22 @@ export const config = {
219
288
  // ...
220
289
  }
221
290
  ```
222
- ----
223
291
 
292
+ ## Contributing
293
+
294
+ Contributions are welcome! Please feel free to submit a Pull Request.
295
+
296
+ ```bash
297
+ # Clone the repo
298
+ git clone https://github.com/webdriverio-community/wdio-rerun-service.git
299
+
300
+ # Install dependencies
301
+ pnpm install
302
+
303
+ # Run tests
304
+ pnpm test
305
+ ```
306
+
307
+ ## License
308
+
309
+ MIT
@@ -1,4 +1,5 @@
1
- import type { Capabilities, Frameworks, Services } from '@wdio/types';
1
+ import type { Logger } from '@wdio/logger';
2
+ import type { Frameworks, Services } from '@wdio/types';
2
3
  type AfterScenario = NonNullable<WebdriverIO.HookFunctionExtension['afterScenario']>;
3
4
  type AfterScenarioParameters = Parameters<AfterScenario>;
4
5
  type World = AfterScenarioParameters[0];
@@ -12,6 +13,7 @@ interface RerunServiceOptions {
12
13
  rerunScriptPath?: string;
13
14
  commandPrefix?: string;
14
15
  customParameters?: string;
16
+ platformName?: NodeJS.Platform;
15
17
  }
16
18
  export default class RerunService implements Services.ServiceInstance {
17
19
  nonPassingItems: NonPassingItem[];
@@ -23,8 +25,10 @@ export default class RerunService implements Services.ServiceInstance {
23
25
  customParameters: string;
24
26
  specFile: string;
25
27
  disabled: boolean;
28
+ platformName: NodeJS.Platform;
29
+ log: Logger;
26
30
  constructor(options?: RerunServiceOptions);
27
- before(_capabilities: Capabilities.RemoteCapability, specs: string[]): Promise<void>;
31
+ before(_capabilities: WebdriverIO.Capabilities, specs: string[]): Promise<void>;
28
32
  afterTest(_test: Frameworks.Test, _context: any, results: Frameworks.TestResult): void;
29
33
  afterScenario(world: World): void;
30
34
  after(): Promise<void>;
@@ -1,35 +1,34 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const minimist_1 = __importDefault(require("minimist"));
7
- const promises_1 = require("node:fs/promises");
8
- const node_path_1 = require("node:path");
9
- const node_process_1 = require("node:process");
10
- const uuid_1 = require("uuid");
11
- class RerunService {
1
+ import logger from '@wdio/logger';
2
+ import { randomUUID } from 'node:crypto';
3
+ import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
4
+ import { join } from 'node:path';
5
+ import { argv, env, platform } from 'node:process';
6
+ import { parseArgs } from 'node:util';
7
+ export default class RerunService {
12
8
  constructor(options = {}) {
13
- const { ignoredTags, rerunDataDir, rerunScriptPath, commandPrefix, customParameters, } = options;
9
+ const { ignoredTags, rerunDataDir, rerunScriptPath, commandPrefix, customParameters, platformName, } = options;
14
10
  this.nonPassingItems = [];
15
11
  this.serviceWorkerId = '';
16
12
  this.ignoredTags = ignoredTags ?? [];
17
13
  this.rerunDataDir = rerunDataDir ?? './results/rerun';
14
+ this.platformName = platformName ?? platform;
18
15
  this.rerunScriptPath =
19
- rerunScriptPath ?? (node_process_1.platform === 'win32' ? 'rerun.bat' : 'rerun.sh');
16
+ rerunScriptPath ??
17
+ (this.platformName === 'win32' ? 'rerun.bat' : 'rerun.sh');
20
18
  this.commandPrefix = commandPrefix ?? '';
21
19
  this.customParameters = customParameters ?? '';
22
20
  this.specFile = '';
23
- this.disabled = node_process_1.env['DISABLE_RERUN'] === 'true';
21
+ this.disabled = env['DISABLE_RERUN'] === 'true';
22
+ this.log = logger('@wdio/wdio-rerun-service');
24
23
  }
25
24
  async before(_capabilities, specs) {
26
25
  if (this.disabled) {
27
26
  return;
28
27
  }
29
28
  this.specFile = specs[0] ?? '';
30
- // console.log(`Re-run service is activated. Data directory: ${this.rerunDataDir}`);
31
- await (0, promises_1.mkdir)(this.rerunDataDir, { recursive: true });
32
- this.serviceWorkerId = (0, uuid_1.v4)();
29
+ this.log.debug(`๐Ÿ”„ Re-run service activated. Data directory: ${this.rerunDataDir}`);
30
+ await mkdir(this.rerunDataDir, { recursive: true });
31
+ this.serviceWorkerId = randomUUID();
33
32
  }
34
33
  afterTest(_test, _context, results) {
35
34
  if (this.disabled) {
@@ -40,8 +39,8 @@ class RerunService {
40
39
  if (passed || config.framework === 'cucumber') {
41
40
  return;
42
41
  }
43
- // console.log(`Re-run service is inspecting non-passing test.`);
44
- // console.log(`Test location: ${this.specFile}`);
42
+ this.log.debug(`๐Ÿ” Inspecting non-passing test.`);
43
+ this.log.debug(`๐Ÿ“ Test location: ${this.specFile}`);
45
44
  const error = results.error;
46
45
  if (error?.message) {
47
46
  this.nonPassingItems.push({
@@ -50,7 +49,7 @@ class RerunService {
50
49
  });
51
50
  }
52
51
  else {
53
- // console.log("The non-passing test did not contain any error message, it could not be added for re-run.")
52
+ this.log.debug('โš ๏ธ Non-passing test did not contain an error message, skipping.');
54
53
  }
55
54
  }
56
55
  // Executed after a Cucumber scenario ends.
@@ -65,14 +64,34 @@ class RerunService {
65
64
  status === 'SKIPPED') {
66
65
  return;
67
66
  }
68
- const scenario = world.gherkinDocument.feature?.children.filter((child) => child.scenario
69
- ? world.pickle.astNodeIds.includes(child.scenario.id.toString())
70
- : false)?.[0]?.scenario;
67
+ const { gherkinDocument, pickle } = world;
68
+ const featureChildren = gherkinDocument.feature?.children ?? [];
69
+ // Locate the matching scenario by searching feature children
70
+ // Scenarios can be at top-level OR nested within Rule blocks
71
+ const findMatchingScenario = () => {
72
+ for (const featureChild of featureChildren) {
73
+ // Direct scenario under feature
74
+ if (featureChild.scenario) {
75
+ if (pickle.astNodeIds.includes(featureChild.scenario.id)) {
76
+ return featureChild.scenario;
77
+ }
78
+ }
79
+ // Scenario nested inside a Rule block
80
+ if (featureChild.rule?.children) {
81
+ const ruleScenario = featureChild.rule.children.find((ruleChild) => ruleChild.scenario &&
82
+ pickle.astNodeIds.includes(ruleChild.scenario.id))?.scenario;
83
+ if (ruleScenario)
84
+ return ruleScenario;
85
+ }
86
+ }
87
+ return undefined;
88
+ };
89
+ const scenario = findMatchingScenario();
71
90
  let scenarioLineNumber = scenario?.location.line ?? 0;
72
91
  if (scenario && scenario.examples.length > 0) {
73
92
  let exampleLineNumber = 0;
74
93
  scenario.examples.find((example) => example.tableBody.find((row) => {
75
- if (row.id === world.pickle.astNodeIds[1]) {
94
+ if (row.id === pickle.astNodeIds[1]) {
76
95
  exampleLineNumber = row.location.line;
77
96
  return true;
78
97
  }
@@ -80,8 +99,8 @@ class RerunService {
80
99
  }));
81
100
  scenarioLineNumber = exampleLineNumber;
82
101
  }
83
- const scenarioLocation = `${world.pickle.uri}:${scenarioLineNumber}`;
84
- const tagsList = world.pickle.tags.map((tag) => tag.name);
102
+ const scenarioLocation = `${pickle.uri}:${scenarioLineNumber}`;
103
+ const tagsList = pickle.tags.map((tag) => tag.name);
85
104
  if (!Array.isArray(this.ignoredTags) ||
86
105
  !tagsList.some((ignoredTag) => this.ignoredTags.includes(ignoredTag))) {
87
106
  this.nonPassingItems.push({
@@ -95,30 +114,35 @@ class RerunService {
95
114
  return;
96
115
  }
97
116
  if (this.nonPassingItems.length === 0) {
98
- return; // console.log('Re-run service did not detect any non-passing scenarios or tests.');
117
+ this.log.debug('โœ… No non-passing scenarios or tests detected.');
118
+ return;
99
119
  }
100
- await (0, promises_1.writeFile)((0, node_path_1.join)(this.rerunDataDir, `rerun-${this.serviceWorkerId}.json`), JSON.stringify(this.nonPassingItems));
120
+ await writeFile(join(this.rerunDataDir, `rerun-${this.serviceWorkerId}.json`), JSON.stringify(this.nonPassingItems));
101
121
  }
102
122
  async onComplete() {
103
123
  if (this.disabled) {
104
124
  return;
105
125
  }
106
126
  try {
107
- const files = await (0, promises_1.readdir)(this.rerunDataDir);
127
+ const files = await readdir(this.rerunDataDir);
108
128
  const rerunFiles = files.filter((file) => file.endsWith('.json'));
109
129
  if (rerunFiles.length === 0) {
110
130
  return;
111
131
  }
112
- const parsedArgs = (0, minimist_1.default)(node_process_1.argv.slice(2));
113
- const args = parsedArgs._[0] ? parsedArgs._[0] + ' ' : '';
132
+ const { positionals } = parseArgs({
133
+ args: argv.slice(2),
134
+ allowPositionals: true,
135
+ strict: false,
136
+ });
137
+ const args = positionals[0] ? positionals[0] + ' ' : '';
114
138
  const prefix = this.commandPrefix ? this.commandPrefix + ' ' : '';
115
- const disableRerun = node_process_1.platform === 'win32'
139
+ const disableRerun = this.platformName === 'win32'
116
140
  ? 'set DISABLE_RERUN=true &&'
117
141
  : 'DISABLE_RERUN=true';
118
142
  let rerunCommand = `${prefix}${disableRerun} npx wdio ${args}${this.customParameters}`;
119
143
  const failureLocations = new Set();
120
144
  for (const file of rerunFiles) {
121
- const json = JSON.parse(await (0, promises_1.readFile)((0, node_path_1.join)(this.rerunDataDir, file), 'utf8'));
145
+ const json = JSON.parse(await readFile(join(this.rerunDataDir, file), 'utf8'));
122
146
  json.forEach((failure) => {
123
147
  failureLocations.add(failure.location.replace(/\\/g, '/'));
124
148
  });
@@ -126,13 +150,12 @@ class RerunService {
126
150
  failureLocations.forEach((failureLocation) => {
127
151
  rerunCommand += ` --spec=${failureLocation}`;
128
152
  });
129
- await (0, promises_1.writeFile)(this.rerunScriptPath, rerunCommand, { mode: 0o755 });
130
- // console.log(`Re-run script has been generated @ ${this.rerunScriptPath}`);
153
+ await writeFile(this.rerunScriptPath, rerunCommand, { mode: 0o755 });
154
+ this.log.debug(`๐Ÿ“ Re-run script generated: ${this.rerunScriptPath}`);
131
155
  }
132
156
  catch (err) {
133
- // console.log(`Re-run service failed to generate re-run script: ${err}`);
157
+ this.log.debug(`โŒ Failed to generate re-run script: ${JSON.stringify(err)}`);
134
158
  }
135
159
  }
136
160
  }
137
- exports.default = RerunService;
138
161
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AACA,wDAA+B;AAC/B,+CAAsE;AACtE,yCAAgC;AAChC,+CAAkD;AAClD,+BAAmC;AAqBnC,MAAqB,YAAY;IAW7B,YAAY,UAA+B,EAAE;QACzC,MAAM,EACF,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,GACnB,GAAG,OAAO,CAAA;QACX,IAAI,CAAC,eAAe,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,iBAAiB,CAAA;QACrD,IAAI,CAAC,eAAe;YAChB,eAAe,IAAI,CAAC,uBAAQ,KAAK,OAAO,CA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,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAC/D,CAAA;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -1,4 +1,5 @@
1
- import type { Capabilities, Frameworks, Services } from '@wdio/types';
1
+ import type { Logger } from '@wdio/logger';
2
+ import type { Frameworks, Services } from '@wdio/types';
2
3
  type AfterScenario = NonNullable<WebdriverIO.HookFunctionExtension['afterScenario']>;
3
4
  type AfterScenarioParameters = Parameters<AfterScenario>;
4
5
  type World = AfterScenarioParameters[0];
@@ -12,6 +13,7 @@ interface RerunServiceOptions {
12
13
  rerunScriptPath?: string;
13
14
  commandPrefix?: string;
14
15
  customParameters?: string;
16
+ platformName?: NodeJS.Platform;
15
17
  }
16
18
  export default class RerunService implements Services.ServiceInstance {
17
19
  nonPassingItems: NonPassingItem[];
@@ -23,8 +25,10 @@ export default class RerunService implements Services.ServiceInstance {
23
25
  customParameters: string;
24
26
  specFile: string;
25
27
  disabled: boolean;
28
+ platformName: NodeJS.Platform;
29
+ log: Logger;
26
30
  constructor(options?: RerunServiceOptions);
27
- before(_capabilities: Capabilities.RemoteCapability, specs: string[]): Promise<void>;
31
+ before(_capabilities: WebdriverIO.Capabilities, specs: string[]): Promise<void>;
28
32
  afterTest(_test: Frameworks.Test, _context: any, results: Frameworks.TestResult): void;
29
33
  afterScenario(world: World): void;
30
34
  after(): Promise<void>;