@wdio/browserstack-service 9.34.0 → 9.35.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.
@@ -43,6 +43,13 @@ export default class BrowserstackService implements Services.ServiceInstance {
43
43
  private _percyCaptureMode;
44
44
  private _percyHandler?;
45
45
  private _turboScale;
46
+ /**
47
+ * Only mocha's own bail drops the rest of a spec. wdio's top-level `bail` is a launcher
48
+ * spec-scheduling filter (it stops queueing further specs once N runners have failed) and
49
+ * never reaches mocha, so under it every test in the current spec still runs — enumerating
50
+ * on it would report tests as skipped that are about to execute.
51
+ */
52
+ private _mochaBail;
46
53
  constructor(options: BrowserstackConfig & Options.Testrunner, _caps: Capabilities.ResolvedTestrunnerCapabilities, _config: Options.Testrunner);
47
54
  _updateCaps(fn: (caps: WebdriverIO.Capabilities) => void): void;
48
55
  beforeSession(config: Omit<Options.Testrunner, 'capabilities'>, capabilities: WebdriverIO.Capabilities): Promise<void>;
@@ -59,6 +66,28 @@ export default class BrowserstackService implements Services.ServiceInstance {
59
66
  afterHook(test: Frameworks.Test | CucumberHook, context: unknown, result: Frameworks.TestResult): Promise<void>;
60
67
  beforeTest(test: Frameworks.Test): Promise<void>;
61
68
  afterTest(originalTest: Frameworks.Test, context: never, results: Frameworks.TestResult): Promise<void>;
69
+ /**
70
+ * Whether this failure will be retried, in which case mocha has not dropped anything yet and
71
+ * the tests after it are still going to run.
72
+ *
73
+ * `results.retries` only tracks wdio's spec-file retries — `@wdio/utils` builds it as
74
+ * `{ attempts: 0, limit: repeatTest }` and `@wdio/mocha-framework` never feeds `mochaOpts.retries`
75
+ * into it, so under mocha-level retries it stays `{0, 0}` and tells us nothing. Read mocha's own
76
+ * runnable state for that case, otherwise the cascade fires on the first attempt and reports
77
+ * tests as skipped that the retry then actually runs.
78
+ */
79
+ private hasRetryPending;
80
+ /**
81
+ * mocha's `bail` aborts the run on the first failure, so every test the spec had not reached
82
+ * yet is dropped without emitting any event and never appears on the dashboard. Report them
83
+ * as skipped — same cascade the failed-hook path uses, from the spec's root suite so sibling
84
+ * describes are covered too (bail kills the whole spec, not just the failing describe).
85
+ *
86
+ * The root can span more than one file when specs are grouped — `MochaAdapter` adds every spec
87
+ * it is handed to one mocha instance. Cascading across them is still correct: bail aborts that
88
+ * whole runner, so those tests do not run either.
89
+ */
90
+ private reportBailSkippedTests;
62
91
  after(result: number): Promise<void>;
63
92
  /**
64
93
  * For CucumberJS
@@ -75,6 +104,7 @@ export default class BrowserstackService implements Services.ServiceInstance {
75
104
  onReload(oldSessionId: string, newSessionId: string): Promise<void>;
76
105
  _isAppAutomate(): boolean;
77
106
  _updateJob(requestBody: unknown): Promise<unknown>;
107
+ _routeBidiExecutorToHttp(browser: WebdriverIO.Browser): void;
78
108
  _multiRemoteAction(action: MultiRemoteAction): Promise<unknown>;
79
109
  _update(sessionId: string, requestBody: unknown): Promise<void> | Promise<Response>;
80
110
  _printSessionURL(): Promise<void>;
package/build/util.d.ts CHANGED
@@ -272,6 +272,13 @@ export declare function createDir(dir: string): void;
272
272
  export declare function isWritable(dirPath: string): boolean;
273
273
  export declare function setReadWriteAccess(dirPath: string): void;
274
274
  export declare function getMochaTestHierarchy(test: Frameworks.Test): string[];
275
+ /**
276
+ * True only for the hub-interpreted `browserstack_executor: {…}` magic string.
277
+ * Anchored to the start (leading whitespace tolerated) and case-sensitive, matching
278
+ * how the hub reads the payload — a plain script merely mentioning the token must not
279
+ * be rerouted off its normal transport.
280
+ */
281
+ export declare const isBrowserstackExecutorScript: (script: unknown) => script is string;
275
282
  export declare const performO11ySync: (browser: WebdriverIO.Browser) => Promise<void>;
276
283
  /**
277
284
  * Checks if the capabilities represent a multiremote configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browserstack-service",
3
- "version": "9.34.0",
3
+ "version": "9.35.0",
4
4
  "description": "WebdriverIO service for better Browserstack integration",
5
5
  "author": "BrowserStack <support@browserstack.com>",
6
6
  "homepage": "https://github.com/browserstack/wdio-browserstack-service",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@browserstack/ai-sdk-node": "1.5.17",
57
57
  "@bufbuild/protobuf": "^2.5.2",
58
- "@grpc/grpc-js": "1.13.3",
58
+ "@grpc/grpc-js": "~1.13.5",
59
59
  "@percy/appium-app": "^2.0.9",
60
60
  "@percy/selenium-webdriver": "^2.2.2",
61
61
  "@types/gitconfiglocal": "^2.0.1",