@applitools/eyes-cypress 3.27.6 → 3.27.8

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/CHANGELOG.md CHANGED
@@ -10,6 +10,23 @@
10
10
 
11
11
 
12
12
 
13
+
14
+ ## 3.27.8 - 2022/11/19
15
+
16
+ ### Features
17
+ ### Bug fixes
18
+ - Handle cases where cypress report showed tests pass when differences were found
19
+
20
+ ## 3.27.7 - 2022/11/17
21
+
22
+ ### Features
23
+ - Added new selector extensions `child` and `fallback`
24
+ - Use user agent metadata to improve browser environment detection logic
25
+ - Use APPLITOOLS_CONCURRENCY env variable to specify concurrency
26
+ ### Bug fixes
27
+ - Support parallel run of multiple `Cypress` instances
28
+ - Add support for regionId and padding for accessibility and floating regions
29
+
13
30
  ## 3.27.6 - 2022/10/28
14
31
 
15
32
  ### Features
package/README.md CHANGED
@@ -505,7 +505,24 @@ cy.get('some-region').then(el => {
505
505
  // will add padding of 20px to all JQuery elements at the top, button, right and left of the region
506
506
  ignore: {element: el, padding: 20},
507
507
  // will add padding for a DOM element on the top of the region
508
- content: {element: el[0], padding: {top:10}}
508
+ content: {element: el[0], padding: {top:10}},
509
+ accessibility: {
510
+ region: {
511
+ accessibilityType: 'LargeText',
512
+ selector: 'accessibilityRegion',
513
+ },
514
+ padding: {left: 5},
515
+ },
516
+ floating:{
517
+ region: {
518
+ selector: 'floatingRegion',
519
+ },
520
+ maxDownOffset: 3,
521
+ maxLeftOffset: 20,
522
+ maxRightOffset: 30,
523
+ maxUpOffset: 3,
524
+ padding: {top: 20},
525
+ },
509
526
  })
510
527
 
511
528
  })
@@ -662,10 +679,27 @@ cy.get('.region.two:nth-child(2)').then(el => {
662
679
  cy.eyesCheckWindow({
663
680
  fully: false,
664
681
  ignore: [
665
- {region: {type: 'css', selector: '.region.three:nth-child(3n)'}, regionId: 'region3'},
666
- {type: 'xpath', selector: '//div[@class="region one"][3]'},
682
+ {region: {type: 'css', selector: 'ignore1'}, regionId: 'region3'},
683
+ {type: 'xpath', selector: 'ignore2'},
667
684
  {element: el, regionId: 'my-region-id'},
668
685
  ],
686
+ accessibility: [{
687
+ region: {
688
+ accessibilityType: 'LargeText',
689
+ selector: 'accessibilityRegion',
690
+ },
691
+ regionId: 'accesibility-regionId',
692
+ },],
693
+ floating: [{
694
+ region: {
695
+ selector: 'floatingRegion',
696
+ },
697
+ maxDownOffset: 3,
698
+ maxLeftOffset: 20,
699
+ maxRightOffset: 30,
700
+ maxUpOffset: 3,
701
+ regionId: 'floating-regionId',
702
+ }]
669
703
  });
670
704
  })
671
705
  ```
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ type LegacyRegion = {left: number; top: number; width: number; height: number}
7
7
  type Selector = {selector: string; type?: 'css' | 'xpath', nodeType?: 'element' | 'shadow-root'} | 'string'
8
8
  type Element = HTMLElement | JQuery<HTMLElement>
9
9
 
10
- interface CypressCheckSettings extends api.CheckSettingsPlain<Element, Selector>{
10
+ interface CypressCheckSettings extends api.CheckSettingsAutomationPlain<Element, Selector>{
11
11
  tag?: CypressCheckSettings['name']
12
12
 
13
13
  target?: 'window' | 'region'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-cypress",
3
- "version": "3.27.6",
3
+ "version": "3.27.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git://github.com/applitools/eyes.sdk.javascript1.git",
@@ -56,11 +56,11 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "@applitools/core": "1.2.7",
60
- "@applitools/eyes-api": "1.9.1",
61
- "@applitools/eyes-universal": "2.16.9",
59
+ "@applitools/core": "1.2.12",
60
+ "@applitools/eyes-api": "1.10.4",
61
+ "@applitools/eyes-universal": "2.17.2",
62
62
  "@applitools/functional-commons": "1.6.0",
63
- "@applitools/logger": "1.1.27",
63
+ "@applitools/logger": "1.1.30",
64
64
  "chalk": "3.0.0",
65
65
  "semver": "7.3.8",
66
66
  "uuid": "8.3.2",
@@ -70,11 +70,11 @@
70
70
  "devDependencies": {
71
71
  "@applitools/bongo": "^2.2.0",
72
72
  "@applitools/scripts": "1.2.0",
73
- "@applitools/sdk-coverage-tests": "^2.3.20",
73
+ "@applitools/sdk-coverage-tests": "^2.7.8",
74
74
  "@applitools/snaptdout": "1.0.1",
75
- "@applitools/test-server": "1.1.8",
75
+ "@applitools/test-server": "1.1.10",
76
76
  "@applitools/test-utils": "1.5.2",
77
- "@applitools/utils": "1.3.13",
77
+ "@applitools/utils": "1.3.16",
78
78
  "@types/node": "12",
79
79
  "@types/which": "^2.0.1",
80
80
  "@types/ws": "^8.2.2",
@@ -58,7 +58,7 @@ Cypress.Commands.add('eyesGetAllTestResults', () => {
58
58
  });
59
59
  });
60
60
 
61
- if (shouldUseBrowserHooks) {
61
+ if (shouldUseBrowserHooks || Cypress.config('eyesFailCypressOnDiff')) {
62
62
  after(() => {
63
63
  if (!manager) return;
64
64
  return cy.then({timeout: 86400000}, async () => {
@@ -72,6 +72,7 @@ if (shouldUseBrowserHooks) {
72
72
  isTextTerminal: Cypress.config('isTextTerminal'),
73
73
  tapDirPath: Cypress.config('appliConfFile').tapDirPath,
74
74
  tapFileName: Cypress.config('appliConfFile').tapFileName,
75
+ shouldCreateTapFile: shouldUseBrowserHooks,
75
76
  };
76
77
  await Promise.all(closePromiseArr);
77
78
  const summary = await socket.request('EyesManager.closeManager', {manager, throwErr});
@@ -119,6 +119,10 @@ function eyesCheckMapValues({args, refer}) {
119
119
  resRegions = [...resRegions, ...refElements(region)];
120
120
  }
121
121
  } else {
122
+ if (region.selector && !region.type) {
123
+ region.region = region.selector;
124
+ delete region.selector;
125
+ }
122
126
  resRegions.push(region);
123
127
  }
124
128
  }
@@ -141,6 +145,10 @@ function eyesCheckMapValues({args, refer}) {
141
145
  for (const element of elements) {
142
146
  accessibility.push(Object.assign({}, accessabilityRegion, {region: element}));
143
147
  }
148
+ } else if (region.hasOwnProperty('region')) {
149
+ region.type = region.region.accessibilityType;
150
+ delete region.region.accessibilityType;
151
+ accessibility.push(region);
144
152
  } else {
145
153
  accessabilityRegion.region = {
146
154
  y: region.top,
@@ -174,6 +182,8 @@ function eyesCheckMapValues({args, refer}) {
174
182
  for (const element of elements) {
175
183
  floating.push(Object.assign({}, floatingRegion, {region: element}));
176
184
  }
185
+ } else if (region.hasOwnProperty('region')) {
186
+ floating.push(region);
177
187
  } else {
178
188
  floatingRegion.region = {
179
189
  y: region.top,
@@ -10,11 +10,6 @@ function makeGlobalRunHooks({closeManager, closeBatches, closeUniversalServer})
10
10
  'after:run': async ({config}) => {
11
11
  try {
12
12
  if (!config.isTextTerminal) return;
13
- const resultConfig = {
14
- showLogs: config.showLogs,
15
- eyesFailCypressOnDiff: config.eyesFailCypressOnDiff,
16
- isTextTerminal: config.isTextTerminal,
17
- };
18
13
  const summaries = await closeManager();
19
14
 
20
15
  let testResults;
@@ -36,8 +31,6 @@ function makeGlobalRunHooks({closeManager, closeBatches, closeUniversalServer})
36
31
  tapFileName: config.appliConfFile.tapFileName,
37
32
  });
38
33
  }
39
-
40
- handleTestResults.printTestResults({testResults, resultConfig});
41
34
  } finally {
42
35
  await closeUniversalServer();
43
36
  }
@@ -46,18 +46,18 @@ function makeStartServer({logger}) {
46
46
  }
47
47
 
48
48
  const {port: universalPort, close: closeUniversalServer} = await makeServerProcess({
49
- key: path.resolve(__dirname, '../pem/server.key'),
50
- cert: path.resolve(__dirname, '../pem/server.cert'),
51
49
  idleTimeout: 0,
52
50
  shutdownMode: 'stdin',
53
51
  forkOptions,
52
+ singleton: false,
53
+ portResolutionMode: 'random',
54
54
  });
55
55
 
56
56
  const managers = [];
57
57
  let socketWithUniversal;
58
58
 
59
59
  wss.on('connection', socketWithClient => {
60
- socketWithUniversal = connectSocket(`wss://localhost:${universalPort}/eyes`);
60
+ socketWithUniversal = connectSocket(`ws://localhost:${universalPort}/eyes`);
61
61
 
62
62
  socketWithUniversal.setPassthroughListener(message => {
63
63
  logger.log('<== ', message.toString().slice(0, 1000));
@@ -84,7 +84,10 @@ function makeStartServer({logger}) {
84
84
  socketWithUniversal.send(newMessage);
85
85
  } else if (msg.name === 'Test.printTestResults') {
86
86
  try {
87
- if (msg.payload.resultConfig.tapDirPath) {
87
+ if (
88
+ msg.payload.resultConfig.tapDirPath &&
89
+ msg.payload.resultConfig.shouldCreateTapFile
90
+ ) {
88
91
  handleTestResults.handleBatchResultsFile(msg.payload.testResults, {
89
92
  tapFileName: msg.payload.resultConfig.tapFileName,
90
93
  tapDirPath: msg.payload.resultConfig.tapDirPath,