@applitools/eyes-storybook 3.28.0 → 3.29.2

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
@@ -3,6 +3,30 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 3.29.2 - 2022/7/14
7
+
8
+ ### Features
9
+ - Allow configuration file to be loaded from ancestor directories
10
+ ### Bug fixes
11
+ - Fixed bug where a failure in a single UFG environment fails all other environments in the same configuration
12
+
13
+ ## 3.29.1 - 2022/6/16
14
+
15
+ ### Features
16
+ - Allowed `` values in custom properties
17
+ - Add special attribute for pseudo elements
18
+ - Support padding for regions in the following region types - ignoreRegions, layoutRegions, strictRegions, contentRegions
19
+ ### Bug fixes
20
+ - Fixed broken links to enums implementation in the README.md
21
+ - Fix rendering issues with Salesforce Lightning design system
22
+ - Add timeout when attempting to get data for a story
23
+
24
+ ## 3.29.0 - 2022/6/2
25
+
26
+ ### Features
27
+ - Dorp support for Node.js versions <=12
28
+ ### Bug fixes
29
+
6
30
  ## 3.28.0 - 2022/5/26
7
31
 
8
32
  ### Features
package/README.md CHANGED
@@ -293,7 +293,7 @@ module.exports = {
293
293
 
294
294
  Possible values for screen orientation are `landscape` and `portrait`, and if no value is specified, the default is `portrait`.
295
295
 
296
- The list of device names is available at https://github.com/applitools/eyes.sdk.javascript1/blob/master/packages/eyes-sdk-core/lib/config/DeviceName.js
296
+ The list of device names is available at https://github.com/applitools/eyes.sdk.javascript1/blob/master/packages/eyes-api/src/enums/DeviceName.ts
297
297
 
298
298
  In addition, it's possible to use chrome's device emulation with custom viewport sizes, pixel density and mobile mode, by passing `deviceScaleFactor` and `mobile` in addition to `width` and `height`. For example:
299
299
 
@@ -323,7 +323,7 @@ module.exports = {
323
323
  }
324
324
  ```
325
325
 
326
- The list of devices is available at https://github.com/applitools/eyes.sdk.javascript1/blob/master/packages/eyes-sdk-core/lib/config/IosDeviceName.js
326
+ The list of devices is available at https://github.com/applitools/eyes.sdk.javascript1/blob/master/packages/eyes-api/src/enums/IosDeviceName.ts
327
327
 
328
328
  Possible values for `iosVersion` are:
329
329
 
@@ -852,7 +852,7 @@ storiesOf('Some kind', module).add('Date', () => <div>{date}</div>)
852
852
 
853
853
  ## Storybook interactions Play functionality
854
854
 
855
- Since version 3.27.7, there is a support for Storybooks' Interactions Play functionality: Stories who use 'Play', screenshot will be taken _automatically_ after the 'Play' flow is done.
855
+ Since version 3.28.0, there is a support for Storybooks' Interactions Play functionality: Stories who use 'Play', screenshot will be taken _automatically_ after the 'Play' flow is done.
856
856
  This will replace the existing point of taking screenshots, it should not affect any new or existing Stories which are **not** using the 'Play' functionality.
857
857
  Tests that use the _`waitBeforeCapture`_ property, the wait period will begin **after** the 'Play' flow is done.
858
858
  You can read more at Storybook interactions documentation:
package/package.json CHANGED
@@ -1,30 +1,47 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.28.0",
3
+ "version": "3.29.2",
4
4
  "description": "",
5
- "engines": {
6
- "node": ">=8.6.0"
5
+ "keywords": [
6
+ "applitools",
7
+ "testing",
8
+ "browser",
9
+ "grid",
10
+ "visual-testing",
11
+ "nodejs",
12
+ "javascript"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git://github.com/applitools/eyes.sdk.javascript1.git",
17
+ "directory": "js/packages/eyes-storybook"
18
+ },
19
+ "license": "SEE LICENSE IN LICENSE",
20
+ "author": "Applitools Team <team@applitools.com>",
21
+ "aliases": [
22
+ "storybook"
23
+ ],
24
+ "bin": {
25
+ "eyes-storybook": "./bin/eyes-storybook.js"
7
26
  },
8
27
  "files": [
9
28
  "src",
10
29
  "bin",
11
30
  "dist"
12
31
  ],
13
- "bin": {
14
- "eyes-storybook": "./bin/eyes-storybook.js"
15
- },
16
32
  "scripts": {
33
+ "lint": "eslint '**/*.js'",
34
+ "build": "rollup -c rollup.config.js",
35
+ "build:heavy": "node scripts/bitmap.js",
17
36
  "test": "yarn build && yarn test:mocha && yarn lint",
18
- "test:versions": "yarn build && yarn test:e2e:versions && yarn lint",
37
+ "test:sanity": "yarn test:unit && yarn test:it",
19
38
  "test:mocha": "yarn test:unit && yarn test:it && yarn test:e2e",
20
- "test:unit": "STDOUT_LEVEL=0 mocha --no-timeouts --trace-warnings 'test/unit/*.test.js'",
21
- "test:it": "STDOUT_LEVEL=1 mocha --no-timeouts --trace-warnings 'test/it/*.test.js'",
39
+ "test:unit": "mocha --no-timeouts --trace-warnings 'test/unit/*.test.js'",
40
+ "test:it": "mocha --no-timeouts --trace-warnings 'test/it/*.test.js'",
41
+ "test:versions": "yarn build && yarn test:e2e:versions && yarn lint",
22
42
  "test:e2e": "mocha --no-timeouts --trace-warnings 'test/e2e/*.e2e.test.js'",
23
43
  "test:e2e:versions": "npx mocha --no-timeouts --trace-warnings --require test/fixtures/storybook-versions/mochaHooks.js test/e2e/*.e2e.versions.test.js",
24
44
  "test:e2e:versions_local": "STORYBOOK_VERSION=latest npx mocha --no-timeouts --trace-warnings --require test/fixtures/storybook-versions/mochaHooks.js test/e2e/*.e2e.versions.test.js",
25
- "build": "rollup -c rollup.config.js",
26
- "build:heavy": "node scripts/bitmap.js",
27
- "lint": "eslint '**/*.js'",
28
45
  "storybook": "start-storybook -c test/fixtures/appWithStorybook -p 9001 -s test/fixtures",
29
46
  "storybook:jslayout": "start-storybook -c test/fixtures/jsLayoutStorybookLocal -p 9001 -s test/fixtures",
30
47
  "storybook:csf": "yarn storybook:csf-service && start-storybook -c test/fixtures/storybookCSF/.storybook-temp -p 9001",
@@ -40,39 +57,28 @@
40
57
  "changelog:init": "git config changelog.format \"* %s [[%h]($(echo $npm_package_repository_url|cut -d+ -f2|cut -d. -f1-2)/commit/%H)]\"",
41
58
  "changelog:install": "sudo apt-get install git-extras",
42
59
  "gh:publish": "gh workflow run publish-storybook.yml --ref $(git rev-parse --abbrev-ref HEAD)",
60
+ "prepublish:setup": "echo 'setup is a no-op. Move along, nothing to see here.'",
61
+ "deps": "bongo deps",
43
62
  "postinstall": "node src/postinstall",
44
63
  "preversion": "bongo preversion --verifyPendingChanges",
45
64
  "version": "bongo version --withPendingChanges",
46
- "postversion": "bongo postversion --skip-release-notification",
47
- "deps": "bongo deps",
48
- "prepublish:setup": "echo 'setup is a no-op. Move along, nothing to see here.'"
65
+ "postversion": "bongo postversion --skip-release-notification"
49
66
  },
50
- "keywords": [
51
- "applitools",
52
- "testing",
53
- "browser",
54
- "grid",
55
- "visual-testing",
56
- "nodejs",
57
- "javascript"
58
- ],
59
- "author": "Applitools Team <team@applitools.com>",
60
- "license": "SEE LICENSE IN LICENSE",
61
- "repository": {
62
- "type": "git",
63
- "url": "git://github.com/applitools/eyes.sdk.javascript1.git",
64
- "directory": "packages/eyes-storybook"
67
+ "husky": {
68
+ "hooks": {
69
+ "pre-push": "yarn bongo lint"
70
+ }
65
71
  },
66
72
  "dependencies": {
67
- "@applitools/driver": "1.8.12",
68
- "@applitools/eyes-sdk-core": "13.6.21",
73
+ "@applitools/driver": "1.9.15",
74
+ "@applitools/eyes-sdk-core": "13.8.12",
69
75
  "@applitools/functional-commons": "1.6.0",
70
- "@applitools/logger": "1.1.5",
76
+ "@applitools/logger": "1.1.15",
71
77
  "@applitools/monitoring-commons": "1.0.19",
72
- "@applitools/spec-driver-puppeteer": "1.1.2",
73
- "@applitools/test-server": "1.0.9",
74
- "@applitools/utils": "1.3.0",
75
- "@applitools/visual-grid-client": "15.12.33",
78
+ "@applitools/spec-driver-puppeteer": "1.1.6",
79
+ "@applitools/test-server": "1.1.4",
80
+ "@applitools/utils": "1.3.10",
81
+ "@applitools/visual-grid-client": "15.13.6",
76
82
  "boxen": "4.2.0",
77
83
  "chalk": "3.0.0",
78
84
  "detect-port": "1.3.0",
@@ -84,9 +90,9 @@
84
90
  "yargs": "15.4.1"
85
91
  },
86
92
  "devDependencies": {
87
- "@applitools/bongo": "^2.1.0",
93
+ "@applitools/bongo": "^2.1.6",
88
94
  "@applitools/scripts": "^1.1.0",
89
- "@applitools/sdk-shared": "0.9.11",
95
+ "@applitools/sdk-shared": "0.9.13",
90
96
  "@applitools/snaptdout": "^1.0.1",
91
97
  "@storybook/addon-interactions": "^6.4.18",
92
98
  "@storybook/react": "^6.4.18",
@@ -115,9 +121,7 @@
115
121
  "rollup-plugin-commonjs": "^10.1.0",
116
122
  "ua-parser-js": "^0.7.21"
117
123
  },
118
- "husky": {
119
- "hooks": {
120
- "pre-push": "yarn bongo lint"
121
- }
124
+ "engines": {
125
+ "node": ">=12.13.0"
122
126
  }
123
127
  }
package/src/cli.js CHANGED
@@ -15,7 +15,7 @@ const handleJsonFile = require('./handleJsonFile');
15
15
  const handleTapFile = require('./handleTapFile');
16
16
  const handleXmlFile = require('./handleXmlFile');
17
17
  const {presult} = require('@applitools/functional-commons');
18
- const chalk = require('./chalkify');
18
+ const chalk = require('chalk');
19
19
  const {performance, timeItAsync} = makeTiming();
20
20
 
21
21
  (async function() {
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const chalk = require('./chalkify');
2
+ const chalk = require('chalk');
3
3
 
4
4
  module.exports = chalk.yellow(`
5
5
  Important notice: Your Applitools visual tests are currently running with a concurrency value of 5.
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const chalk = require('./chalkify');
2
+ const chalk = require('chalk');
3
3
 
4
4
  const missingApiKeyFailMsg = `
5
5
  ${chalk.red('Environment variable APPLITOOLS_API_KEY is not set.')}
@@ -3,7 +3,7 @@ const puppeteer = require('puppeteer');
3
3
  const getStories = require('../dist/getStories');
4
4
  const {makeVisualGridClient} = require('@applitools/visual-grid-client');
5
5
  const {presult, delay} = require('@applitools/functional-commons');
6
- const chalk = require('./chalkify');
6
+ const chalk = require('chalk');
7
7
  const makeInitPage = require('./initPage');
8
8
  const makeRenderStory = require('./renderStory');
9
9
  const makeRenderStories = require('./renderStories');
@@ -1,15 +1,16 @@
1
1
  'use strict';
2
2
  const pick = require('lodash.pick');
3
- const {ConfigUtils, GeneralUtils} = require('@applitools/eyes-sdk-core');
3
+ const utils = require('@applitools/utils');
4
+ const {GeneralUtils} = require('@applitools/eyes-sdk-core');
4
5
  const {resolve} = require('path');
5
6
  const {deprecationWarning} = GeneralUtils;
6
7
  const uniq = require('./uniq');
7
8
 
8
9
  function generateConfig({argv = {}, defaultConfig = {}, externalConfigParams = []}) {
9
- const configPath = argv.conf ? resolve(process.cwd(), argv.conf) : undefined;
10
10
  const defaultConfigParams = Object.keys(defaultConfig);
11
+ const configPaths = argv.conf ? [resolve(process.cwd(), argv.conf)] : undefined;
11
12
  const configParams = uniq(defaultConfigParams.concat(externalConfigParams));
12
- const config = ConfigUtils.getConfig({configPath, configParams});
13
+ const config = utils.config.getConfig({paths: configPaths, params: configParams});
13
14
  const argvConfig = pick(argv, configParams);
14
15
  const result = Object.assign({}, defaultConfig, config, argvConfig);
15
16
 
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const {presult} = require('@applitools/functional-commons');
2
+ const {presult, ptimeoutWithError} = require('@applitools/functional-commons');
3
3
  const {ArgumentGuard} = require('@applitools/eyes-sdk-core');
4
4
  const renderStoryWithClientAPI = require('../dist/renderStoryWithClientAPI');
5
5
  const runRunBeforeScript = require('../dist/runRunBeforeScript');
@@ -7,6 +7,7 @@ const getStoryBaselineName = require('./getStoryBaselineName');
7
7
  const {URL} = require('url');
8
8
  const runRunAfterScript = require('../dist/runRunAfterScript');
9
9
  const waitFor = require('./waitFor');
10
+ const PAGE_EVALUATE_TIMEOUT = 120000;
10
11
 
11
12
  function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPagePerStory}) {
12
13
  return async function getStoryData({story, storyUrl, page, browser, waitBeforeStory}) {
@@ -18,8 +19,21 @@ function makeGetStoryData({logger, takeDomSnapshots, waitBeforeCapture, reloadPa
18
19
  const currentUrl = page.url();
19
20
  const expectedQueryParams = eyesParameters ? eyesParameters.queryParams : undefined;
20
21
  if (urlQueryParamsEquals(currentUrl, expectedQueryParams)) {
21
- const err = await page.evaluate(renderStoryWithClientAPI, story.index);
22
- err && handleRenderStoryError(err);
22
+ try {
23
+ const err = await ptimeoutWithError(
24
+ page.evaluate(renderStoryWithClientAPI, story.index),
25
+ PAGE_EVALUATE_TIMEOUT,
26
+ 'page evaluate timed out!',
27
+ );
28
+ logger.log(`[story data] done with page evaluate for story index: ${story.index}`);
29
+ err && handleRenderStoryError(err);
30
+ } catch (ex) {
31
+ if (!ex.message.includes('Eyes could not render stories properly'))
32
+ handleRenderStoryError(ex);
33
+ else {
34
+ throw ex;
35
+ }
36
+ }
23
37
  } else {
24
38
  await renderStoryLegacy();
25
39
  }
@@ -1,4 +1,4 @@
1
- const chalk = require('./chalkify');
1
+ const chalk = require('chalk');
2
2
  const boxen = require('boxen');
3
3
  console.log(
4
4
  boxen(
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  const flatten = require('lodash.flatten');
3
- const chalk = require('./chalkify');
3
+ const chalk = require('chalk');
4
4
  const {TestResultsError, TestResultsFormatter} = require('@applitools/eyes-sdk-core');
5
5
  const utils = require('@applitools/utils');
6
6
  const uniq = require('./uniq');
@@ -1,5 +1,3 @@
1
- const {BrowserType} = require('@applitools/eyes-sdk-core');
2
-
3
1
  function splitConfigsByBrowser(config) {
4
2
  const browsers = validateBrowsers(config);
5
3
  if (browsers.length) {
@@ -33,7 +31,7 @@ function hasIE(config) {
33
31
  }
34
32
 
35
33
  function isIE(browser) {
36
- return browser.name === BrowserType.IE_11 || browser.name === 'ie11';
34
+ return browser.name === 'ie' || browser.name === 'ie11';
37
35
  }
38
36
 
39
37
  function validateBrowsers(config) {
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- const chalk = require('./chalkify');
2
+ const chalk = require('chalk');
3
3
  const fs = require('fs');
4
4
  const detect = require('detect-port');
5
5
  const {version: packageVersion} = require('../package.json');
package/src/chalkify.js DELETED
@@ -1,4 +0,0 @@
1
- const Chalk = require('chalk').Instance;
2
- const level = Number(process.env.STDOUT_LEVEL || 2);
3
- const chalk = new Chalk({level});
4
- module.exports = chalk;