Skip to content

Commit

Permalink
feature: add support for multiple IDs
Browse files Browse the repository at this point in the history
Added the ability to specify multiple IDs for a test case
  • Loading branch information
gibiw committed Aug 5, 2024
1 parent cf915c7 commit ebbc83c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
14 changes: 14 additions & 0 deletions qase-robotframework/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# qase-pytest 3.1.0b4

## What's new

Added the ability to specify multiple IDs for a test case.

```robotframework
Example Test
[Documentation] Example test
[Tags] q-62 Q-50 subtraction
${result}= subtraction 5 3
Should Be Equal ${result} 2
```

# qase-pytest 3.1.0b3

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-robotframework/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-robotframework"
version = "3.1.0b3"
version = "3.1.0b4"
description = "Qase Robot Framework Plugin"
readme = "README.md"
authors = [{name = "Qase Team", email = "[email protected]"}]
Expand Down
9 changes: 7 additions & 2 deletions qase-robotframework/src/qase/robotframework/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def end_test(self, name, attributes: EndTestModel):

case_id = self._extract_ids(attributes.get("tags"))
if case_id:
self.runtime.result.testops_id = int(case_id)
self.runtime.result.testops_id = case_id

self.runtime.result.execution.complete()
self.runtime.result.execution.set_status(STATUSES[attributes.get("status")])
Expand Down Expand Up @@ -116,7 +116,12 @@ def log_message(self, message):

def _extract_ids(self, list_of_tags: List[str]):
id = re.compile(r"Q-(\d+)", re.IGNORECASE)
ids = []
for tag in list_of_tags:
if id.fullmatch(tag):
return int(id.match(tag).groups()[0])
ids.append(int(id.match(tag).groups()[0]))

if len(ids) > 0:
return ids

return None

0 comments on commit ebbc83c

Please sign in to comment.