Skip to content

Commit

Permalink
fix: add parsing for testID from gherkin tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Shevtsov authored and Shelex committed Apr 4, 2023
1 parent 56097e3 commit 8a4b70a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cypress/e2e/cucumber/allure.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: AllureAPI
@tagForRule
Rule: TestRule

@testID("12345")
@issue("jira","tmsLink")
@tms("tms","tmsLink")
@link("example","https://example.com")
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/results/main.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const expectedLabels = (mode, type) =>
{ name: 'package', value: 'cypress.e2e.basic.allure.cy.js' }
]
: [
{ name: 'AS_ID', value: '12345' },
{ name: 'parentSuite', value: 'AllureAPI' },
{ name: 'suite', value: 'TestRule' },
{ name: 'epic', value: 'AllureAPI' },
Expand Down
6 changes: 5 additions & 1 deletion reporter/allure-cypress/CucumberHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ module.exports = class CucumberHandler {
value: value
};
} else {
currentTest.addLabel(command, value);
// handle renaming label for testID, or just use label name
currentTest.addLabel(
command === 'testID' ? 'AS_ID' : command,
value
);
}
}
return !match;
Expand Down

0 comments on commit 8a4b70a

Please sign in to comment.