@applitools/spec-driver-selenium 1.0.1 → 1.0.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,8 +1,12 @@
1
-
2
- ## 1.0.1 - 2021/10/12
3
-
4
- - spec driver implementation for selenium framework
5
1
  # Change Log
6
2
 
7
3
  ## Unreleased
8
4
 
5
+
6
+ ## 1.0.2 - 2021/10/12
7
+
8
+ - handle non-w3c appium driver
9
+
10
+ ## 1.0.1 - 2021/10/12
11
+
12
+ - spec driver implementation for selenium framework
@@ -146,7 +146,7 @@ async function getWindowSize(driver) {
146
146
  if (utils.types.isFunction(window.getSize)) {
147
147
  return await window.getSize();
148
148
  }
149
- else if (utils.types.isFunction(window.getRect)) {
149
+ else {
150
150
  const rect = await window.getRect();
151
151
  return { width: rect.width, height: rect.height };
152
152
  }
@@ -285,7 +285,14 @@ async function getOrientation(driver) {
285
285
  }
286
286
  exports.getOrientation = getOrientation;
287
287
  async function getElementRegion(_driver, element) {
288
- return element.getRect();
288
+ if (utils.types.isFunction(element.getRect)) {
289
+ return element.getRect();
290
+ }
291
+ else {
292
+ const { x, y } = await element.getLocation();
293
+ const { width, height } = await element.getSize();
294
+ return { x, y, width, height };
295
+ }
289
296
  }
290
297
  exports.getElementRegion = getElementRegion;
291
298
  async function getElementAttribute(_driver, element, attr) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/spec-driver-selenium",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "keywords": [
5
5
  "selenium",
6
6
  "selenium-webdriver",
@@ -57,7 +57,7 @@
57
57
  "@applitools/api-extractor": "1.1.3",
58
58
  "@applitools/scripts": "1.0.1",
59
59
  "@applitools/sdk-release-kit": "0.13.3",
60
- "@applitools/test-utils": "1.0.7",
60
+ "@applitools/test-utils": "1.0.8",
61
61
  "@types/mocha": "^9.0.0",
62
62
  "@types/node": "^16.10.2",
63
63
  "@types/selenium-webdriver": "^4.0.15",