@telefonica/acceptance-testing 5.0.0-beta3 → 5.1.0-beta1

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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  yarn add --dev jest-environment-puppeteer @telefonica/acceptance-testing
9
9
  ```
10
10
 
11
- ### 2. Setup `jest-environment-puppeteer` in your `jest.acceptance.config.js`
11
+ ### 2. Setup `jest-environment-puppeteer` in your `jest-acceptance.config.js`
12
12
 
13
13
  ```js
14
14
  module.exports = {
@@ -23,7 +23,7 @@ module.exports = {
23
23
  ### 3. Create a `jest-puppeteer.config.js` file in your repo
24
24
 
25
25
  ```js
26
- const config = require('@telefonica/acceptance-testing/jest-puppeteer-config.js');
26
+ const config = require('@telefonica/acceptance-testing/jest-puppeteer.config.js');
27
27
  module.exports = config;
28
28
  ```
29
29
 
package/dist/config.js CHANGED
@@ -9,7 +9,7 @@ const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const IS_CI = !!process.env.CI || process.argv.includes('--ci');
11
11
  const IS_DEBUG = !!process.env.ACCEPTANCE_TESTING_DEBUG || process.argv.includes('--debug');
12
- const DEFAULT_CONFIG = {
12
+ const BASE_CONFIG = {
13
13
  debug: IS_DEBUG,
14
14
  isCi: IS_CI,
15
15
  isLocal: !IS_CI,
@@ -41,10 +41,10 @@ const PACKAGE_JSON_CONFIG = (() => {
41
41
  })();
42
42
  const CONFIG = (() => {
43
43
  const config = {
44
- ...DEFAULT_CONFIG,
44
+ ...BASE_CONFIG,
45
45
  ...PACKAGE_JSON_CONFIG,
46
46
  server: {
47
- ...DEFAULT_CONFIG.server,
47
+ ...BASE_CONFIG.server,
48
48
  ...PACKAGE_JSON_CONFIG.server,
49
49
  },
50
50
  };
package/dist/index.js CHANGED
@@ -275,11 +275,15 @@ const buildQueryMethods = ({ page, element } = {}) => {
275
275
  const doc = await (0, pptr_testing_library_1.getDocument)(page ?? (0, exports.getGlobalPage)());
276
276
  const body = await doc.$('body');
277
277
  const queryArgs = [...args];
278
- if (queryName.startsWith('findBy')) {
279
- if (queryArgs.length === 1) {
278
+ if (queryName.startsWith('findBy') || queryName.startsWith('findAllBy')) {
279
+ while (queryArgs.length < 3) {
280
280
  queryArgs.push(undefined);
281
281
  }
282
- queryArgs.push({ timeout: 10000 });
282
+ // set default timeout to 10 seconds if not specified
283
+ queryArgs[2] = {
284
+ timeout: 10000,
285
+ ...(queryArgs[2] ?? {}),
286
+ };
283
287
  }
284
288
  const elementHandle = await queryFn(element ?? body, ...queryArgs);
285
289
  const newElementHandle = Object.create(elementHandle);
@@ -26,7 +26,7 @@ const getPuppeteerConfig = async () => {
26
26
  await fetch(dockerChromiumUrl);
27
27
  }
28
28
  catch (e) {
29
- const dockerComposeFile = path_1.default.join(__dirname, '/../docker-compose.yaml');
29
+ const dockerComposeFile = path_1.default.join(__dirname, '..', 'docker-compose.yaml');
30
30
  process.on('SIGINT', () => {
31
31
  process.exit(1); // this triggers the 'exit' event handler below when the process is killed with Ctrl+C
32
32
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/acceptance-testing",
3
- "version": "5.0.0-beta3",
3
+ "version": "5.1.0-beta1",
4
4
  "author": "Telefonica",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",