@applitools/driver 1.11.23 → 1.11.24

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.
@@ -15,6 +15,7 @@ function parseCapabilities(capabilities) {
15
15
  isW3C: isW3C(capabilities),
16
16
  isMobile: isMobile(capabilities),
17
17
  isChrome: isChrome(capabilities),
18
+ isExecutionGridClient: Boolean(capabilities.applitools),
18
19
  };
19
20
  if (info.isMobile) {
20
21
  info.deviceName = ((_h = (_g = capabilities.desired) === null || _g === void 0 ? void 0 : _g.deviceName) !== null && _h !== void 0 ? _h : capabilities.deviceName) || undefined;
package/dist/driver.js CHANGED
@@ -159,6 +159,20 @@ class Driver {
159
159
  get isEdgeLegacy() {
160
160
  return /edge/i.test(this.browserName) && Number(this.browserVersion) <= 44;
161
161
  }
162
+ get sessionId() {
163
+ var _a;
164
+ return (_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.sessionId;
165
+ }
166
+ get isExecutionGridClient() {
167
+ var _a;
168
+ return !!((_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.isExecutionGridClient);
169
+ }
170
+ get isExecutionGrid() {
171
+ var _a, _b;
172
+ if (this.isExecutionGridClient)
173
+ return true;
174
+ return /exec-wus.applitools.com/.test((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.extractHostName) === null || _b === void 0 ? void 0 : _b.call(_a, this.target));
175
+ }
162
176
  updateCurrentContext(context) {
163
177
  this._currentContext = context;
164
178
  }
@@ -395,6 +409,11 @@ class Driver {
395
409
  return result;
396
410
  }
397
411
  // end world
412
+ async getSessionMetadata() {
413
+ var _a;
414
+ if (this.isExecutionGridClient)
415
+ return await ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.getSessionMetadata(this.target));
416
+ }
398
417
  async refreshContexts() {
399
418
  if (this.isNative)
400
419
  return this.currentContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.11.23",
3
+ "version": "1.11.24",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -87,9 +87,9 @@
87
87
  }
88
88
  },
89
89
  "dependencies": {
90
- "@applitools/logger": "1.1.38",
90
+ "@applitools/logger": "1.1.39",
91
91
  "@applitools/snippets": "2.4.13",
92
- "@applitools/utils": "1.3.24",
92
+ "@applitools/utils": "1.3.25",
93
93
  "semver": "7.3.7"
94
94
  },
95
95
  "devDependencies": {
package/types/driver.d.ts CHANGED
@@ -60,6 +60,9 @@ export declare class Driver<TDriver, TContext, TElement, TSelector> {
60
60
  get isChromium(): boolean;
61
61
  get isIE(): boolean;
62
62
  get isEdgeLegacy(): boolean;
63
+ get sessionId(): string;
64
+ get isExecutionGridClient(): boolean;
65
+ get isExecutionGrid(): boolean;
63
66
  updateCurrentContext(context: Context<TDriver, TContext, TElement, TSelector>): void;
64
67
  init(): Promise<this>;
65
68
  switchWorld(options?: {
@@ -75,6 +78,7 @@ export declare class Driver<TDriver, TContext, TElement, TSelector> {
75
78
  isNative: boolean;
76
79
  isWebView: boolean;
77
80
  }>;
81
+ getSessionMetadata(): Promise<any>;
78
82
  refreshContexts(): Promise<Context<TDriver, TContext, TElement, TSelector>>;
79
83
  switchTo(context: Context<TDriver, TContext, TElement, TSelector>): Promise<Context<TDriver, TContext, TElement, TSelector>>;
80
84
  switchToMainContext(): Promise<Context<TDriver, TContext, TElement, TSelector>>;
@@ -35,6 +35,7 @@ export declare type DriverInfo = {
35
35
  allCookies?: boolean;
36
36
  canExecuteOnlyFunctionScripts?: boolean;
37
37
  };
38
+ isExecutionGridClient?: boolean;
38
39
  };
39
40
  export declare type WaitOptions = {
40
41
  state?: 'exist' | 'visible';
@@ -100,4 +101,5 @@ export interface SpecDriver<TDriver, TContext, TElement, TSelector> {
100
101
  getCurrentWorld?(driver: TDriver): Promise<string>;
101
102
  getWorlds?(driver: TDriver): Promise<string[]>;
102
103
  switchWorld?(driver: TDriver, id: string): Promise<void>;
104
+ getSessionMetadata?(driver: TDriver): Promise<any>;
103
105
  }