@applitools/driver 1.11.41 → 1.11.43

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/dist/driver.js CHANGED
@@ -429,9 +429,8 @@ class Driver {
429
429
  }
430
430
  }
431
431
  async getSessionMetadata() {
432
- var _a, _b;
433
432
  try {
434
- const metadata = await ((_b = (_a = this._spec).getSessionMetadata) === null || _b === void 0 ? void 0 : _b.call(_a, this.target));
433
+ const metadata = await this.currentContext.execute('applitools:metadata');
435
434
  this._logger.log('Extracted session metadata', metadata);
436
435
  return metadata;
437
436
  }
@@ -536,7 +535,7 @@ class Driver {
536
535
  }
537
536
  async switchToMainContext() {
538
537
  const environment = await this.getEnvironment();
539
- if (environment.isNative)
538
+ if (!environment.isWeb)
540
539
  throw new Error('Contexts are supported only for web drivers');
541
540
  this._logger.log('Switching to the main context');
542
541
  await this._spec.mainContext(this.currentContext.target);
@@ -544,7 +543,7 @@ class Driver {
544
543
  }
545
544
  async switchToParentContext(elevation = 1) {
546
545
  const environment = await this.getEnvironment();
547
- if (environment.isNative)
546
+ if (!environment.isWeb)
548
547
  throw new Error('Contexts are supported only for web drivers');
549
548
  this._logger.log('Switching to a parent context with elevation:', elevation);
550
549
  if (this.currentContext.path.length <= elevation) {
@@ -569,7 +568,7 @@ class Driver {
569
568
  }
570
569
  async switchToChildContext(...references) {
571
570
  const environment = await this.getEnvironment();
572
- if (environment.isNative)
571
+ if (!environment.isWeb)
573
572
  throw new Error('Contexts are supported only for web drivers');
574
573
  this._logger.log('Switching to a child context with depth:', references.length);
575
574
  for (const reference of references) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.11.41",
3
+ "version": "1.11.43",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -67,7 +67,6 @@ export interface SpecDriver<T extends SpecType> {
67
67
  getCurrentWorld?(driver: T['driver']): Promise<string>;
68
68
  getWorlds?(driver: T['driver']): Promise<string[]>;
69
69
  switchWorld?(driver: T['driver'], id: string): Promise<void>;
70
- getSessionMetadata?(driver: T['driver']): Promise<any>;
71
70
  }
72
71
  export type WaitOptions = {
73
72
  state?: 'exist' | 'visible';