From 0d1d86b20165df8d010f4cf59477a67c38879d4b Mon Sep 17 00:00:00 2001 From: KobeNguyenT <7845001+kobenguyent@users.noreply.github.com> Date: Tue, 12 Dec 2023 07:04:24 +0100 Subject: [PATCH] fix(typings): scrollintoview complains scrollintoviewoptions (#4067) --- docs/helpers/Appium.md | 2 +- docs/helpers/WebDriver.md | 2 +- docs/webapi/scrollIntoView.mustache | 2 +- typings/tests/helpers/Appium.types.ts | 1 + typings/tests/helpers/AppiumTs.types.ts | 1 + typings/tests/helpers/WebDriverIO.types.ts | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/helpers/Appium.md b/docs/helpers/Appium.md index 46aaa723a..9c4bf7c8b 100644 --- a/docs/helpers/Appium.md +++ b/docs/helpers/Appium.md @@ -1171,7 +1171,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent #### Parameters - `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator. -- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17]. +- `scrollIntoViewOptions` **(ScrollIntoViewOptions | [boolean][7])** either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17]. Returns **void** automatically synchronized promise through #recorderSupported only for web testing diff --git a/docs/helpers/WebDriver.md b/docs/helpers/WebDriver.md index 3248c05c8..aa92f4abf 100644 --- a/docs/helpers/WebDriver.md +++ b/docs/helpers/WebDriver.md @@ -1639,7 +1639,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent #### Parameters - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator. -- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][33]. +- `scrollIntoViewOptions` **(ScrollIntoViewOptions | [boolean][32])** either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][33]. Returns **void** automatically synchronized promise through #recorder diff --git a/docs/webapi/scrollIntoView.mustache b/docs/webapi/scrollIntoView.mustache index 2f5181ed8..c6cc00050 100644 --- a/docs/webapi/scrollIntoView.mustache +++ b/docs/webapi/scrollIntoView.mustache @@ -7,5 +7,5 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent ``` @param {LocatorOrString} locator located by CSS|XPath|strict locator. -@param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView. +@param {ScrollIntoViewOptions|boolean} scrollIntoViewOptions either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView. @returns {void} automatically synchronized promise through #recorder diff --git a/typings/tests/helpers/Appium.types.ts b/typings/tests/helpers/Appium.types.ts index 99467fa7f..1187e0d01 100644 --- a/typings/tests/helpers/Appium.types.ts +++ b/typings/tests/helpers/Appium.types.ts @@ -84,6 +84,7 @@ appium.grabValueFromAll(str); // $ExpectType Promise appium.grabValueFrom(str); // $ExpectType Promise appium.saveScreenshot(str); // $ExpectType Promise appium.scrollIntoView(str, {}); // $ExpectType void +appium.scrollIntoView(str, true); // $ExpectType void appium.seeCheckboxIsChecked(str); // $ExpectType void appium.seeElement(str); // $ExpectType void appium.seeInField(str, str); // $ExpectType void diff --git a/typings/tests/helpers/AppiumTs.types.ts b/typings/tests/helpers/AppiumTs.types.ts index b41983925..a4a758ad8 100644 --- a/typings/tests/helpers/AppiumTs.types.ts +++ b/typings/tests/helpers/AppiumTs.types.ts @@ -84,6 +84,7 @@ appium.grabValueFromAll(str); // $ExpectType Promise appium.grabValueFrom(str); // $ExpectType Promise appium.saveScreenshot(str); // $ExpectType Promise appium.scrollIntoView(str, {}); // $ExpectType Promise +appium.scrollIntoView(str, true); // $ExpectType Promise appium.seeCheckboxIsChecked(str); // $ExpectType Promise appium.seeElement(str); // $ExpectType Promise appium.seeInField(str, str); // $ExpectType Promise diff --git a/typings/tests/helpers/WebDriverIO.types.ts b/typings/tests/helpers/WebDriverIO.types.ts index 2e44a62ae..1ff4a86e6 100644 --- a/typings/tests/helpers/WebDriverIO.types.ts +++ b/typings/tests/helpers/WebDriverIO.types.ts @@ -254,6 +254,7 @@ wd.executeAsyncScript(() => {}, {}); // $ExpectType Promise wd.scrollIntoView(); // $ExpectError wd.scrollIntoView('div'); // $ExpectError +wd.scrollIntoView('div', true); wd.scrollIntoView('div', { behavior: 'auto', block: 'center', inline: 'center' }); wd.scrollTo(); // $ExpectError