@telefonica/acceptance-testing 5.0.0 → 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.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +1 -1
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/acceptance-testing",
3
- "version": "5.0.0",
3
+ "version": "5.1.0-beta1",
4
4
  "author": "Telefonica",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",