@wdio/browserstack-service 9.39.1 → 9.39.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.
- package/build/cleanup.js +125 -82
- package/build/cli/apiUtils.d.ts +7 -1
- package/build/cli/frameworks/constants/testFrameworkConstants.d.ts +1 -0
- package/build/cli/modules/uploadAttachmentModule.d.ts +58 -0
- package/build/constants.d.ts +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.js +488 -180
- package/build/types.d.ts +5 -0
- package/package.json +2 -2
package/build/cli/apiUtils.d.ts
CHANGED
|
@@ -9,5 +9,11 @@ export default class APIUtils {
|
|
|
9
9
|
static DATA_ENDPOINT: string;
|
|
10
10
|
static UPLOAD_LOGS_ADDRESS: string;
|
|
11
11
|
static EDS_URL: string;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Overlay the binary-supplied GRR endpoints onto the public defaults. Every field is
|
|
14
|
+
* optional: a degenerate StartBinSession/ConnectBinSession config (auth failure, empty
|
|
15
|
+
* payload) used to throw here and abort the whole CLI bootstrap, taking every product
|
|
16
|
+
* module with it. Missing entries now just leave the corresponding default in place.
|
|
17
|
+
*/
|
|
18
|
+
static updateURLSForGRR(apis?: GRRUrls): void;
|
|
13
19
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import BaseModule from './baseModule.js';
|
|
2
|
+
import { BStackLogger } from '../cliLogger.js';
|
|
3
|
+
/**
|
|
4
|
+
* UploadAttachmentModule — CLI/gRPC path registration for `browser.uploadAttachment`
|
|
5
|
+
* (aliased as `browser.uploadMedia`).
|
|
6
|
+
*
|
|
7
|
+
* Mirrors CustomTagsModule: registers the browser method in onBeforeExecute()
|
|
8
|
+
* (observer-bound to AutomationFrameworkState.CREATE / HookState.POST), instantiated
|
|
9
|
+
* from BrowserstackCLI.loadModules() whenever the binary is up.
|
|
10
|
+
*
|
|
11
|
+
* The binary streams the file from `filePath` only when it drains its upload queue, so the
|
|
12
|
+
* file is snapshotted first: a caller that overwrites or deletes its file right after the call
|
|
13
|
+
* would otherwise attach the wrong content or nothing. Snapshots go to
|
|
14
|
+
* `UploadedAttachments-wdio-<bin session id>/<worker pid>/<level>/` under the writable dir:
|
|
15
|
+
* per worker, so parallel workers never pick the same name, and per wdio run, so the Python
|
|
16
|
+
* and Java SDKs (`UploadedAttachments-<n>/`) and other runs on the host never read or delete
|
|
17
|
+
* them. The launcher removes this run's folder in onComplete. `level` is what the binary
|
|
18
|
+
* switches on to pick test_run_uuid / hook_run_uuid / build_run_uuid.
|
|
19
|
+
*/
|
|
20
|
+
export default class UploadAttachmentModule extends BaseModule {
|
|
21
|
+
logger: typeof BStackLogger;
|
|
22
|
+
name: string;
|
|
23
|
+
static MODULE_NAME: string;
|
|
24
|
+
private pendingSends;
|
|
25
|
+
constructor();
|
|
26
|
+
getModuleName(): string;
|
|
27
|
+
onBeforeExecute(): Promise<void>;
|
|
28
|
+
private recordAttachment;
|
|
29
|
+
private static platformIndex;
|
|
30
|
+
private static runAttachmentsDir;
|
|
31
|
+
private static snapshot;
|
|
32
|
+
/**
|
|
33
|
+
* Keeps uploadAttachment/uploadMedia callable when Test Reporting is inactive (no testhub,
|
|
34
|
+
* classic path, CLI down), as the other SDKs do. onBeforeExecute replaces it when the
|
|
35
|
+
* binary is up, and an already-registered implementation is left alone.
|
|
36
|
+
*/
|
|
37
|
+
static installNoopFallback(browser?: WebdriverIO.Browser): void;
|
|
38
|
+
static cleanupUploadedAttachments(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Pick the attachment level and the uuid it hangs off. A build-level attachment still
|
|
41
|
+
* needs a uuid on the wire — the binary drops log entries without one before it ever
|
|
42
|
+
* reads `level` — so it reuses whichever test/hook uuid is current and the binary
|
|
43
|
+
* substitutes the build id downstream.
|
|
44
|
+
*/
|
|
45
|
+
private resolveTarget;
|
|
46
|
+
/**
|
|
47
|
+
* Dispatch and return — deliberately NOT awaited by the caller.
|
|
48
|
+
*
|
|
49
|
+
* uploadAttachment is called from the customer's test body, and the very next statement
|
|
50
|
+
* is usually a browser command that the accessibility module wraps with a pre-command
|
|
51
|
+
* scan. Awaiting a binary round-trip on that stack was observed to stall the following
|
|
52
|
+
* `executeAsync` scan under load (chrome sessions reaped at the framework timeout), so
|
|
53
|
+
* the event is written and its ack observed off the caller's stack. The ack carries no
|
|
54
|
+
* information the caller can act on: the binary streams the file from `filePath` while
|
|
55
|
+
* draining its own upload queue.
|
|
56
|
+
*/
|
|
57
|
+
private sendAttachmentEvent;
|
|
58
|
+
}
|
package/build/constants.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export declare const STOP_BUILD_MAX_ATTEMPTS = 4;
|
|
|
107
107
|
export declare const STOP_BUILD_ATTEMPT_TIMEOUT_MS = 10000;
|
|
108
108
|
export declare const STOP_BUILD_TOTAL_BUDGET_MS = 30000;
|
|
109
109
|
export declare const STOP_BUILD_BACKOFF_BASE_MS = 1000;
|
|
110
|
+
export declare const UPLOAD_ATTACHMENT_ACK_TIMEOUT_MS = 10000;
|
|
110
111
|
export declare const UPDATED_CLI_ENDPOINT = "sdk/v1/update_cli";
|
|
111
112
|
/**
|
|
112
113
|
* Module Hook Events - Performance event names for module lifecycle tracking
|
package/build/index.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ declare global {
|
|
|
28
28
|
startA11yScanning: () => Promise<void>;
|
|
29
29
|
stopA11yScanning: () => Promise<void>;
|
|
30
30
|
setCustomTags: (key: string, value: string) => Promise<void>;
|
|
31
|
+
uploadAttachment: (filePath: string, options?: {
|
|
32
|
+
buildAttachment?: boolean;
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
uploadMedia: (filePath: string, options?: {
|
|
35
|
+
buildAttachment?: boolean;
|
|
36
|
+
}) => Promise<void>;
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
interface State {
|