Nightwatch: Feature Request : Support for Test tags in BDD style in nightwatch

Created on 21 Jul 2020  路  5Comments  路  Source: nightwatchjs/nightwatch

Is your feature request related to a problem? Please describe.
I am writing my night-watch test in BDD Style. using 'describe' and 'it' blocks. I also have to select specific test and run on specific environment. In order to select specific test, using Test Tags is the better option. Unfortunately I don't see the support for the Test Tags in BDD style tests. Please note , i cannot use grouping here . its because 'describe' block can have many 'it' blocks and each 'it' blocks represents separate test cases.

Describe the solution you'd like
Providing the support of Test Tags in BDD Style will be really helpful to run selective tests.

Describe how the solution will work
I will be able to select specific tests to run the test.

Describe alternatives you've considered
I have considered running the test as group. but i cannot use grouping here . its because 'describe' block can have many 'it' blocks and each 'it' blocks represents separate test cases.

stale

Most helpful comment

You can simply define a tags property inside the main describe block. E.g.:

describe('testsuite', function() {
  this.tags = ['some-tag'];

  it('the testcase', function(browser) {

  });
});

All 5 comments

You can simply define a tags property inside the main describe block. E.g.:

describe('testsuite', function() {
  this.tags = ['some-tag'];

  it('the testcase', function(browser) {

  });
});

Is that possible to define the tags in 'it' block level , because a describe can have many 'it' blocks . which represents separate tests. In that case, how do we run selective tests ?

@s-kugan I approach this by writing one testcase per file, that way tags can be used to run or skip certain files

@zwbetz-gh yes. that was my last thought as well. if we cannot define test tags in 'it' blocks level.

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pieras2 picture Pieras2  路  3Comments

bushev picture bushev  路  4Comments

manjero picture manjero  路  4Comments

lgaticaq picture lgaticaq  路  3Comments

danielbentov picture danielbentov  路  4Comments