@cloudscape-design/browser-test-tools 3.0.12 → 3.0.14
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/dist/use-browser.d.ts +1 -0
- package/dist/use-browser.js +3 -2
- package/internal/manifest.json +1 -1
- package/package.json +3 -3
package/dist/use-browser.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare type BrowserOptions = {
|
|
|
5
5
|
seleniumType: string;
|
|
6
6
|
browserCreatorOptions: Record<string, any>;
|
|
7
7
|
webdriverOptions: Partial<WebDriverOptions>;
|
|
8
|
+
skipConsoleErrorsCheck: boolean;
|
|
8
9
|
};
|
|
9
10
|
interface TestFunction {
|
|
10
11
|
(browser: WebdriverIO.Browser): Promise<void> | void;
|
package/dist/use-browser.js
CHANGED
|
@@ -11,6 +11,7 @@ const options = {
|
|
|
11
11
|
seleniumType: 'local',
|
|
12
12
|
browserCreatorOptions: {},
|
|
13
13
|
webdriverOptions: {},
|
|
14
|
+
skipConsoleErrorsCheck: false,
|
|
14
15
|
};
|
|
15
16
|
function useBrowser(...args) {
|
|
16
17
|
// How to do type-safe function overloads: https://stackoverflow.com/questions/55852612/typescript-overloads-optional-arguments-and-type-inference
|
|
@@ -26,14 +27,14 @@ function useBrowser(...args) {
|
|
|
26
27
|
}
|
|
27
28
|
await testFn(browser);
|
|
28
29
|
// This method does not exist in w3c protocol
|
|
29
|
-
if ('getLogs' in browser) {
|
|
30
|
+
if (!options.skipConsoleErrorsCheck && 'getLogs' in browser) {
|
|
30
31
|
const logs = (await browser.getLogs('browser'));
|
|
31
32
|
const errors = logs.filter(entry => entry.level === 'SEVERE');
|
|
32
33
|
if (errors.length > 0) {
|
|
33
34
|
throw new Error('Unexpected errors in browser console:\n' + JSON.stringify(errors, null, 2));
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
else {
|
|
37
|
+
else if (!options.skipConsoleErrorsCheck) {
|
|
37
38
|
console.warn('Unable to check browser console, webdriver does not support this feature');
|
|
38
39
|
}
|
|
39
40
|
}
|
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"url": "https://github.com/cloudscape-design/browser-test-tools/issues"
|
|
4
4
|
},
|
|
5
5
|
"bundleDependencies": false,
|
|
6
|
-
"commit": "e2febdb",
|
|
7
6
|
"dependencies": {
|
|
8
7
|
"@types/pngjs": "^6.0.1",
|
|
9
8
|
"aws-sdk": "^2.1233.0",
|
|
@@ -37,7 +36,8 @@
|
|
|
37
36
|
"collectCoverageFrom": [
|
|
38
37
|
"src/**/*.ts",
|
|
39
38
|
"!src/browser-scripts/**",
|
|
40
|
-
"!src/page-objects/browser-scripts.ts"
|
|
39
|
+
"!src/page-objects/browser-scripts.ts",
|
|
40
|
+
"!src/chrome-launcher.ts"
|
|
41
41
|
],
|
|
42
42
|
"coverageReporters": [
|
|
43
43
|
"json-summary",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"type": "git",
|
|
61
61
|
"url": "git+https://github.com/cloudscape-design/browser-test-tools.git"
|
|
62
62
|
},
|
|
63
|
-
"version": "3.0.
|
|
63
|
+
"version": "3.0.14",
|
|
64
64
|
"license": "Apache-2.0"
|
|
65
65
|
}
|