Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@percy/appium-app

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/appium-app - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

2

package.json
{
"name": "@percy/appium-app",
"description": "Appium client library for visual testing with Percy",
"version": "2.0.5",
"version": "2.0.6",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": "Perceptual Inc.",

@@ -17,3 +17,3 @@ const { Cache } = require('../util/cache');

// In typescript for wdio we get driver.constuctor.name as 'BoundBrowser'
if (driver.constructor.name.includes('Browser') && !Undefined(driver.getSession)) {
if (driver.constructor.name.includes('Browser') && !Undefined(driver.capabilities)) {
this.type = 'wdio';

@@ -34,3 +34,3 @@ } else if ((driver.constructor.name === '' ||

/* istanbul ignore next */ // not sure why its marking it when its covered
if (this.wdio) return await this.driver.getSession();
if (this.wdio) return await this.driver.capabilities;
});

@@ -113,2 +113,8 @@ });

async getWindowSize() {
return await TimeIt.run('getWindowSize', async () => {
return await this.driver.getWindowSize();
});
}
get commandExecutorUrl() {

@@ -115,0 +121,0 @@ if (this.wd) return `${this.driver.configUrl.protocol}//${this.remoteHostname}${this.driver.configUrl.path}`;

@@ -9,3 +9,2 @@ const { Metadata } = require('./metadata');

const caps = await this.caps();
if (await this.staticData()) {

@@ -16,4 +15,9 @@ const data = await this.staticData();

// In Ios the height of statusBarHeight in caps needs to be multiplied by pixel ratio
return (caps.statBarHeight || 1) * (caps.pixelRatio || 1);
// For iOS method to fetch statusBarHeight for wdio & wd is different
if (this.driver.wdio) {
return (await this.viewportRect()).top;
} else {
const caps = await this.caps();
return (caps.statBarHeight || 1) * (caps.pixelRatio || 1);
}
}

@@ -31,3 +35,2 @@

// We do not use existing functions because user can override those
const caps = await this.caps();
if (await this.staticData()) {

@@ -37,7 +40,24 @@ const data = await this.staticData();

}
const height = caps.statBarHeight * caps.pixelRatio + caps.viewportRect?.height;
const width = caps.viewportRect?.width;
let height, width;
// For iOS method to fetch screenSize for wdio & wd is different
if (this.driver.wdio) {
const viewportRect = await this.viewportRect();
height = viewportRect.top + viewportRect.height;
width = viewportRect.width;
} else {
const caps = await this.caps();
height = caps.statBarHeight * caps.pixelRatio + caps.viewportRect?.height;
width = caps.viewportRect?.width;
}
return { width, height };
}
async viewportRect() {
if (this._viewportRect) return this._viewportRect;
this._viewportRect = await this.driver.execute('mobile: viewportRect');
return this._viewportRect;
}
// Need override because ios does not have desired in caps

@@ -58,3 +78,12 @@ async deviceName() {

async scaleFactor() {
return (await this.caps()).pixelRatio;
// For iOS method to fetch scaleFactor for wdio & wd is different
if (this.driver.wdio) {
const viewportRect = await this.viewportRect();
const actualWidth = viewportRect.width;
const windowSize = await this.driver.getWindowSize();
const width = windowSize.width;
return actualWidth / width;
} else {
return (await this.caps()).pixelRatio;
}
}

@@ -61,0 +90,0 @@ }

@@ -19,2 +19,3 @@ const log = require('../util/log');

this._navigationBarHeight = navigationBarHeight;
this._viewportRect = null;
}

@@ -21,0 +22,0 @@

@@ -1,2 +0,1 @@

const { Undefined } = require('./validations');

@@ -3,0 +2,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc