@cloudscape-design/browser-test-tools 3.0.67 → 3.0.69

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.
@@ -58,7 +58,7 @@ const defaultCapabilities = {
58
58
  '--prerender-from-omnibox=disabled',
59
59
  '--no-sandbox',
60
60
  '--disable-gpu',
61
- '--headless=old',
61
+ '--headless=new',
62
62
  ],
63
63
  },
64
64
  },
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "3c27710c560a6b31b68af7f34aa042ed7473f51b"
2
+ "commit": "97adc656828992ce3a0041324eb6c3b2af1de8b5"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/browser-test-tools",
3
- "version": "3.0.67",
3
+ "version": "3.0.69",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/browser-test-tools.git"
package/use-browser.js CHANGED
@@ -13,6 +13,14 @@ const options = {
13
13
  webdriverOptions: {},
14
14
  skipConsoleErrorsCheck: false,
15
15
  };
16
+ // The errors like { "level": "SEVERE", "source": "network", "message": "http://localhost:8080/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)" }
17
+ // originate in Chromium when using new headless mode. We ignore them as non-severe.
18
+ function isFaviconError(error) {
19
+ const testMessages = ['favicon.ico - Failed to load resource', 'favicon.svg - Failed to load resource'];
20
+ const isNetworkError = 'source' in error && error.source === 'network';
21
+ const message = 'message' in error && typeof error.message === 'string' ? error.message : '';
22
+ return isNetworkError && testMessages.some(test => message.includes(test));
23
+ }
16
24
  function useBrowser(...args) {
17
25
  // How to do type-safe function overloads: https://stackoverflow.com/questions/55852612/typescript-overloads-optional-arguments-and-type-inference
18
26
  const optionsOverride = args.length === 1 ? {} : args[0];
@@ -29,7 +37,7 @@ function useBrowser(...args) {
29
37
  // This method does not exist in w3c protocol
30
38
  if (!options.skipConsoleErrorsCheck && 'getLogs' in browser) {
31
39
  const logs = (await browser.getLogs('browser'));
32
- const errors = logs.filter(entry => entry.level === 'SEVERE');
40
+ const errors = logs.filter(entry => entry.level === 'SEVERE' && !isFaviconError(entry));
33
41
  if (errors.length > 0) {
34
42
  throw new Error('Unexpected errors in browser console:\n' + JSON.stringify(errors, null, 2));
35
43
  }