Skip to content

Commit

Permalink
Fix #2417 --filter being ignored when --skiptags is set (#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
aedm committed May 30, 2020
1 parent a62b4eb commit 25c26f9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/runner/folder-walk.js
Expand Up @@ -105,11 +105,11 @@ class Walker {
let filename = filePath.split(path.sep).slice(-1)[0];

if (this.settings.filename_filter) {
matched = minimatch(filename, this.settings.filename_filter);
matched = matched && minimatch(filename, this.settings.filename_filter);
}

if (this.tags.anyTagsDefined()) {
matched = this.tags.match(filePath);
matched = matched && this.tags.match(filePath);
}

return matched;
Expand Down
32 changes: 30 additions & 2 deletions test/src/runner/testRunWithTags.js
Expand Up @@ -98,16 +98,44 @@ describe('testRunWithTags', function() {
globals: {
reporter(results) {
assert.ok('demoTagTest' in results.modules['tags/sample'].completed);
assert.strictEqual(Object.keys(results.modules).length, 1);
}
},
filter: 'tags/*',
tag_filter: ['login'],
filter: '**/tags/*',
tag_filter: ['other'],
output_folder: false,
};

return NightwatchClient.runTests(testsPath, settings);
});

it('testRunWithSkipTagsAndFilterNotEmpty', function() {
let testsPath = path.join(__dirname, '../../sampletests');

let settings = {
selenium: {
port: 10195,
version2: true,
start_process: true
},
silent: true,
output: false,
globals: {
reporter(results) {
assert.ok('demoTagTest' in results.modules['tags/sample'].completed);
assert.strictEqual(Object.keys(results.modules).length, 1);
}
},
filter: '**/tags/*',
output_folder: false,
};

return NightwatchClient.runTests({
_source: [testsPath],
skiptags: ['logout']
}, settings);
});

it('testRunWithTagsAndSkipTags', function() {
let testsPath = path.join(__dirname, '../../sampletests');

Expand Down

0 comments on commit 25c26f9

Please sign in to comment.