From 698701c71679c92a8240b4e6d79bea791a0ad485 Mon Sep 17 00:00:00 2001 From: EgorBodnar Date: Fri, 21 Apr 2023 20:52:00 +0800 Subject: [PATCH] chore: bringing the name of options to a general form --- docs/helpers/Playwright.md | 4 ++-- lib/helper/Playwright.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index c892c90f3..b94372fa1 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -489,7 +489,7 @@ I.click({css: 'nav a.login'}); - `locator` **([string][8] | [object][5])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. - `context` **([string][8]? | [object][5] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. ⚠️ returns a _promise_ which is synchronized internally by recorder -- `opts` **any?** [Additional options][10] for click available as 3rd argument.Examples:```js +- `options` **any?** [Additional options][10] for click available as 3rd argument.Examples:```js // click on element at position I.click('canvas', '.model', { position: { x: 20, y: 40 } }) @@ -1994,7 +1994,7 @@ See [Playwright's reference][31] #### Parameters -- `opts` **any** +- `options` **any** ### waitForRequest diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index fbb24ed9d..6e126ad2f 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -1282,7 +1282,7 @@ class Playwright extends Helper { /** * {{> click }} * - * @param {any} [opts] [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument. + * @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument. * * Examples: * @@ -1295,8 +1295,8 @@ class Playwright extends Helper { * ``` * */ - async click(locator, context = null, opts = {}) { - return proceedClick.call(this, locator, context, opts); + async click(locator, context = null, options = {}) { + return proceedClick.call(this, locator, context, options); } /** @@ -2448,15 +2448,15 @@ class Playwright extends Helper { * * See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions) * - * @param {*} opts + * @param {*} options */ - async waitForNavigation(opts = {}) { - opts = { + async waitForNavigation(options = {}) { + options = { timeout: this.options.getPageTimeout, waitUntil: this.options.waitForNavigation, - ...opts, + ...options, }; - return this.page.waitForNavigation(opts); + return this.page.waitForNavigation(options); } async waitUntilExists(locator, sec) {