@percy/appium-app
Advanced tools
Comparing version 2.0.3 to 2.0.4-beta.0
12
index.js
@@ -30,3 +30,4 @@ const { AppiumDriver } = require('./percy/driver/driverWrapper'); | ||
bottomScrollviewOffset, | ||
scrollableId | ||
scrollableId, | ||
sync | ||
} = options; | ||
@@ -58,2 +59,3 @@ // allow working with or without standalone mode for wdio | ||
scrollableId = name.scrollableId; | ||
sync = name.sync; | ||
options = name; | ||
@@ -83,3 +85,4 @@ } | ||
if (utils.percy?.type === 'automate') { | ||
return await percyOnAutomate(driver, name, options); | ||
const percyOnAutomateResponse = await percyOnAutomate(driver, name, options); | ||
return percyOnAutomateResponse?.body?.data; | ||
} | ||
@@ -106,6 +109,7 @@ const provider = ProviderResolver.resolve(driver); | ||
bottomScrollviewOffset, | ||
scrollableId | ||
scrollableId, | ||
sync | ||
}); | ||
log.debug(`[${name}] -> end`); | ||
return response; | ||
return response?.body?.data; | ||
} catch (e) { | ||
@@ -112,0 +116,0 @@ log.error(`[${name}] failed to take screenshot`); |
{ | ||
"name": "@percy/appium-app", | ||
"description": "Appium client library for visual testing with Percy", | ||
"version": "2.0.3", | ||
"version": "2.0.4-beta.0", | ||
"license": "MIT", | ||
@@ -28,3 +28,3 @@ "author": "Perceptual Inc.", | ||
"access": "public", | ||
"tag": "latest" | ||
"tag": "beta" | ||
}, | ||
@@ -38,7 +38,7 @@ "scripts": { | ||
"dependencies": { | ||
"@percy/sdk-utils": "^1.27.0-beta.0", | ||
"@percy/sdk-utils": "^1.28.0-beta.0", | ||
"tmp": "^0.2.1" | ||
}, | ||
"devDependencies": { | ||
"@percy/cli": "^1.27.2", | ||
"@percy/cli": "^1.28.0-beta.0", | ||
"cross-env": "^7.0.2", | ||
@@ -45,0 +45,0 @@ "eslint": "^8.27.0", |
@@ -61,3 +61,3 @@ const log = require('./util/log'); | ||
// Post the driver details to the automate screenshot endpoint with snapshot options and other info | ||
await module.exports.request({ | ||
return await module.exports.request({ | ||
environmentInfo: ENV_INFO, | ||
@@ -82,3 +82,3 @@ clientInfo: CLIENT_INFO, | ||
module.exports.request = async function request(data) { | ||
await utils.captureAutomateScreenshot(data); | ||
return await utils.captureAutomateScreenshot(data); | ||
}; // To mock in test case |
@@ -36,6 +36,8 @@ const { GenericProvider } = require('./genericProvider'); | ||
bottomScrollviewOffset, | ||
scrollableId | ||
scrollableId, | ||
sync | ||
} = {}) { | ||
let response = null; | ||
let error; | ||
sync = sync || null; | ||
try { | ||
@@ -64,3 +66,4 @@ let result = await this.percyScreenshotBegin(name); | ||
bottomScrollviewOffset, | ||
scrollableId | ||
scrollableId, | ||
sync | ||
}); | ||
@@ -71,3 +74,3 @@ } catch (e) { | ||
} finally { | ||
await this.percyScreenshotEnd(name, response?.body?.link, `${error}`); | ||
await this.percyScreenshotEnd(name, response?.body?.link, sync, `${error}`); | ||
} | ||
@@ -90,2 +93,3 @@ return response; | ||
log.debug(`[${name}] Could not mark App Automate session as percy`); | ||
log.debug(`[${name}] ${e}`); | ||
return null; | ||
@@ -96,3 +100,3 @@ } | ||
async percyScreenshotEnd(name, percyScreenshotUrl, statusMessage = null) { | ||
async percyScreenshotEnd(name, percyScreenshotUrl, sync, statusMessage = null) { | ||
return await TimeIt.run('percyScreenshotEnd', async () => { | ||
@@ -105,2 +109,3 @@ try { | ||
statusMessage, | ||
sync, | ||
state: 'end' | ||
@@ -164,4 +169,4 @@ }); | ||
statusBarHeight: statBarHeight, | ||
navBarHeight: navBarHeight, | ||
fullscreen: fullscreen, | ||
navBarHeight, | ||
fullscreen, | ||
headerHeight: tileData.header_height, | ||
@@ -168,0 +173,0 @@ footerHeight: tileData.footer_height, |
@@ -54,5 +54,7 @@ const utils = require('@percy/sdk-utils'); | ||
scrollableXpath, | ||
scrollableId | ||
scrollableId, | ||
sync | ||
}) { | ||
fullscreen = fullscreen || false; | ||
sync = sync || null; | ||
@@ -80,2 +82,3 @@ this.metadata = await MetadataResolver.resolve(this.driver, { | ||
log.debug(`${name} : Debug url ${this.debugUrl}`); | ||
log.debug(`${name} : sync ${sync}`); | ||
return await utils.postComparison({ | ||
@@ -93,3 +96,4 @@ name, | ||
environmentInfo: ENV_INFO, | ||
clientInfo: CLIENT_INFO | ||
clientInfo: CLIENT_INFO, | ||
sync | ||
}); | ||
@@ -96,0 +100,0 @@ } |
@@ -74,3 +74,4 @@ # @percy/appium-app | ||
- `name` (**required**) - The screenshot name; must be unique to each screenshot | ||
- `options object` (**optional**) | ||
- `options object` (**optional**) | ||
- `sync` - Boolean value by default it falls back to false, Gives the processed result around screenshot [From CLI v1.28.0-beta.0+] | ||
- `fullscreen`: If the app is currently in fullscreen; boolean | ||
@@ -77,0 +78,0 @@ - `deviceName`: Custom device name to override SDK fetched name |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
50937
1196
178
1