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

@applitools/screenshoter

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/screenshoter - npm Package Compare versions

Comparing version 3.2.8 to 3.2.9

{
"name": "dry-run",
"lockfileVersion": 2,
"requires": true,
"lockfileVersion": 1,
"packages": {
"": {
"dependencies": {
"@applitools/screenshoter": "file:../dry-run.tgz"
}
},
"node_modules/@applitools/screenshoter": {
"version": "3.2.8",
"resolved": "file:../dry-run.tgz",
"integrity": "sha512-GjN+h/vj5/lKFjJPm302jD0xSFIOoSG7gPU/ogEUcCS9l5FDcMW27PRMA/xGlolKrabmCgDHJqVbAXE1WCgjyQ==",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@applitools/snippets": "2.1.7",
"@applitools/utils": "1.2.4",
"png-async": "0.9.4"
},
"engines": {
"node": ">= 8.9.0"
}
},
"node_modules/@applitools/snippets": {
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/@applitools/snippets/-/snippets-2.1.7.tgz",
"integrity": "sha512-Tr4Gj7Qov/oPy+8WI4oVmmubxqpOzr8P3Wjzpl6rA57xKLg6/TiIg5oZNb4+jEmO2ShjNYLaEwRWHl7kPgb4fw==",
"engines": {
"node": ">=8.9.0"
}
},
"node_modules/@applitools/utils": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@applitools/utils/-/utils-1.2.4.tgz",
"integrity": "sha512-w7ma6FFGyqhdP6LEcuHFWOcH7EzBjnoAX3UfbFWcTHA3QXnXPX37Y2ENYRodfwkorP1cUKyUHwNXJB/BMIj/hg==",
"engines": {
"node": ">= 8.9.0"
}
},
"node_modules/png-async": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/png-async/-/png-async-0.9.4.tgz",
"integrity": "sha512-B//AXX9TkneKfgtOpT1mdUnnhk2BImGD+a98vImsMU8uo1dBeHyW/kM2erWZ/CsYteTPU/xKG+t6T62heHkC3A=="
}
},
"dependencies": {
"@applitools/screenshoter": {
"version": "file:../dry-run.tgz",
"integrity": "sha512-J9JOZ+7hf0GMgaDZtNE5oVcRcOwtvDD/gXDP/eEY0PFIPFpXeEZU9abkVH4E6VeT6PwRCZz42EIb8Mvf2nsEkQ==",
"integrity": "sha512-GjN+h/vj5/lKFjJPm302jD0xSFIOoSG7gPU/ogEUcCS9l5FDcMW27PRMA/xGlolKrabmCgDHJqVbAXE1WCgjyQ==",
"requires": {

@@ -9,0 +52,0 @@ "@applitools/snippets": "2.1.7",

@@ -7,2 +7,6 @@

## 3.2.9 - 2021/11/14
- add support of scrollable elements that change its size during scrolling
## 3.2.8 - 2021/10/30

@@ -9,0 +13,0 @@

{
"name": "@applitools/screenshoter",
"version": "3.2.8",
"version": "3.2.9",
"description": "Applitools universal screenshoter for web and native applications",

@@ -57,4 +57,7 @@ "keywords": [

"devDependencies": {
"@applitools/driver": "1.2.7",
"@applitools/driver": "1.3.2",
"@applitools/sdk-release-kit": "0.13.4",
"@applitools/spec-driver-webdriverio": "1.2.0",
"@applitools/test-utils": "1.0.9",
"chromedriver": "^95.0.0",
"eslint": "^7.9.0",

@@ -68,3 +71,3 @@ "eslint-plugin-mocha-no-only": "^1.1.1",

"prettier": "1.19.0",
"webdriverio": "^6.10.5"
"webdriverio": "^7.16.7"
},

@@ -71,0 +74,0 @@ "engines": {

@@ -292,3 +292,6 @@ const fs = require('fs')

async function combine(firstImage, lastImage, srcImage, region) {
region = utils.geometry.intersect({x: 0, y: 0, width: firstImage.width, height: firstImage.height}, region)
region = utils.geometry.intersect(
{x: 0, y: 0, width: firstImage.width, height: firstImage.height},
utils.geometry.round(region),
)

@@ -295,0 +298,0 @@ if (region.x === 0 && region.y === 0 && region.width >= firstImage.width && region.height >= firstImage.height) {

@@ -30,2 +30,3 @@ const utils = require('@applitools/utils')

withStatusBar = withStatusBar && driver.isNative && window && (!fully || framed)
scrollingMode = driver.isNative ? 'scroll' : scrollingMode

@@ -32,0 +33,0 @@ const activeContext = driver.currentContext

@@ -153,3 +153,3 @@ const utils = require('@applitools/utils')

? {x: 0, y: 0, width: viewportSize.width, height: viewportSize.height + driver.statusBarHeight}
: {x: 0, y: driver.statusBarHeight, width: viewportSize.width, height: viewportSize.height}
: {top: driver.statusBarHeight, bottom: driver.navigationBarHeight, left: 0, right: 0}
image.crop(cropRegion)

@@ -156,0 +156,0 @@ await image.debug({...debug, name, suffix: `viewport${withStatusBar ? '-with-statusbar' : ''}`})

@@ -29,2 +29,4 @@ const utils = require('@applitools/utils')

const contentSize = await scroller.getContentSize()
logger.verbose('Getting initial image...')

@@ -43,3 +45,3 @@ let image = await takeScreenshot({name: 'initial', withStatusBar})

// in this case target region coordinate should be already related to the scrolling element of the context
const cropRegion = driver.isNative ? targetRegion : await driver.getRegionInViewport(context, targetRegion)
let cropRegion = driver.isNative ? targetRegion : await driver.getRegionInViewport(context, targetRegion)

@@ -50,3 +52,3 @@ logger.verbose('cropping...')

const contentRegion = utils.geometry.region({x: 0, y: 0}, await scroller.getContentSize())
const contentRegion = utils.geometry.region({x: 0, y: 0}, contentSize)
logger.verbose(`Scroller size: ${contentRegion}`)

@@ -90,7 +92,17 @@

)
// TODO come up with generic solution
// The problem is that web default scrolling element treated differently than normal scrollable elements on the web and native
const cropRegionOffset = driver.isNative
? utils.geometry.offsetNegative(
utils.geometry.location(await scroller.getClientRegion()),
utils.geometry.location(cropRegion),
)
: {x: 0, y: 0}
const cropPartRegion = {
x: cropRegion.x + remainingOffset.x,
y: cropRegion.y + remainingOffset.y,
width: partRegion.width,
height: partRegion.height,
x: cropRegion.x + remainingOffset.x + cropRegionOffset.x,
y: cropRegion.y + remainingOffset.y + cropRegionOffset.y,
width: partRegion.width - cropRegionOffset.x,
height: partRegion.height - cropRegionOffset.y,
}

@@ -112,2 +124,4 @@ logger.verbose(`Actual offset is ${actualOffset}, remaining offset is ${remainingOffset}`)

const pasteOffset = utils.geometry.offsetNegative(utils.geometry.location(partRegion), initialOffset)
pasteOffset.y += cropRegionOffset.y
pasteOffset.x += cropRegionOffset.x
await stitchedImage.copy(image, pasteOffset)

@@ -114,0 +128,0 @@

const assert = require('assert')
const pixelmatch = require('pixelmatch')
const {Driver} = require('@applitools/driver')
const spec = require('../util/spec-driver')
const spec = require('@applitools/spec-driver-webdriverio')
const makeImage = require('../../src/image')
const screenshoter = require('../../index')
const env = {
android: {
url: 'https://ondemand.saucelabs.com/wd/hub',
capabilities: {
name: 'Android Screenshoter Test',
browserName: '',
platformName: 'Android',
platformVersion: '7.0',
appiumVersion: '1.20.2',
deviceName: 'Samsung Galaxy S8 FHD GoogleAPI Emulator',
automationName: 'uiautomator2',
app: 'https://applitools.jfrog.io/artifactory/Examples/android/1.3/app-debug.apk',
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
},
},
androidx: {
url: 'https://ondemand.saucelabs.com/wd/hub',
capabilities: {
name: 'AndroidX Screenshoter Test',
browserName: '',
platformName: 'Android',
platformVersion: '10.0',
appiumVersion: '1.20.2',
deviceName: 'Google Pixel 3a XL GoogleAPI Emulator',
automationName: 'uiautomator2',
app: 'https://applitools.jfrog.io/artifactory/Examples/androidx/1.2.0/app_androidx.apk',
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
},
},
}
describe('screenshoter', () => {

@@ -23,3 +56,3 @@ const logger = {log: () => {}, warn: () => {}, error: () => {}, verbose: () => {}}

before(async () => {
;[browser, destroyBrowser] = await spec.build({type: 'android'})
;[browser, destroyBrowser] = await spec.build(env.android)
})

@@ -76,3 +109,3 @@

before(async () => {
;[browser, destroyBrowser] = await spec.build({type: 'androidx'})
;[browser, destroyBrowser] = await spec.build(env.androidx)
})

@@ -79,0 +112,0 @@

const assert = require('assert')
const pixelmatch = require('pixelmatch')
const {Driver} = require('@applitools/driver')
const spec = require('../util/spec-driver')
const spec = require('@applitools/spec-driver-webdriverio')
const makeImage = require('../../src/image')
const screenshoter = require('../../index')
const env = {
url: 'https://ondemand.saucelabs.com/wd/hub',
capabilities: {
name: 'iOS Screenshoter Test',
deviceName: 'iPhone 11 Pro Simulator',
platformName: 'iOS',
platformVersion: '13.4',
appiumVersion: '1.19.2',
automationName: 'XCUITest',
app: 'https://applitools.jfrog.io/artifactory/Examples/IOSTestApp/1.5/app/IOSTestApp-1.5.zip',
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
},
}
describe('screenshoter ios', () => {

@@ -28,3 +43,3 @@ const logger = {log: () => {}, warn: () => {}, error: () => {}, verbose: () => {}}

before(async () => {
;[browser, destroyBrowser] = await spec.build({type: 'ios'})
;[browser, destroyBrowser] = await spec.build(env)
})

@@ -31,0 +46,0 @@

const assert = require('assert')
const pixelmatch = require('pixelmatch')
const {Driver} = require('@applitools/driver')
const spec = require('../util/spec-driver')
const spec = require('@applitools/spec-driver-webdriverio')
const screenshoter = require('../../index')
const makeImage = require('../../src/image')
const env = {
url: 'https://ondemand.saucelabs.com/wd/hub',
capabilities: {
name: 'iOS Web Screenshoter Test',
deviceName: 'iPhone 11 Pro Simulator',
browserName: 'safari',
platformName: 'iOS',
platformVersion: '14.5',
appiumVersion: '1.20.1',
automationName: 'XCUITest',
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
},
}
// TODO add tests for page without viewport meta tag

@@ -15,3 +30,3 @@

before(async () => {
;[browser, destroyBrowser] = await spec.build({type: 'web-ios'})
;[browser, destroyBrowser] = await spec.build(env)
})

@@ -18,0 +33,0 @@

const assert = require('assert')
const pixelmatch = require('pixelmatch')
const {Driver} = require('@applitools/driver')
const spec = require('../util/spec-driver')
const spec = require('@applitools/spec-driver-webdriverio')
const screenshoter = require('../../index')
const makeImage = require('../../src/image')
const env = {
url: 'http://localhost:4444/wd/hub',
capabilities: {
browserName: 'chrome',
},
}
// TODO add overflowed regions tests

@@ -15,3 +22,3 @@

before(async () => {
;[browser, destroyBrowser] = await spec.build({type: 'web'})
;[browser, destroyBrowser] = await spec.build(env)
})

@@ -41,6 +48,6 @@

it('take frame screenshot with "scroll" scrolling', () => {
frame({scrollingMode: 'scroll'})
return frame({scrollingMode: 'scroll'})
})
it('take frame screenshot with "css" scrolling', () => {
frame({scrollingMode: 'css'})
return frame({scrollingMode: 'css'})
})

@@ -56,6 +63,6 @@

it('take region screenshot with "scroll" scrolling', () => {
region({scrollingMode: 'scroll'})
return region({scrollingMode: 'scroll'})
})
it('take region screenshot with "css" scrolling', () => {
region({scrollingMode: 'css'})
return region({scrollingMode: 'css'})
})

@@ -62,0 +69,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet