@cloudscape-design/browser-test-tools 3.0.48 → 3.0.50

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.
Files changed (74) hide show
  1. package/Config +23 -0
  2. package/NOTICE +2 -0
  3. package/README-cloudscape.md +21 -0
  4. package/README-open-source.md +0 -0
  5. package/browser.d.ts +2 -1
  6. package/browser.js +40 -1
  7. package/chrome-launcher.d.ts +2 -1
  8. package/chrome-launcher.js +52 -1
  9. package/internal/manifest.json +1 -1
  10. package/package.json +3 -9
  11. package/use-browser.d.ts +16 -1
  12. package/use-browser.js +50 -1
  13. package/dist/browser.d.ts +0 -2
  14. package/dist/browser.js +0 -40
  15. package/dist/chrome-launcher.d.ts +0 -2
  16. package/dist/chrome-launcher.js +0 -52
  17. package/dist/use-browser.d.ts +0 -16
  18. package/dist/use-browser.js +0 -50
  19. package/image-utils.d.ts +0 -1
  20. package/image-utils.js +0 -1
  21. package/page-objects.d.ts +0 -1
  22. package/page-objects.js +0 -1
  23. /package/{dist/browser-scripts → browser-scripts}/events-spy.d.ts +0 -0
  24. /package/{dist/browser-scripts → browser-scripts}/events-spy.js +0 -0
  25. /package/{dist/browser-scripts → browser-scripts}/index.d.ts +0 -0
  26. /package/{dist/browser-scripts → browser-scripts}/index.js +0 -0
  27. /package/{dist/browser-scripts → browser-scripts}/live-announcements.d.ts +0 -0
  28. /package/{dist/browser-scripts → browser-scripts}/live-announcements.js +0 -0
  29. /package/{dist/browser-scripts → browser-scripts}/scroll.d.ts +0 -0
  30. /package/{dist/browser-scripts → browser-scripts}/scroll.js +0 -0
  31. /package/{dist/browser-scripts → browser-scripts}/sizes.d.ts +0 -0
  32. /package/{dist/browser-scripts → browser-scripts}/sizes.js +0 -0
  33. /package/{dist/browsers → browsers}/browser-creator.d.ts +0 -0
  34. /package/{dist/browsers → browsers}/browser-creator.js +0 -0
  35. /package/{dist/browsers → browsers}/browserstack.d.ts +0 -0
  36. /package/{dist/browsers → browsers}/browserstack.js +0 -0
  37. /package/{dist/browsers → browsers}/capabilities.d.ts +0 -0
  38. /package/{dist/browsers → browsers}/capabilities.js +0 -0
  39. /package/{dist/browsers → browsers}/devicefarm-mobile.d.ts +0 -0
  40. /package/{dist/browsers → browsers}/devicefarm-mobile.js +0 -0
  41. /package/{dist/browsers → browsers}/devicefarm.d.ts +0 -0
  42. /package/{dist/browsers → browsers}/devicefarm.js +0 -0
  43. /package/{dist/browsers → browsers}/index.d.ts +0 -0
  44. /package/{dist/browsers → browsers}/index.js +0 -0
  45. /package/{dist/browsers → browsers}/local.d.ts +0 -0
  46. /package/{dist/browsers → browsers}/local.js +0 -0
  47. /package/{dist/exceptions.d.ts → exceptions.d.ts} +0 -0
  48. /package/{dist/exceptions.js → exceptions.js} +0 -0
  49. /package/{dist/image-utils → image-utils}/compare.d.ts +0 -0
  50. /package/{dist/image-utils → image-utils}/compare.js +0 -0
  51. /package/{dist/image-utils → image-utils}/crop.d.ts +0 -0
  52. /package/{dist/image-utils → image-utils}/crop.js +0 -0
  53. /package/{dist/image-utils → image-utils}/index.d.ts +0 -0
  54. /package/{dist/image-utils → image-utils}/index.js +0 -0
  55. /package/{dist/image-utils → image-utils}/merge.d.ts +0 -0
  56. /package/{dist/image-utils → image-utils}/merge.js +0 -0
  57. /package/{dist/image-utils → image-utils}/utils.d.ts +0 -0
  58. /package/{dist/image-utils → image-utils}/utils.js +0 -0
  59. /package/{dist/page-objects → page-objects}/base.d.ts +0 -0
  60. /package/{dist/page-objects → page-objects}/base.js +0 -0
  61. /package/{dist/page-objects → page-objects}/browser-scripts.d.ts +0 -0
  62. /package/{dist/page-objects → page-objects}/browser-scripts.js +0 -0
  63. /package/{dist/page-objects → page-objects}/events-spy.d.ts +0 -0
  64. /package/{dist/page-objects → page-objects}/events-spy.js +0 -0
  65. /package/{dist/page-objects → page-objects}/full-page-screenshot.d.ts +0 -0
  66. /package/{dist/page-objects → page-objects}/full-page-screenshot.js +0 -0
  67. /package/{dist/page-objects → page-objects}/index.d.ts +0 -0
  68. /package/{dist/page-objects → page-objects}/index.js +0 -0
  69. /package/{dist/page-objects → page-objects}/screenshot.d.ts +0 -0
  70. /package/{dist/page-objects → page-objects}/screenshot.js +0 -0
  71. /package/{dist/page-objects → page-objects}/types.d.ts +0 -0
  72. /package/{dist/page-objects → page-objects}/types.js +0 -0
  73. /package/{dist/page-objects → page-objects}/utils.d.ts +0 -0
  74. /package/{dist/page-objects → page-objects}/utils.js +0 -0
package/Config ADDED
@@ -0,0 +1,23 @@
1
+ package.AWS-UI-Artifacts-BrowserTestTools = {
2
+ interfaces = (3.0);
3
+
4
+ build-system = npm-pretty-much;
5
+ build-tools = {
6
+ 3.0 = {
7
+ NpmPrettyMuch = 1.1;
8
+ NodeJS = default;
9
+ };
10
+ };
11
+
12
+ dependencies = {
13
+ 3.0 = {
14
+
15
+ };
16
+ };
17
+
18
+ test-dependencies = {
19
+ 3.0 = {
20
+ AWS-UI-ReleaseTools = 3.0;
21
+ };
22
+ };
23
+ };
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ @cloudscape-design/browser-test-tools
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -0,0 +1,21 @@
1
+ ## Browser test tools for Cloudscape Design System
2
+
3
+ This package contains the source code for tools used for building and testing the React components for the [Cloudscape Design System](https://cloudscape.design/).
4
+
5
+ Cloudscape is an open source design system for building intuitive, engaging, and inclusive web cloud experiences at scale. It consists of an extensive set of guidelines to create user experiences, along with the design resources and front-end components to streamline implementation.
6
+
7
+ Cloudscape was built for and is used by [Amazon Web Services (AWS)](https://aws.amazon.com/) products and services. We created it in 2016 to improve the user experience across AWS web applications, and also to help teams implement those applications faster. Since then, we have continued enhancing the system based on customer feedback and research.
8
+
9
+ Browse the [components repository](https://github.com/cloudscape-design/components) of Cloudscape Design System.
10
+
11
+ ## Getting help
12
+
13
+ You can [create bug reports or feature requests](https://github.com/cloudscape-design/browser-test-tools/issues/new/choose), or [start a discussion](https://github.com/cloudscape-design/components/discussions) to ask a question. To minimize duplicates, we recommend that you search for existing bug reports, feature requests, or discussions before initiating a new thread.
14
+
15
+ ## Contributing
16
+
17
+ The [contribution guidelines](https://github.com/cloudscape-design/browser-test-tools/blob/main/CONTRIBUTING.md) contains information on how to contribute, as well as our support model and versioning strategy.
18
+
19
+ ## License
20
+
21
+ This project is licensed under the [Apache 2.0 License](/LICENSE).
File without changes
package/browser.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from './dist/browser';export { default } from './dist/browser';
1
+ import * as browsers from './browsers';
2
+ export default function getBrowserCreator(browserName: string | undefined, seleniumType: string, options: Record<string, any>): browsers.browserstack | browsers.devicefarm | browsers.devicefarmMobile | browsers.local;
package/browser.js CHANGED
@@ -1 +1,40 @@
1
- module.exports = require('./dist/browser');
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ // SPDX-License-Identifier: Apache-2.0
28
+ const browsers = __importStar(require("./browsers"));
29
+ const exceptions_1 = require("./exceptions");
30
+ function hasType(value) {
31
+ return value in browsers;
32
+ }
33
+ function getBrowserCreator(browserName = 'ChromeHeadless', seleniumType, options) {
34
+ if (!hasType(seleniumType)) {
35
+ throw new exceptions_1.FatalError('Incorrect selenium provider: ' + seleniumType);
36
+ }
37
+ const Creator = browsers[seleniumType];
38
+ return new Creator(browserName, options);
39
+ }
40
+ exports.default = getBrowserCreator;
@@ -1 +1,2 @@
1
- export * from './dist/chrome-launcher';export { default } from './dist/chrome-launcher';
1
+ export declare function shutdownWebdriver(): void;
2
+ export declare function startWebdriver(port?: string): Promise<void>;
@@ -1 +1,52 @@
1
- module.exports = require('./dist/chrome-launcher');
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.startWebdriver = exports.shutdownWebdriver = void 0;
7
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8
+ // SPDX-License-Identifier: Apache-2.0
9
+ const child_process_1 = require("child_process");
10
+ const exceptions_1 = require("./exceptions");
11
+ const readline_1 = __importDefault(require("readline"));
12
+ function spawnChromeDriver(port) {
13
+ const params = [`--port=${port}`, '--log-level=SEVERE', '--path=/'];
14
+ try {
15
+ (0, child_process_1.execSync)('hash chromedriver');
16
+ }
17
+ catch {
18
+ throw new exceptions_1.FatalError("Cannot find local chromedriver. Did you run 'npm i -g chromedriver'?");
19
+ }
20
+ return (0, child_process_1.spawn)('chromedriver', params);
21
+ }
22
+ let webdriverProcess;
23
+ function shutdownWebdriver() {
24
+ if (webdriverProcess) {
25
+ webdriverProcess.kill();
26
+ webdriverProcess = undefined;
27
+ }
28
+ }
29
+ exports.shutdownWebdriver = shutdownWebdriver;
30
+ function startWebdriver(port = '9515') {
31
+ return new Promise((resolve, reject) => {
32
+ webdriverProcess = spawnChromeDriver(port);
33
+ webdriverProcess.on('error', error => {
34
+ shutdownWebdriver();
35
+ reject(error);
36
+ });
37
+ webdriverProcess.on('exit', () => {
38
+ shutdownWebdriver();
39
+ reject(new Error('Webdriver process exited too early'));
40
+ });
41
+ webdriverProcess.stdout.once('data', () => resolve());
42
+ const errorReader = readline_1.default.createInterface({ input: webdriverProcess.stderr });
43
+ errorReader.on('line', (line) => {
44
+ // chromeDriver spams to the error stream on macOS
45
+ // https://bugs.chromium.org/p/chromedriver/issues/detail?id=2909
46
+ if (line.indexOf('Please call TIS/TSM in main thread!!!') === -1) {
47
+ console.error(line);
48
+ }
49
+ });
50
+ });
51
+ }
52
+ exports.startWebdriver = startWebdriver;
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "6a3d3f52021c260a08dd7f89691062f97bf477ff"
2
+ "commit": "8f919d4f58676f46b0ed4b3dbe0bfcb12e59529c"
3
3
  }
package/package.json CHANGED
@@ -17,17 +17,11 @@
17
17
  "description": "## ⚠️ This is a generated artifact package and should be treated as **READ-ONLY**.",
18
18
  "exports": {
19
19
  "./chrome-launcher": "./chrome-launcher.js",
20
- "./image-utils": "./image-utils.js",
21
- "./page-objects": "./page-objects.js",
20
+ "./image-utils": "./image-utils/index.js",
21
+ "./page-objects": "./page-objects/index.js",
22
22
  "./use-browser": "./use-browser.js",
23
23
  "./browser": "./browser.js"
24
24
  },
25
- "files": [
26
- "dist",
27
- "*.js",
28
- "*.d.ts",
29
- "internal"
30
- ],
31
25
  "homepage": "https://cloudscape.design",
32
26
  "jest": {
33
27
  "testEnvironment": "node",
@@ -64,7 +58,7 @@
64
58
  "type": "git",
65
59
  "url": "git+https://github.com/cloudscape-design/browser-test-tools.git"
66
60
  },
67
- "version": "3.0.48",
61
+ "version": "3.0.50",
68
62
  "license": "Apache-2.0",
69
63
  "scripts": {}
70
64
  }
package/use-browser.d.ts CHANGED
@@ -1 +1,16 @@
1
- export * from './dist/use-browser';export { default } from './dist/use-browser';
1
+ /// <reference types="webdriverio/async" />
2
+ import { WebDriverOptions } from './browsers/browser-creator';
3
+ type BrowserOptions = {
4
+ browserName: string;
5
+ seleniumType: string;
6
+ browserCreatorOptions: Record<string, any>;
7
+ webdriverOptions: Partial<WebDriverOptions>;
8
+ skipConsoleErrorsCheck: boolean;
9
+ };
10
+ interface TestFunction {
11
+ (browser: WebdriverIO.Browser): Promise<void> | void;
12
+ }
13
+ declare function useBrowser(optionsOverride: Partial<WebDriverOptions>, testFn: TestFunction): () => Promise<void>;
14
+ declare function useBrowser(testFn: TestFunction): () => Promise<void>;
15
+ export default useBrowser;
16
+ export declare function configure(newOptions: Partial<BrowserOptions>): void;
package/use-browser.js CHANGED
@@ -1 +1,50 @@
1
- module.exports = require('./dist/use-browser');
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.configure = void 0;
7
+ const browser_1 = __importDefault(require("./browser"));
8
+ const merge_1 = __importDefault(require("lodash/merge"));
9
+ const options = {
10
+ browserName: 'ChromeHeadless',
11
+ seleniumType: 'local',
12
+ browserCreatorOptions: {},
13
+ webdriverOptions: {},
14
+ skipConsoleErrorsCheck: false,
15
+ };
16
+ function useBrowser(...args) {
17
+ // How to do type-safe function overloads: https://stackoverflow.com/questions/55852612/typescript-overloads-optional-arguments-and-type-inference
18
+ const optionsOverride = args.length === 1 ? {} : args[0];
19
+ const testFn = args.length === 1 ? args[0] : args[1];
20
+ return async () => {
21
+ const creator = (0, browser_1.default)(options.browserName, options.seleniumType, options.browserCreatorOptions);
22
+ const browser = await creator.getBrowser({ ...options.webdriverOptions, ...optionsOverride });
23
+ try {
24
+ if ('getLogs' in browser) {
25
+ // dispose logs from previous sessions, if there are any
26
+ await browser.getLogs('browser');
27
+ }
28
+ await testFn(browser);
29
+ // This method does not exist in w3c protocol
30
+ if (!options.skipConsoleErrorsCheck && 'getLogs' in browser) {
31
+ const logs = (await browser.getLogs('browser'));
32
+ const errors = logs.filter(entry => entry.level === 'SEVERE');
33
+ if (errors.length > 0) {
34
+ throw new Error('Unexpected errors in browser console:\n' + JSON.stringify(errors, null, 2));
35
+ }
36
+ }
37
+ else if (!options.skipConsoleErrorsCheck) {
38
+ console.warn('Unable to check browser console, webdriver does not support this feature');
39
+ }
40
+ }
41
+ finally {
42
+ await browser.deleteSession();
43
+ }
44
+ };
45
+ }
46
+ exports.default = useBrowser;
47
+ function configure(newOptions) {
48
+ (0, merge_1.default)(options, newOptions);
49
+ }
50
+ exports.configure = configure;
package/dist/browser.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import * as browsers from './browsers';
2
- export default function getBrowserCreator(browserName: string | undefined, seleniumType: string, options: Record<string, any>): browsers.browserstack | browsers.devicefarm | browsers.devicefarmMobile | browsers.local;
package/dist/browser.js DELETED
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
- // SPDX-License-Identifier: Apache-2.0
28
- const browsers = __importStar(require("./browsers"));
29
- const exceptions_1 = require("./exceptions");
30
- function hasType(value) {
31
- return value in browsers;
32
- }
33
- function getBrowserCreator(browserName = 'ChromeHeadless', seleniumType, options) {
34
- if (!hasType(seleniumType)) {
35
- throw new exceptions_1.FatalError('Incorrect selenium provider: ' + seleniumType);
36
- }
37
- const Creator = browsers[seleniumType];
38
- return new Creator(browserName, options);
39
- }
40
- exports.default = getBrowserCreator;
@@ -1,2 +0,0 @@
1
- export declare function shutdownWebdriver(): void;
2
- export declare function startWebdriver(port?: string): Promise<void>;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startWebdriver = exports.shutdownWebdriver = void 0;
7
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8
- // SPDX-License-Identifier: Apache-2.0
9
- const child_process_1 = require("child_process");
10
- const exceptions_1 = require("./exceptions");
11
- const readline_1 = __importDefault(require("readline"));
12
- function spawnChromeDriver(port) {
13
- const params = [`--port=${port}`, '--log-level=SEVERE', '--path=/'];
14
- try {
15
- (0, child_process_1.execSync)('hash chromedriver');
16
- }
17
- catch {
18
- throw new exceptions_1.FatalError("Cannot find local chromedriver. Did you run 'npm i -g chromedriver'?");
19
- }
20
- return (0, child_process_1.spawn)('chromedriver', params);
21
- }
22
- let webdriverProcess;
23
- function shutdownWebdriver() {
24
- if (webdriverProcess) {
25
- webdriverProcess.kill();
26
- webdriverProcess = undefined;
27
- }
28
- }
29
- exports.shutdownWebdriver = shutdownWebdriver;
30
- function startWebdriver(port = '9515') {
31
- return new Promise((resolve, reject) => {
32
- webdriverProcess = spawnChromeDriver(port);
33
- webdriverProcess.on('error', error => {
34
- shutdownWebdriver();
35
- reject(error);
36
- });
37
- webdriverProcess.on('exit', () => {
38
- shutdownWebdriver();
39
- reject(new Error('Webdriver process exited too early'));
40
- });
41
- webdriverProcess.stdout.once('data', () => resolve());
42
- const errorReader = readline_1.default.createInterface({ input: webdriverProcess.stderr });
43
- errorReader.on('line', (line) => {
44
- // chromeDriver spams to the error stream on macOS
45
- // https://bugs.chromium.org/p/chromedriver/issues/detail?id=2909
46
- if (line.indexOf('Please call TIS/TSM in main thread!!!') === -1) {
47
- console.error(line);
48
- }
49
- });
50
- });
51
- }
52
- exports.startWebdriver = startWebdriver;
@@ -1,16 +0,0 @@
1
- /// <reference types="webdriverio/async" />
2
- import { WebDriverOptions } from './browsers/browser-creator';
3
- type BrowserOptions = {
4
- browserName: string;
5
- seleniumType: string;
6
- browserCreatorOptions: Record<string, any>;
7
- webdriverOptions: Partial<WebDriverOptions>;
8
- skipConsoleErrorsCheck: boolean;
9
- };
10
- interface TestFunction {
11
- (browser: WebdriverIO.Browser): Promise<void> | void;
12
- }
13
- declare function useBrowser(optionsOverride: Partial<WebDriverOptions>, testFn: TestFunction): () => Promise<void>;
14
- declare function useBrowser(testFn: TestFunction): () => Promise<void>;
15
- export default useBrowser;
16
- export declare function configure(newOptions: Partial<BrowserOptions>): void;
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.configure = void 0;
7
- const browser_1 = __importDefault(require("./browser"));
8
- const merge_1 = __importDefault(require("lodash/merge"));
9
- const options = {
10
- browserName: 'ChromeHeadless',
11
- seleniumType: 'local',
12
- browserCreatorOptions: {},
13
- webdriverOptions: {},
14
- skipConsoleErrorsCheck: false,
15
- };
16
- function useBrowser(...args) {
17
- // How to do type-safe function overloads: https://stackoverflow.com/questions/55852612/typescript-overloads-optional-arguments-and-type-inference
18
- const optionsOverride = args.length === 1 ? {} : args[0];
19
- const testFn = args.length === 1 ? args[0] : args[1];
20
- return async () => {
21
- const creator = (0, browser_1.default)(options.browserName, options.seleniumType, options.browserCreatorOptions);
22
- const browser = await creator.getBrowser({ ...options.webdriverOptions, ...optionsOverride });
23
- try {
24
- if ('getLogs' in browser) {
25
- // dispose logs from previous sessions, if there are any
26
- await browser.getLogs('browser');
27
- }
28
- await testFn(browser);
29
- // This method does not exist in w3c protocol
30
- if (!options.skipConsoleErrorsCheck && 'getLogs' in browser) {
31
- const logs = (await browser.getLogs('browser'));
32
- const errors = logs.filter(entry => entry.level === 'SEVERE');
33
- if (errors.length > 0) {
34
- throw new Error('Unexpected errors in browser console:\n' + JSON.stringify(errors, null, 2));
35
- }
36
- }
37
- else if (!options.skipConsoleErrorsCheck) {
38
- console.warn('Unable to check browser console, webdriver does not support this feature');
39
- }
40
- }
41
- finally {
42
- await browser.deleteSession();
43
- }
44
- };
45
- }
46
- exports.default = useBrowser;
47
- function configure(newOptions) {
48
- (0, merge_1.default)(options, newOptions);
49
- }
50
- exports.configure = configure;
package/image-utils.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './dist/image-utils';export { default } from './dist/image-utils';
package/image-utils.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/image-utils');
package/page-objects.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './dist/page-objects';export { default } from './dist/page-objects';
package/page-objects.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/page-objects');
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes