Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : Add tag_filter type to NightwatchOptions interface. #3825 #3830

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading