diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index 52449e075..54a28ac20 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -613,7 +613,7 @@ If a function returns a Promise it will wait for its resolution. #### Parameters - `fn` **([string][7] | [function][9])** function to be executed in browser context. -- `arg` **...any** to be passed to function. +- `arg` **...any?** to be passed to function. Returns **[Promise][10]<any>** diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index 231581ef1..d2846a7eb 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -1472,10 +1472,13 @@ class Playwright extends Helper { /** * Executes a script on the page: + * * ```js * I.executeScript(() => window.alert('Hello world')); * ``` + * * Additional parameters of the function can be passed as an object argument: + * * ```js * I.executeScript(({x, y}) => x + y, {x, y}); * ``` @@ -1488,7 +1491,7 @@ class Playwright extends Helper { * If a function returns a Promise it will wait for its resolution. * * @param {string|function} fn function to be executed in browser context. - * @param {...any} arg to be passed to function. + * @param {...any} [arg] to be passed to function. * @return {Promise} */ async executeScript(fn, arg) {