@wdio/runner 8.40.0 → 8.40.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAgB,KAAK,OAAO,EAAgC,MAAM,aAAa,CAAA;AAGzG,OAAO,KAAK,YAAY,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,YAAY,CAAA;AAOtE,KAAK,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAQ9G,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,cAAc,EAAE,cAAc,EAAE,CAAA;QAChC,cAAc,EAAE,GAAG,EAAE,CAAA;QACrB,gBAAgB,EAAE,MAAM,CAAA;QACxB,YAAY,CAAC,EAAE,OAAO,CAAA;KACzB;CACJ;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;;IAKpE,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;gBAJT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,CAAC,UAAU,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EACpD,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,YAAY,CAAC,gBAAgB,EAC5C,SAAS,EAAE,YAAY;IASnC;;OAEG;IACH,QAAQ;IAIR,IAAI,IAC2B,aAAa;IAGtC,GAAG;IAgXT,MAAM,CAAC,IAAI,CAAE,GAAG,EAA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,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,gBAAgB,EAAE,QAAQ,EAAE,YAAY;CAItH"}
package/build/browser.js CHANGED
@@ -16,6 +16,7 @@ export default class BrowserFramework {
16
16
  _specs;
17
17
  _capabilities;
18
18
  _reporter;
19
+ #retryOutdatedOptimizeDep = false;
19
20
  #runnerOptions; // `any` here because we don't want to create a dependency to @wdio/browser-runner
20
21
  #resolveTestStatePromise;
21
22
  constructor(_cid, _config, _specs, _capabilities, _reporter) {
@@ -67,6 +68,7 @@ export default class BrowserFramework {
67
68
  return failures;
68
69
  }
69
70
  async #runSpec(spec, retried = false) {
71
+ this.#retryOutdatedOptimizeDep = false;
70
72
  const timeout = this._config.mochaOpts?.timeout || DEFAULT_TIMEOUT;
71
73
  log.info(`Run spec file ${spec} for cid ${this._cid}`);
72
74
  /**
@@ -348,6 +350,36 @@ export default class BrowserFramework {
348
350
  ...testError
349
351
  });
350
352
  }
353
+ /**
354
+ * check for outdated optimize dep errors that occasionally happen in Vite
355
+ */
356
+ const logs = typeof browser.getLogs === 'function'
357
+ ? (await browser.getLogs('browser').catch(() => []))
358
+ : [];
359
+ const severeLogs = logs.filter((log) => log.level === 'SEVERE');
360
+ if (severeLogs.length) {
361
+ if (!this.#retryOutdatedOptimizeDep && severeLogs.some((log) => log.message?.includes('(Outdated Optimize Dep)'))) {
362
+ log.info('Retry test run due to outdated optimize dep');
363
+ this.#retryOutdatedOptimizeDep = true;
364
+ return browser.refresh();
365
+ }
366
+ this.#resolveTestStatePromise?.({
367
+ events: [],
368
+ failures: 1,
369
+ hasViteError: false,
370
+ /**
371
+ * error messages often look like:
372
+ * "http://localhost:40167/node_modules/.vite/deps/expect.js?v=bca8e2f3 - Failed to load resource: the server responded with a status of 504 (Outdated Optimize Dep)"
373
+ */
374
+ errors: severeLogs.map((log) => {
375
+ const [filename, message] = log.message.split(' - ');
376
+ return {
377
+ filename: filename.startsWith('http') ? filename : undefined,
378
+ message
379
+ };
380
+ })
381
+ });
382
+ }
351
383
  }
352
384
  static init(cid, config, specs, caps, reporter) {
353
385
  const framework = new BrowserFramework(cid, config, specs, caps, reporter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/runner",
3
- "version": "8.40.0",
3
+ "version": "8.40.2",
4
4
  "description": "A WebdriverIO service that runs tests in arbitrary environments",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-runner",
@@ -30,19 +30,19 @@
30
30
  "typeScriptVersion": "3.8.3",
31
31
  "dependencies": {
32
32
  "@types/node": "^20.11.28",
33
- "@wdio/config": "8.40.0",
34
- "@wdio/globals": "8.40.0",
33
+ "@wdio/config": "8.40.2",
34
+ "@wdio/globals": "8.40.2",
35
35
  "@wdio/logger": "8.38.0",
36
36
  "@wdio/types": "8.39.0",
37
- "@wdio/utils": "8.40.0",
37
+ "@wdio/utils": "8.40.2",
38
38
  "deepmerge-ts": "^5.1.0",
39
39
  "expect-webdriverio": "^4.12.0",
40
40
  "gaze": "^1.1.3",
41
- "webdriver": "8.40.0",
42
- "webdriverio": "8.40.0"
41
+ "webdriver": "8.40.2",
42
+ "webdriverio": "8.40.2"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "9c3681f32fd96f81c9f1e07790edd76e6b40609a"
47
+ "gitHead": "4cade71f6be0b8c53c48918b9a6da37a6ad21835"
48
48
  }