parent
7087238e9f
commit
0c77bb1791
4 changed files with 33 additions and 3 deletions
|
|
@ -222,7 +222,7 @@ export function generateSkipTagsFromCapabilities(capabilities: Capabilities.Reso
|
|||
.find((filter: WebdriverIO.Capabilities) => Object.keys(filter)
|
||||
.every((key: keyof WebdriverIO.Capabilities) => match((capabilities as Record<string, string>)[key], filter[key] as RegExp)))
|
||||
if (isSkip) {
|
||||
generatedTags.push(`(not ${tag.replace(/[()[\]{}^$*+?.|\\]/g, '\\$&')})`)
|
||||
generatedTags.push(`(not ${tag.replace(/[(){}^$*+?.|\\]/g, '\\$&')})`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ Feature: Test Feature
|
|||
When a step passes
|
||||
|
||||
@skip(browserName="chrome")
|
||||
@skip(browserName=["firefox","safari"])
|
||||
Scenario: Scenario #1
|
||||
Given a step passes
|
||||
When a step passes
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Feature: Example feature
|
|||
Then I should fail once but pass on the second run
|
||||
|
||||
@skip(browserName="chrome")
|
||||
@skip(browserName=["firefox","safari"])
|
||||
Scenario: Skipped... should never be executed
|
||||
Then this test should fail
|
||||
|
||||
|
|
|
|||
|
|
@ -482,6 +482,33 @@ const cucumberFileOption = async () => {
|
|||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Cucumber @skip() tag
|
||||
*/
|
||||
const cucumberSkipTag = async () => {
|
||||
for (const browserName of ['chrome', 'firefox']) {
|
||||
const { skippedSpecs } = await launch(
|
||||
'cucumberTestrunner',
|
||||
path.resolve(__dirname, 'helpers', 'cucumber-hooks.conf.js'),
|
||||
{
|
||||
capabilities: [{ browserName }],
|
||||
specs: [
|
||||
path.resolve(__dirname, 'cucumber', 'test.feature'),
|
||||
path.resolve(__dirname, 'cucumber', 'test-skipped.feature')
|
||||
],
|
||||
cucumberOpts: {
|
||||
tags: '(not @SKIPPED_TAG)',
|
||||
ignoreUndefinedDefinitions: true,
|
||||
retry: 1,
|
||||
retryTagFilter: '@retry',
|
||||
scenarioLevelReporter: true
|
||||
}
|
||||
}
|
||||
)
|
||||
assert.strictEqual(skippedSpecs, 1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* wdio test run with custom service
|
||||
*/
|
||||
|
|
@ -1136,6 +1163,7 @@ const jasmineAfterHookArgsValidation = async () => {
|
|||
cucumberPendingTest,
|
||||
cucumberReporter,
|
||||
cucumberFileOption,
|
||||
cucumberSkipTag,
|
||||
standaloneTest,
|
||||
mochaAsyncTestrunner,
|
||||
customService,
|
||||
|
|
|
|||
Loading…
Reference in a new issue