Skip to content

Commit

Permalink
fix(typings): scrollintoview complains scrollintoviewoptions (#4067)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Dec 12, 2023
1 parent cba856c commit 0d1d86b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
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

0 comments on commit 0d1d86b

Please sign in to comment.