Map test tags to Test Case IDs
Map pytest BDD scenarios to existing test cases in BrowserStack Test Management using @TCID_ tags.
You can tag your BDD scenarios with @TCID_<tc-id> to map test results to the corresponding test cases in Test Management.
Prerequisites
- BrowserStack SDK
v1.33.13or later installed in your project. - A pytest BDD test suite.
- An existing Test Management account with defined test cases.
How it works
When you add the @TCID_<tc-id> tag to a BDD scenario in your .feature file, the SDK captures the entire TCID_<tc-id> string as a tag for that scenario. After the test runs, the SDK checks for a test case in Test Management whose ID matches <tc-id>. If a match is found, the scenario result is automatically mapped to that test case.
Test tag mapping to test case ID is only supported for the pytest-bdd framework.
Tag a pytest BDD scenario
Add the @TCID_<tc-id> decorator directly before a Scenario block in your .feature file. Replace <tc-id> with the actual test case ID from Test Management (for example, TC-5848).
Tag format
You can use the following format to tag a test case ID:
@TCID_<tc-id>
Example .feature file
After the tests complete, the SDK reads the @TCID_ tag from each scenario and maps its result to the matching test case in Test Management. If no test case is found for the given ID, no mapping occurs for that scenario.
View results
After a successful test run, Test Management automatically imports and associates the results. Navigate to the Test Runs section in your Test Management project to view the mapped test case results.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!