@applitools/driver 1.19.0 → 1.19.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.19.2](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.19.1...js/driver@1.19.2) (2024-10-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * cache key for offline execution ([#2552](https://github.com/Applitools-Dev/sdk/issues/2552)) ([d0d1138](https://github.com/Applitools-Dev/sdk/commit/d0d11386be0f82c9e59e753bd0dc97aa3b05d93e))
9
+
10
+ ## [1.19.1](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.19.0...js/driver@1.19.1) (2024-09-16)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75))
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * @applitools/snippets bumped to 2.5.0
21
+ #### Features
22
+
23
+ * add playwright fixture ([#2412](https://github.com/Applitools-Dev/sdk/issues/2412)) ([0632e93](https://github.com/Applitools-Dev/sdk/commit/0632e93dd7f53029a8c5f4230d22a05abf5fefd4))
24
+
25
+
26
+ #### Bug Fixes
27
+
28
+ * stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75))
29
+
3
30
  ## [1.19.0](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.18.0...js/driver@1.19.0) (2024-09-10)
4
31
 
5
32
 
package/dist/driver.js CHANGED
@@ -33,6 +33,7 @@ const helper_android_1 = require("./helper-android");
33
33
  const user_agent_1 = require("./user-agent");
34
34
  const capabilities_1 = require("./capabilities");
35
35
  const utils = __importStar(require("@applitools/utils"));
36
+ const util_1 = require("util");
36
37
  const snippets = require('@applitools/snippets');
37
38
  const drivers = new WeakMap();
38
39
  class Driver {
@@ -58,6 +59,17 @@ class Driver {
58
59
  });
59
60
  this._currentContext = this._mainContext;
60
61
  }
62
+ [util_1.inspect.custom]() {
63
+ return {
64
+ driverInfo: this._driverInfo,
65
+ environment: this._environment,
66
+ viewport: this._viewport,
67
+ helper: this._helper,
68
+ state: this._state,
69
+ customConfig: this._customConfig,
70
+ features: this._features,
71
+ };
72
+ }
61
73
  get logger() {
62
74
  return this._logger;
63
75
  }
@@ -142,16 +142,12 @@ class MockDriver {
142
142
  this.mockScript(snippets.blurElement, () => {
143
143
  return null;
144
144
  });
145
- this.mockScript(snippets.addElementIds, ([elements, ids]) => {
146
- const selectors = [];
147
- for (const [index, element] of elements.entries()) {
148
- const elementId = ids[index];
145
+ this.mockScript(snippets.addElementIds, elementsWithIds => {
146
+ return elementsWithIds.map(([elements, id]) => elements.map(element => {
149
147
  element.attributes = element.attributes || [];
150
- element.attributes.push({ name: 'data-applitools-selector', value: elementId });
151
- const selector = `[data-applitools-selector~="${elementId}"]`;
152
- selectors.push([selector]);
153
- }
154
- return selectors;
148
+ element.attributes.push({ name: 'data-applitools-marker', value: id });
149
+ return [`[data-applitools-marker~="${id}"]`]; // no shadow is mocked here
150
+ }));
155
151
  });
156
152
  this.mockScript(snippets.cleanupElementIds, ([elements]) => {
157
153
  for (const el of elements) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@applitools/logger": "2.0.18",
77
- "@applitools/snippets": "2.4.27",
77
+ "@applitools/snippets": "2.5.0",
78
78
  "@applitools/utils": "1.7.4",
79
79
  "semver": "7.6.2"
80
80
  },
package/types/driver.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { Size, Region } from '@applitools/utils';
2
3
  import type { DriverInfo, Capabilities, UserAgent, Environment, Viewport, Features, ScreenOrientation, Cookie } from './types';
3
4
  import { type Selector } from './selector';
@@ -7,6 +8,10 @@ import { type Logger } from '@applitools/logger';
7
8
  import { Context, type ContextReference } from './context';
8
9
  import { HelperIOS } from './helper-ios';
9
10
  import { HelperAndroid } from './helper-android';
11
+ import { inspect } from 'util';
12
+ type DriverState<T extends SpecType> = {
13
+ nmlElement?: Element<T> | null;
14
+ };
10
15
  type DriverOptions<T extends SpecType> = {
11
16
  spec: SpecDriver<T>;
12
17
  driver: T['driver'];
@@ -30,6 +35,17 @@ export declare class Driver<T extends SpecType> {
30
35
  protected readonly _spec: SpecDriver<T>;
31
36
  protected readonly _original: this;
32
37
  constructor(options: DriverOptions<T>);
38
+ [inspect.custom](): {
39
+ driverInfo: DriverInfo | undefined;
40
+ environment: Environment | undefined;
41
+ viewport: Viewport | undefined;
42
+ helper: HelperAndroid<T> | HelperIOS<T> | null | undefined;
43
+ state: DriverState<T>;
44
+ customConfig: {
45
+ useCeilForViewportSize?: boolean | undefined;
46
+ };
47
+ features: Features | undefined;
48
+ };
33
49
  get logger(): Logger;
34
50
  get target(): T['driver'];
35
51
  get guid(): string;