@enact/ui-test-utils 2.0.0-alpha.1 → 2.0.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/ui-test-utils",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "UI Testing for the Enact framework",
5
5
  "repository": "https://github.com/enactjs/ui-test-utils",
6
6
  "main": "index.js",
@@ -20,32 +20,33 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@wdio/cli": "^7.36.0",
24
- "@wdio/dot-reporter": "^7.33.0",
25
- "@wdio/local-runner": "^7.36.0",
26
- "@wdio/mocha-framework": "^7.33.0",
27
- "@wdio/selenium-standalone-service": "^7.33.0",
28
- "@wdio/spec-reporter": "^7.33.0",
29
- "@wdio/static-server-service": "^7.33.0",
30
- "chalk": "^5.3.0",
23
+ "@wdio/cli": "^9.10.0",
24
+ "@wdio/dot-reporter": "^9.9.0",
25
+ "@wdio/local-runner": "9.2.1",
26
+ "@wdio/mocha-framework": "^9.9.0",
27
+ "@wdio/spec-reporter": "^9.9.0",
28
+ "@wdio/static-server-service": "^9.9.0",
29
+ "@wdio/visual-service": "^6.3.2",
30
+ "chalk": "^5.4.1",
31
31
  "cross-spawn": "^7.0.6",
32
- "expect-webdriverio": "^3.6.0",
33
- "fs-extra": "^11.2.0",
32
+ "expect-webdriverio": "^5.1.0",
33
+ "fs-extra": "^11.3.0",
34
34
  "minimist": "^1.2.8",
35
35
  "query-string": "^7.1.3",
36
36
  "ramda": "^0.30.1",
37
37
  "readdirp": "^3.6.0",
38
38
  "wdio-docker-service": "^3.2.1",
39
- "wdio-image-comparison-service": "^5.0.3",
40
- "webdriverio": "^7.36.0"
39
+ "wdio-selenium-standalone-service": "^0.0.12",
40
+ "webdriverio": "^9.10.0"
41
41
  },
42
42
  "devDependencies": {
43
- "eslint": "^9.20.0",
43
+ "eslint": "^9.21.0",
44
44
  "eslint-config-enact": "^5.0.0-alpha.5",
45
45
  "globals": "^15.14.0"
46
46
  },
47
47
  "overrides": {
48
48
  "cross-spawn": "$cross-spawn",
49
+ "express": "^4.21.2",
49
50
  "ws": "^8.18.0"
50
51
  }
51
52
  }
@@ -67,6 +67,14 @@ function beforeTest (testData) {
67
67
  if (testData && testData.title && testData.title.indexOf('/') > 0) {
68
68
  const filename = generateReferenceName({test: testData});
69
69
  testData.ctx.isNewScreenshot = !fs.existsSync(filename);
70
+
71
+ // if there are no reference screenshots, we must create the folder before running the tests.
72
+ const specsPath = testData.title.split('~/');
73
+ specsPath.pop();
74
+ const referenceSpecsPath = path.join('tests/screenshot/dist/screenshots/reference', ...specsPath).replace(/ /g, '_');
75
+ if (testData.ctx.isNewScreenshot) {
76
+ fs.mkdirSync(referenceSpecsPath, {recursive: true});
77
+ }
70
78
  }
71
79
  }
72
80
 
@@ -4,12 +4,13 @@ const {afterTest, baselineFolder, beforeTest, onComplete, onPrepare, screenshotF
4
4
  exports.config = configure({
5
5
  base: 'screenshot',
6
6
  services: [[
7
- 'image-comparison',
7
+ 'visual',
8
8
  {
9
9
  baselineFolder: baselineFolder,
10
10
  formatImageName: '{tag}',
11
11
  screenshotPath: screenshotFolder,
12
- autoSaveBaseline: true
12
+ autoSaveBaseline: true,
13
+ waitForFontsLoaded: true
13
14
  }
14
15
  ]],
15
16
  //
@@ -33,10 +33,15 @@ exports.config = Object.assign(
33
33
  maxInstances: 1,
34
34
  //
35
35
  browserName: 'chrome',
36
+ /* WebdriverIO v8.14 and above downloads and uses the latest Chrome version when running tests.
37
+ We need to specify a browser version that match chromedriver version running in CI/CD environment to
38
+ ensure testing accuracy.
39
+ TODO: Update this version when chromedriver version in CI/CD is updated */
40
+ browserVersion: '120.0.6099.109',
36
41
  'goog:chromeOptions': {
37
- w3c: false,
38
42
  debuggerAddress: `${process.env.TV_IP}:9998`
39
- }
43
+ },
44
+ 'wdio:enforceWebDriverClassic': true
40
45
  }],
41
46
 
42
47
  //
@@ -9,10 +9,15 @@ exports.config = Object.assign(
9
9
  maxInstances: 1,
10
10
 
11
11
  browserName: 'chrome',
12
+ /* WebdriverIO v8.14 and above downloads and uses the latest Chrome version when running tests.
13
+ We need to specify a browser version that match chromedriver version running in CI/CD environment to
14
+ ensure testing accuracy.
15
+ TODO: Update this version when chromedriver version in CI/CD is updated */
16
+ browserVersion: '120.0.6099.109',
12
17
  'goog:chromeOptions': {
13
- w3c: false,
14
18
  debuggerAddress: `${process.env.TV_IP}:9998`
15
- }
19
+ },
20
+ 'wdio:enforceWebDriverClassic': true
16
21
  }],
17
22
 
18
23
  baseUrl: `http://${ipAddress()}:4567`,
package/utils/runTest.js CHANGED
@@ -66,7 +66,8 @@ const runTest = ({concurrency, filter, Page, testName, ...rest}) => {
66
66
  expect(await browser.checkScreen(screenshotFileName, {
67
67
  disableCSSAnimation: true,
68
68
  ignoreNothing: true,
69
- rawMisMatchPercentage: true
69
+ rawMisMatchPercentage: true,
70
+ waitForFontsLoaded: true
70
71
  })).toBe(0);
71
72
  });
72
73
  });