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

When setting 'exclude' as an array of pattern values only the last value processed is considered #1865

Closed
DaJoTo opened this issue Aug 9, 2018 · 2 comments · Fixed by #1866

Comments

@DaJoTo
Copy link
Contributor

DaJoTo commented Aug 9, 2018

This appears to be a bug with Beta version 1.0.8 of Nightwatch.js

Consider the following test suite directory:

  • group1
    • subGroupA
      • test1.js
      • test2.js
    • subGroupB
      • test1.js
      • test2.js
    • subGroupC
      • test1.js
      • test2.js
  • group2
    • subGroupA
      • test1.js
      • test2.js
    • subGroupB
      • test1.js
      • test2.js
    • subGroupC
      • test1.js
      • test2.js

Now consider the default environment using the matches

const jar = require('selenium-server-standalone-jar');

module.exports = {
    src_folders: 'tests',
    output_folder: 'output',
    globals_path: 'globals.js',
    selenium: {
        start_process: true,
        server_path: jar.path,
        log_path: '',
        cli_args: {
            'webdriver.chrome.driver': 'node_modules/.bin/chromedriver',
            'webdriver.gecko.driver': 'node_modules/.bin/geckodriver',
        },
    },
    test_settings: {
        default: {
            launch_url: 'http://localhost:8069',
            desiredCapabilities: {
                browserName: 'firefox',
            },
            exclude: [
                'group1/subGroupA/test2.js',
                'group1/subGroupB/test1.js',
            ],
        },
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome',
            },
        },
    },
};

When running the tests you will find that test group1/subGroupA/test2.js will still be run because matches is evaluated per iteration of the exclude patterns. Meaning while it was true for the first iteration, the second (last) was false.

@beatfactor
Copy link
Member

Can you also include your nightwatch config? Thanks.

@DaJoTo
Copy link
Contributor Author

DaJoTo commented Aug 13, 2018

@beatfactor I've updated with a config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants