Skip to content

Commit

Permalink
Fix : Add tag_filter type to NightwatchOptions interface. #3825 (#3830)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ykumar1415 authored Aug 9, 2023
1 parent 50c9dbf commit 6e36f45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export interface NightwatchAPI
*/
setSessionId(sessionId: string): this;

options: NightwatchTestOptions;
options: NightwatchOptions & Pick<NightwatchTestOptions, "desiredCapabilities">;

Keys: NightwatchKeys;

Expand Down
7 changes: 7 additions & 0 deletions types/nightwatch-options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export interface NightwatchScreenshotOptions {
}

export interface NightwatchOptions {

/**
* Location(s) where custom commands will be loaded from.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 2 additions & 0 deletions types/tests/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | string[] | undefined>(browser.options.tag_filter);
// expect element <body> to be present in 1000ms
browser.expect.element('body').to.be.present.before(1000);

Expand Down

0 comments on commit 6e36f45

Please sign in to comment.