Comments (2)
It's a Duplicate of #130
It would be great if someone could consider this. Lot of organizations follow this pattern of having multiple testrail cases in one Automated test in order to make tests more efficient. Thanks!
from trcli.
this could be possible solution for properties
diff --git a/trcli/readers/junit_xml.py b/trcli/readers/junit_xml.py
index 4475193..4572695 100644
--- a/trcli/readers/junit_xml.py
+++ b/trcli/readers/junit_xml.py
@@ -77,7 +77,7 @@ class JunitParser(FileParser):
processed_section_properties.append(prop.name)
for case in section:
cases_count += 1
- case_id = None
+ multiple_ids = []
case_name = case.name
attachments = []
result_fields = []
@@ -90,7 +90,7 @@ class JunitParser(FileParser):
for case_props in case.iterchildren(Properties):
for prop in case_props.iterchildren(Property):
if prop.name and self.case_matcher == MatchersParser.PROPERTY and prop.name == "test_id":
- case_id = int(prop.value.lower().replace("c", ""))
+ multiple_ids.append(int(prop.value.lower().replace("c", "")))
if prop.name and prop.name.startswith("testrail_attachment"):
attachments.append(prop.value)
if prop.name and prop.name.startswith("testrail_result_field"):
@@ -109,27 +109,28 @@ class JunitParser(FileParser):
if error:
self.env.elog(error)
raise Exception(error)
- result = TestRailResult(
- case_id,
- elapsed=case.time,
- junit_result_unparsed=case.result,
- attachments=attachments,
- result_fields=result_fields_dict
- )
- for comment in reversed(comments):
- result.prepend_comment(comment)
- if sauce_session:
- result.prepend_comment(f"SauceLabs session: {sauce_session}")
- test_cases.append(
- TestRailCase(
- section.id,
- case_name,
- case_id,
- result=result,
- custom_automation_id=automation_id,
- case_fields=case_fields_dict
+ for single_id in multiple_ids:
+ result = TestRailResult(
+ single_id,
+ elapsed=case.time,
+ junit_result_unparsed=case.result,
+ attachments=attachments,
+ result_fields=result_fields_dict
+ )
+ for comment in reversed(comments):
+ result.prepend_comment(comment)
+ if sauce_session:
+ result.prepend_comment(f"SauceLabs session: {sauce_session}")
+ test_cases.append(
+ TestRailCase(
+ section.id,
+ case_name,
+ single_id,
+ result=result,
+ custom_automation_id=automation_id,
+ case_fields=case_fields_dict
+ )
)
- )
test_sections.append(
TestRailSection(
section.name,
from trcli.
Related Issues (20)
- CASE ID is getting auto generated though we are providing an existing run id HOT 5
- Provide ability to publish results from multiple XML files HOT 2
- Need support for adding multiple testrail case IDs in single test
- KeyError: 'custom_automation_id' on sending test report HOT 2
- trcli sometimes defaults to CP1252 instead of unicode HOT 7
- Cannot update test runs with --run-id flag HOT 5
- Error with parse_junit comand HOT 9
- Support plan_id when submitting results from pytest HOT 6
- Add the ability to pass in the `include_all` api parameter when creating a Test Run through the CLI.
- code first approach: cases created and test run created but no results uploaded in the testrun. HOT 3
- Junit report uploading failing on trcli 1.5.0 HOT 2
- Another issue with KeyError: 'custom_automation_id' HOT 8
- Testrail CLI not updating existing test cases using Playwright/Typescript HOT 6
- Add support for "Configurations" HOT 1
- Handling Invalid or Unknown Case IDs in Test Run HOT 4
- Add an option to create only TestCases, but skip adding or updating Runs or Results. HOT 4
- Erroneous "is a required field"? HOT 1
- KeyError: 'section_id' when trying to processed a combined junit test report HOT 3
- trcli complained "The requested URL was not found on this server" when running case HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trcli.