Skip to content

Commit

Permalink
Add types for new isPresent command.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Aug 12, 2024
1 parent 3a83dda commit 65ef316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion types/tests/webElement.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ describe('new element() api', function () {
expectType<ElementValue<string | null>>(elem.attribute('attrib-name'));
expectType<ElementValue<string | null>>(elem.getValue());
expectType<ElementValue<boolean>>(elem.isEnabled());
expectType<ElementValue<boolean>>(elem.isPresent());
expectType<ElementValue<boolean>>(elem.isSelected());
expectType<ElementValue<boolean>>(elem.isVisible());
expectType<ElementValue<boolean>>(elem.isDisplayed());

Expand Down Expand Up @@ -192,7 +194,6 @@ describe('new element() api', function () {
expectType<Promise<WebElement>>(elem.doubleClick());
expectType<Promise<WebElement>>(elem.rightClick());
expectType<Promise<WebElement>>(elem.waitUntil('visible', {timeout: 5000}));
expectType<ElementValue<boolean>>(elem.isSelected());
});

test('test element assertions', async function () {
Expand Down
6 changes: 4 additions & 2 deletions types/web-element.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,14 @@ export interface ScopedElement extends Element, PromiseLike<WebElement> {

rightClick(): Promise<WebElement>;

isSelected(): ElementValue<boolean>;

waitUntil(signalOrOptions: WaitUntilActions | WaitUntilOptions, waitOptions?: WaitUntilOptions): Promise<WebElement>;

isEnabled(): ElementValue<boolean>;

isPresent(): ElementValue<boolean>;

isSelected(): ElementValue<boolean>;

isVisible(): ElementValue<boolean>;
isDisplayed(): ElementValue<boolean>;
}
Expand Down

0 comments on commit 65ef316

Please sign in to comment.