Skip to content

fix(typings): scrollintoview complains scrollintoviewoptions #4067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/helpers/Appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/helpers/WebDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/webapi/scrollIntoView.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions typings/tests/helpers/Appium.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ appium.grabValueFromAll(str); // $ExpectType Promise<string[]>
appium.grabValueFrom(str); // $ExpectType Promise<string>
appium.saveScreenshot(str); // $ExpectType Promise<void>
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
Expand Down
1 change: 1 addition & 0 deletions typings/tests/helpers/AppiumTs.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ appium.grabValueFromAll(str); // $ExpectType Promise<string[]>
appium.grabValueFrom(str); // $ExpectType Promise<string>
appium.saveScreenshot(str); // $ExpectType Promise<void>
appium.scrollIntoView(str, {}); // $ExpectType Promise<any>
appium.scrollIntoView(str, true); // $ExpectType Promise<any>
appium.seeCheckboxIsChecked(str); // $ExpectType Promise<any>
appium.seeElement(str); // $ExpectType Promise<any>
appium.seeInField(str, str); // $ExpectType Promise<any>
Expand Down
1 change: 1 addition & 0 deletions typings/tests/helpers/WebDriverIO.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ wd.executeAsyncScript(() => {}, {}); // $ExpectType Promise<any>

wd.scrollIntoView(); // $ExpectError
wd.scrollIntoView('div'); // $ExpectError
wd.scrollIntoView('div', true);
wd.scrollIntoView('div', { behavior: 'auto', block: 'center', inline: 'center' });

wd.scrollTo(); // $ExpectError
Expand Down