@applitools/driver 1.13.6 → 1.14.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.14.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.13.6...js/driver@1.14.0) (2023-09-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * update testcafe ([#1884](https://github.com/applitools/eyes.sdk.javascript1/issues/1884)) ([104f1b6](https://github.com/applitools/eyes.sdk.javascript1/commit/104f1b6cc0d4f107ba46404383de2fa11fe99dcf))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.6.0
14
+ #### Features
15
+
16
+ * add support for fallback in `req` ([#1899](https://github.com/applitools/eyes.sdk.javascript1/issues/1899)) ([d69c4b5](https://github.com/applitools/eyes.sdk.javascript1/commit/d69c4b5830370c471dfc25b6e2caddca8b458df9))
17
+ * @applitools/logger bumped to 2.0.10
18
+
19
+
3
20
  ## [1.13.6](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.13.5...js/driver@1.13.6) (2023-08-30)
4
21
 
5
22
 
package/dist/context.js CHANGED
@@ -133,15 +133,16 @@ class Context {
133
133
  elements = [element];
134
134
  }
135
135
  if ((0, selector_1.isComplexSelector)(selector, this._spec)) {
136
+ const features = await this.driver.getFeatures();
136
137
  if (elements.length > 0) {
137
- if (selector.child) {
138
+ if (selector.child && !features.nestedSelectors) {
138
139
  elements = await elements.reduce((result, element) => {
139
140
  return result.then(async (result) => {
140
141
  return result.concat(await this._findElements(selector.child, { parent: element, all, wait }));
141
142
  });
142
143
  }, Promise.resolve([]));
143
144
  }
144
- else if (selector.shadow) {
145
+ else if (selector.shadow && !features.nestedSelectors) {
145
146
  elements = await elements.reduce((result, element) => {
146
147
  return result.then(async (result) => {
147
148
  const root = await this._spec.executeScript(this.target, snippets.getShadowRoot, [element]);
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.spec = exports.MockDriver = void 0;
27
+ const fakeSpec = __importStar(require("./spec-driver"));
27
28
  var mock_driver_1 = require("./mock-driver");
28
29
  Object.defineProperty(exports, "MockDriver", { enumerable: true, get: function () { return mock_driver_1.MockDriver; } });
29
- exports.spec = __importStar(require("./spec-driver"));
30
+ exports.spec = fakeSpec;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.13.6",
3
+ "version": "1.14.0",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -73,9 +73,9 @@
73
73
  "test": "run --top-level mocha './test/**/*.spec.ts'"
74
74
  },
75
75
  "dependencies": {
76
- "@applitools/logger": "2.0.9",
76
+ "@applitools/logger": "2.0.10",
77
77
  "@applitools/snippets": "2.4.23",
78
- "@applitools/utils": "1.5.2",
78
+ "@applitools/utils": "1.6.0",
79
79
  "semver": "7.5.4"
80
80
  },
81
81
  "devDependencies": {
@@ -1,3 +1,7 @@
1
+ import { type SpecDriver, type SpecType } from '../spec-driver';
2
+ import * as fakeSpec from './spec-driver';
1
3
  export { MockDriver } from './mock-driver';
2
- export { Driver, Element, Selector } from './spec-driver';
3
- export * as spec from './spec-driver';
4
+ export type Driver = fakeSpec.Driver;
5
+ export type Element = fakeSpec.Element;
6
+ export type Selector = fakeSpec.Selector;
7
+ export declare const spec: SpecDriver<SpecType<Driver, Driver, Element, Selector>>;
@@ -51,7 +51,7 @@ export interface SpecDriver<T extends SpecType> {
51
51
  /**
52
52
  * Assures that the error is a stale element error.
53
53
  */
54
- isStaleElementError(error: any, selector?: T['selector']): boolean;
54
+ isStaleElementError?(error: any, selector?: T['selector']): boolean;
55
55
  /**
56
56
  * Converts the given driver to a speced driver.
57
57
  * (applicable in cases when spec has certain variations or sub-types of the driver.)
package/types/types.d.ts CHANGED
@@ -59,7 +59,7 @@ export type Viewport = {
59
59
  safeArea?: Region;
60
60
  };
61
61
  export type Features = {
62
- shadowSelector?: boolean;
62
+ nestedSelectors?: boolean;
63
63
  allCookies?: boolean;
64
64
  canExecuteOnlyFunctionScripts?: boolean;
65
65
  };