@applitools/visual-grid-cli-utils 1.21.25 → 1.21.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/visual-grid-cli-utils",
3
- "version": "1.21.25",
3
+ "version": "1.21.28",
4
4
  "description": "",
5
5
  "main": "src/visual-grid-cli-utils.js",
6
6
  "engines": {
package/src/compare.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
  const {Eyes, Target, Configuration, BatchInfo} = require('@applitools/eyes-images')
3
3
  const rerender = require('./rerender')
4
- const { randomUUID } = require('crypto')
4
+ const {randomUUID} = require('crypto')
5
5
 
6
6
  async function main(args) {
7
7
  async function runRerender(browser) {
@@ -18,6 +18,7 @@ async function main(args) {
18
18
 
19
19
  async function compareWithEyes(rerenderResults) {
20
20
  const eyes = new Eyes()
21
+ let batchUrl
21
22
  try {
22
23
  // Initialize the eyes configuration
23
24
  const configuration = new Configuration()
@@ -28,22 +29,21 @@ async function compareWithEyes(rerenderResults) {
28
29
  // Set the configuration to eyes
29
30
  eyes.setConfiguration(configuration)
30
31
 
31
- const uuid = randomUUID()
32
-
32
+ const uuid = randomUUID()
33
33
  let i = 0
34
34
  for (const result of rerenderResults) {
35
+ await eyes.open('VG-CLI compare', `Compare browsers ${uuid}`)
35
36
  const {browser: name, image: file} = result
36
-
37
- await eyes.open('VG-CLI compare', `Compare browsers ${uuid}`, {width: 800, height: 600})
38
37
  const resp = await eyes.check(name, Target.image(file))
39
- console.log(`${name} resp ${i} = ${resp}`)
40
- if (++i === rerenderResults.length - 1) {
41
- console.log('\nBatch results: \n', eyes.getRunningSession().getUrl())
42
- }
38
+ batchUrl = batchUrl || eyes.getRunningSession().getUrl()
39
+ console.log(`${++i}. ${name} check result: ${resp}`)
43
40
  await eyes.close()
44
41
  }
42
+ } catch (err) {
43
+ console.error(err)
45
44
  } finally {
46
45
  await eyes.abortIfNotClosed()
46
+ console.log('\nBatch results: \n', batchUrl)
47
47
  }
48
48
  }
49
49
 
package/src/job-info.js CHANGED
@@ -15,6 +15,10 @@ async function main({
15
15
  deviceOrientation,
16
16
  iosDeviceName,
17
17
  iosDeviceOrientation,
18
+ androidDeviceName,
19
+ androidVersion,
20
+ androidDeviceOrientation,
21
+ androidVhsType,
18
22
  serverUrl,
19
23
  accountOverride,
20
24
  canary,
@@ -44,6 +48,14 @@ async function main({
44
48
  version: canary ? 'canary' : iosVersion,
45
49
  }
46
50
  : undefined,
51
+ androidDeviceInfo: androidDeviceName
52
+ ? {
53
+ name: androidDeviceName,
54
+ version: canary ? 'canary' : androidVersion,
55
+ screenOrientation: androidDeviceOrientation,
56
+ }
57
+ : undefined,
58
+ vhsType: androidDeviceName ? androidVhsType : undefined,
47
59
  width: deviceEmulation || iosDeviceName ? undefined : width,
48
60
  height: deviceEmulation || iosDeviceName ? undefined : height,
49
61
  target: 'full-page',
@@ -54,7 +66,10 @@ async function main({
54
66
  : {
55
67
  name: iosDeviceName ? 'safari' : canary ? convertBrowserNameToCanary(browser) : browser,
56
68
  },
57
- platform: {name: iosDeviceName ? 'ios' : undefined, type: native ? 'native' : 'web'},
69
+ platform: {
70
+ name: iosDeviceName ? 'ios' : androidDeviceName ? 'android' : undefined,
71
+ type: native ? 'native' : 'web',
72
+ },
58
73
  options,
59
74
  },
60
75
  {
@@ -490,6 +490,28 @@ async function main(argv, {shouldExitOnError = false} = {}) {
490
490
  choices: ['portrait', 'landscapeLeft', 'landscapeRight'],
491
491
  default: 'portrait',
492
492
  })
493
+ .option('android-device-name', {
494
+ describe: 'the name of the Android device to use',
495
+ type: 'string',
496
+ })
497
+ .option('android-version', {
498
+ describe:
499
+ 'The Android version to use (latest, latest-1 or latest-2 - relative to the device)',
500
+ type: 'string',
501
+ default: 'latest',
502
+ })
503
+ .option('android-device-orientation', {
504
+ describe: 'screen orientation',
505
+ type: 'string',
506
+ choices: ['portrait', 'landscape'],
507
+ default: 'portrait',
508
+ })
509
+ .option('android-vhs-type', {
510
+ describe: 'vhs type',
511
+ type: 'string',
512
+ choices: ['android-x', 'android-support'],
513
+ default: 'android-x',
514
+ })
493
515
  .option('browser', {
494
516
  alias: 'b',
495
517
  describe: 'the browser to render to',