@applitools/driver
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -7,3 +7,3 @@ { | ||
"version": "file:../dry-run.tgz", | ||
"integrity": "sha512-TtHV9qaFeACFqYqzuSJKBKo2hnU0XH4cWZeJNlvJR6mTXNALpXb5eqMRZIfPQFy+1tmHmusPNLQJ8BlQmIPbUw==", | ||
"integrity": "sha512-HyFiAetTZmMS1IbKZrHKlJG0tOhbze0pZPDDjFKB/Q4g68Q2+bqZw1SOqrc1bRlnHtNJ8T8FAU1+rlmtbsInqw==", | ||
"requires": { | ||
@@ -10,0 +10,0 @@ "@applitools/snippets": "2.1.3", |
@@ -6,2 +6,6 @@ # Change Log | ||
## 1.0.7 - 2021/6/8 | ||
- replace setWindowRect with setWindowSize | ||
## 1.0.6 - 2021/5/24 | ||
@@ -8,0 +12,0 @@ |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -401,7 +401,6 @@ const scripts = require('./scripts') | ||
*/ | ||
async getWindowRect() { | ||
const {x = 0, y = 0, width, height} = this.spec.getWindowRect | ||
? await this.spec.getWindowRect(this._driver) | ||
: await this.spec.getViewportSize(this._driver) | ||
return {x, y, width, height} | ||
async getWindowSize() { | ||
return this.spec.getWindowSize | ||
? this.spec.getWindowSize(this._driver) | ||
: this.spec.getViewportSize(this._driver) | ||
} | ||
@@ -412,8 +411,5 @@ /** | ||
*/ | ||
async setWindowRect(rect) { | ||
if (this.spec.setWindowRect) { | ||
await this.spec.setWindowRect(this._driver, rect) | ||
} else if (rect.width && rect.height) { | ||
await this.spec.setViewportSize(this._driver, {width: rect.width, height: rect.height}) | ||
} | ||
async setWindowSize(size) { | ||
if (this.spec.setWindowSize) await this.spec.setWindowSize(this._driver, size) | ||
else await this.spec.setViewportSize(this._driver, size) | ||
} | ||
@@ -420,0 +416,0 @@ /** |
@@ -16,3 +16,3 @@ const utils = require('@applitools/utils') | ||
} else { | ||
const rect = await context.driver.getWindowRect() | ||
const rect = await context.driver.getWindowSize() | ||
size = {width: rect.width, height: rect.height} | ||
@@ -45,9 +45,3 @@ if (size.height > size.width) { | ||
// We move the window to (0,0) to have the best chance to be able to | ||
// set the viewport size as requested. | ||
await context.driver.setWindowRect({x: 0, y: 0}).catch(err => { | ||
logger.verbose('Warning: Failed to move the browser window to (0,0)', err) | ||
}) | ||
let actualWindowSize = await context.driver.getWindowRect() | ||
let actualWindowSize = await context.driver.getWindowSize() | ||
actualViewportSize = await getViewportSize(logger, context) | ||
@@ -65,3 +59,3 @@ logger.verbose(`actualWindowSize: ${actualWindowSize}, actualViewportSize: ${actualViewportSize}`) | ||
logger.verbose(`Attempt to set window size to ${requiredWindowSize}. Retries left: ${retries}`) | ||
await context.driver.setWindowRect(requiredWindowSize) | ||
await context.driver.setWindowSize(requiredWindowSize) | ||
await utils.general.sleep(sleep) | ||
@@ -68,0 +62,0 @@ actualViewportSize = await getViewportSize(logger, context) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
89267
1556