Skip to content

fix: preserve Robot Framework suite hierarchy when registering tests#488

Merged
gibiw merged 3 commits into
mainfrom
fix/robotframework-suite-hierarchy
May 14, 2026
Merged

fix: preserve Robot Framework suite hierarchy when registering tests#488
gibiw merged 3 commits into
mainfrom
fix/robotframework-suite-hierarchy

Conversation

@gibiw
Copy link
Copy Markdown
Contributor

@gibiw gibiw commented May 14, 2026

Summary

  • Fixes Robot Framework test suites creation does not take into account suites hierarchy #486 — Robot Framework suites lose their parent hierarchy and only the leaf suite reaches Qase.
  • start_suite is invoked by Robot Framework for every suite (root → leaves). The previous implementation walked the full sub-tree on each invocation with parent_suites reset to empty, so the last (leaf) call overwrote each test's hierarchy with just the leaf suite name.
  • Extract tests only on the root start_suite call (suite.parent is None) so each test keeps its full path from the run root.

Test plan

  • Added unit tests for __extract_tests_with_suites covering flat, nested, and multi-level scenarios.
  • Added regression tests for start_suite that exercise the exact RF call order (root → child → leaf) and assert the full hierarchy survives.
  • Confirmed the new regression test fails on main (reproduces ['Login'] instead of ['Tests', 'Account', 'Login']) and passes with the fix.
  • Full suite green: pytest tests/ → 45 passed.

gibiw added 2 commits May 14, 2026 10:13
Robot Framework invokes start_suite for every suite in the run, from
root down to the leaves. The previous implementation walked the full
sub-tree on each invocation with parent_suites reset to empty, so the
last (leaf) call overwrote each test's hierarchy with just the leaf
suite name. As a result, Qase received only the deepest folder.

Extract tests only on the root start_suite call (suite.parent is None)
so each test keeps its full path from the run root. Closes #486.
Restoring the full Robot Framework suite hierarchy changes the location
where reported test cases land in Qase, which can break existing
projects that were built against the old flattened layout. Bump the
major version and document the migration path.
@gibiw gibiw force-pushed the fix/robotframework-suite-hierarchy branch from 8b2826b to d9b030a Compare May 14, 2026 07:14
…rchy

The previous expected file was generated under the bug where only the
leaf suite was reported. Now that the listener preserves the full
hierarchy from the run root, the validator receives the directory-level
"Tests" suite as data[0] and the file-level "Steps" suite as data[1],
matching the layout used by the pytest and tavern expected files.
Signatures move from "<id>::steps::<name>" to
"<id>::tests::steps::<name>" because they include every suite in order.
@gibiw gibiw merged commit 36025bd into main May 14, 2026
37 checks passed
@gibiw gibiw deleted the fix/robotframework-suite-hierarchy branch May 14, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Robot Framework test suites creation does not take into account suites hierarchy

1 participant