From 65ef31651ff18d69105f0c1d90598c3c5ddefea9 Mon Sep 17 00:00:00 2001 From: Priyansh Garg Date: Tue, 13 Aug 2024 01:36:12 +0530 Subject: [PATCH] Add types for new isPresent command. --- types/tests/webElement.test-d.ts | 3 ++- types/web-element.d.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/tests/webElement.test-d.ts b/types/tests/webElement.test-d.ts index 1ea74e653..1ddcc172b 100644 --- a/types/tests/webElement.test-d.ts +++ b/types/tests/webElement.test-d.ts @@ -159,6 +159,8 @@ describe('new element() api', function () { expectType>(elem.attribute('attrib-name')); expectType>(elem.getValue()); expectType>(elem.isEnabled()); + expectType>(elem.isPresent()); + expectType>(elem.isSelected()); expectType>(elem.isVisible()); expectType>(elem.isDisplayed()); @@ -192,7 +194,6 @@ describe('new element() api', function () { expectType>(elem.doubleClick()); expectType>(elem.rightClick()); expectType>(elem.waitUntil('visible', {timeout: 5000})); - expectType>(elem.isSelected()); }); test('test element assertions', async function () { diff --git a/types/web-element.d.ts b/types/web-element.d.ts index bde0cc4c1..426778068 100644 --- a/types/web-element.d.ts +++ b/types/web-element.d.ts @@ -206,12 +206,14 @@ export interface ScopedElement extends Element, PromiseLike { rightClick(): Promise; - isSelected(): ElementValue; - waitUntil(signalOrOptions: WaitUntilActions | WaitUntilOptions, waitOptions?: WaitUntilOptions): Promise; isEnabled(): ElementValue; + isPresent(): ElementValue; + + isSelected(): ElementValue; + isVisible(): ElementValue; isDisplayed(): ElementValue; }