diff --git a/index.js b/index.js index 6be45bd..db001b4 100644 --- a/index.js +++ b/index.js @@ -183,6 +183,14 @@ module.exports = (config) => { } event.dispatcher.on(event.test.started, async (test) => { + if (test.body) { + if (test.body.includes('addExampleInTable')) { + const testRailTag = /"testRailTag":"(@C\d+)"/.exec(test.title); + if (testRailTag) { + test.tags.push(testRailTag[1]); + } + } + } test.startTime = Date.now(); }); diff --git a/readme.md b/readme.md index 655f6b6..b427b49 100644 --- a/readme.md +++ b/readme.md @@ -69,6 +69,19 @@ A Gherkin example: Then I see search textbox And I see search button ``` +**Note:** +TestRail tag in **Examples** from **Scenario Outline** available from version `1.7.4` and above +```gherkin + @someTag + Scenario Outline: Fill some field + When I fill some field by text + Then I see text + + Examples: + | testRailTag | text | + | @C1234 | someText1 | + | @C1235 | someText2 | +``` ##### Configuration