From 6e36f45b06dfb9d3fa3fd43d4c56fa5cf70bf623 Mon Sep 17 00:00:00 2001 From: Yogesh Saini <97088265+Ykumar1415@users.noreply.github.com> Date: Wed, 9 Aug 2023 21:00:11 +0530 Subject: [PATCH] Fix : Add tag_filter type to NightwatchOptions interface. #3825 (#3830) --- types/index.d.ts | 2 +- types/nightwatch-options.d.ts | 7 +++++++ types/tests/index.test-d.ts | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 42b7d9a7a6..ce2c48e2da 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -567,7 +567,7 @@ export interface NightwatchAPI */ setSessionId(sessionId: string): this; - options: NightwatchTestOptions; + options: NightwatchOptions & Pick; Keys: NightwatchKeys; diff --git a/types/nightwatch-options.d.ts b/types/nightwatch-options.d.ts index 009bec0331..6ba6e8aa23 100644 --- a/types/nightwatch-options.d.ts +++ b/types/nightwatch-options.d.ts @@ -129,6 +129,7 @@ export interface NightwatchScreenshotOptions { } export interface NightwatchOptions { + /** * Location(s) where custom commands will be loaded from. */ @@ -435,6 +436,12 @@ export interface NightwatchOptions { */ skiptags?: string; + /** + * Tag(s) used/to be used during test execution. + * Can be a single tag or an array of tags. + */ + tag_filter?: string | string[]; + /** * Use xpath as the default locator strategy. */ diff --git a/types/tests/index.test-d.ts b/types/tests/index.test-d.ts index 664a7c9540..b28baa5caa 100644 --- a/types/tests/index.test-d.ts +++ b/types/tests/index.test-d.ts @@ -34,6 +34,8 @@ const testGeneral: NightwatchTests = { 'Demo test Google 1': () => { browser.registerBasicAuth('test-username', 'test-password').navigateTo('https://google.com').pause(1000); + // check types on browser.options + expectType(browser.options.tag_filter); // expect element to be present in 1000ms browser.expect.element('body').to.be.present.before(1000);