From 83274bc491c08d29049e0f81dc6db03ec4b55224 Mon Sep 17 00:00:00 2001 From: Hanna Becker Date: Mon, 24 Feb 2020 13:56:54 +0100 Subject: [PATCH 1/2] add missing JSDoc parameter for seeInPopup method, update documentation --- docs/helpers/Playwright.md | 2 +- docs/helpers/Protractor.md | 2 +- docs/helpers/Puppeteer.md | 2 +- lib/helper/Playwright.js | 1 + lib/helper/Protractor.js | 1 + lib/helper/Puppeteer.js | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index 760427220..b793d5bc3 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -1269,7 +1269,7 @@ given string. #### Parameters -- `text` +- `text` **[string][7]** value to check. ### seeInSource diff --git a/docs/helpers/Protractor.md b/docs/helpers/Protractor.md index c26d85b7e..c02eb82b2 100644 --- a/docs/helpers/Protractor.md +++ b/docs/helpers/Protractor.md @@ -1096,7 +1096,7 @@ given string. #### Parameters -- `text` +- `text` **[string][9]** value to check. ### seeInSource diff --git a/docs/helpers/Puppeteer.md b/docs/helpers/Puppeteer.md index 1a7fb8df8..2f7a0085f 100644 --- a/docs/helpers/Puppeteer.md +++ b/docs/helpers/Puppeteer.md @@ -1368,7 +1368,7 @@ given string. #### Parameters -- `text` +- `text` **[string][8]** value to check. ### seeInSource diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index cc1208c49..289da4c9e 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -392,6 +392,7 @@ class Playwright extends Helper { /** * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the * given string. + * @param {string} text value to check. */ async seeInPopup(text) { popupStore.assertPopupVisible(); diff --git a/lib/helper/Protractor.js b/lib/helper/Protractor.js index 950697cdd..3006bf381 100644 --- a/lib/helper/Protractor.js +++ b/lib/helper/Protractor.js @@ -1056,6 +1056,7 @@ class Protractor extends Helper { /** * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the * given string. + * @param {string} text value to check. */ async seeInPopup(text) { const popupAlert = await this.browser.switchTo().alert(); diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index 116fc3239..edcfec4fd 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -363,6 +363,7 @@ class Puppeteer extends Helper { /** * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the * given string. + * @param {string} text value to check. */ async seeInPopup(text) { popupStore.assertPopupVisible(); From eb44ce769a76e3d97ffeddc85a81f8da29064523 Mon Sep 17 00:00:00 2001 From: Hanna Becker Date: Mon, 24 Feb 2020 18:17:23 +0100 Subject: [PATCH 2/2] refactor duplicated JSDoc of seeInSource method to mustache file --- docs/helpers/Playwright.md | 4 ++++ docs/helpers/Protractor.md | 4 ++++ docs/helpers/Puppeteer.md | 4 ++++ docs/webapi/seeInPopup.mustache | 7 +++++++ lib/helper/Playwright.js | 4 +--- lib/helper/Protractor.js | 4 +--- lib/helper/Puppeteer.js | 4 +--- 7 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 docs/webapi/seeInPopup.mustache diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index b793d5bc3..ca29134be 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -1267,6 +1267,10 @@ I.seeInField('#searchform input','Search'); Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the given string. +```js +I.seeInPopup('Popup text'); +``` + #### Parameters - `text` **[string][7]** value to check. diff --git a/docs/helpers/Protractor.md b/docs/helpers/Protractor.md index c02eb82b2..fe0bb3544 100644 --- a/docs/helpers/Protractor.md +++ b/docs/helpers/Protractor.md @@ -1094,6 +1094,10 @@ I.seeInField('#searchform input','Search'); Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the given string. +```js +I.seeInPopup('Popup text'); +``` + #### Parameters - `text` **[string][9]** value to check. diff --git a/docs/helpers/Puppeteer.md b/docs/helpers/Puppeteer.md index 2f7a0085f..c0d60459c 100644 --- a/docs/helpers/Puppeteer.md +++ b/docs/helpers/Puppeteer.md @@ -1366,6 +1366,10 @@ I.seeInField('#searchform input','Search'); Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the given string. +```js +I.seeInPopup('Popup text'); +``` + #### Parameters - `text` **[string][8]** value to check. diff --git a/docs/webapi/seeInPopup.mustache b/docs/webapi/seeInPopup.mustache new file mode 100644 index 000000000..55b657bc7 --- /dev/null +++ b/docs/webapi/seeInPopup.mustache @@ -0,0 +1,7 @@ +Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the +given string. + +```js +I.seeInPopup('Popup text'); +``` +@param {string} text value to check. diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index 289da4c9e..04bed1122 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -390,9 +390,7 @@ class Playwright extends Helper { } /** - * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the - * given string. - * @param {string} text value to check. + * {{> seeInPopup }} */ async seeInPopup(text) { popupStore.assertPopupVisible(); diff --git a/lib/helper/Protractor.js b/lib/helper/Protractor.js index 3006bf381..5492be1a6 100644 --- a/lib/helper/Protractor.js +++ b/lib/helper/Protractor.js @@ -1054,9 +1054,7 @@ class Protractor extends Helper { } /** - * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the - * given string. - * @param {string} text value to check. + * {{> seeInPopup }} */ async seeInPopup(text) { const popupAlert = await this.browser.switchTo().alert(); diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index edcfec4fd..e879b60dc 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -361,9 +361,7 @@ class Puppeteer extends Helper { } /** - * Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the - * given string. - * @param {string} text value to check. + * {{> seeInPopup }} */ async seeInPopup(text) { popupStore.assertPopupVisible();