Skip to content

feat: add titlePath to results generated by all allure-pytest integrations #870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

delatrie
Copy link
Contributor

Context

We're transitioning to a new default test result hierarchy called titlePath, which requires support in all test framework integrations. This PR adds support for titlePath to integrations with Behave, Nose2, pytest, Pytest-BDD, and Robot Framework.

A detailed description of the feature can be found in this issue: allure-framework/allure-js#1260.

Allure Behave

titlePath of a Behave scenario consists of the following parts:

  • Directories of the feature file, relative to the CWD.
  • The name of the feature.

Example:

Given that the following feature file is placed at ./features/epic/foo.feature:

Feature: Foo

Scenario: Bar
  Given something...

The following titlePath is assigned to the test result of the Bar scenario: ["features", "epic", "Foo"].

Note

If the feature is nameless, the name of the file is used instead (foo.feature in the example above). If the feature isn't associated with a file (i.e., it was parsed from a string via the Behave API), the titlePath consists of the feature name only. If the feature has neither a file nor a name, the feature's keyword (Feature) is used as a placeholder.

Allure Nose2

For Nose 2 tests, a titlePath is the full name of the test's module, split by ., optionally followed by the class name.

Allure Pytest

For Pytest tests, a titlePath consists of:

  • Segments of the filepath relative to the rootdir.
  • For test methods, names of the classes (the test classes can nest).

Allure Pytest BDD

For Pytest-BDD scenarios, a titlePath consists of:

  • Directory names of the feature file relative to the rootdir.
  • The name of the feature.

Note

If the feature is nameless, the name of the file is used instead.

Allure Robot Framework

For Robot Framework test suites, a titlePath consists of the names of the test case's suites.

Example:

Given a suite file at ./suites/foo/bar.robot, when a single path ./suites is passed to Robot Framework, the test cases in that suite all receive the following titlePath: ["Foo", "Bar"].

Warning

The sequence of suites and sub-suites resolved by Robot Framework depends on the CWD and the paths you pass to robot. The example above can also be run like this: robot <other args> ./suites/foo, in which case the titlePath becomes ["Bar"].
Ensure that you run the Robot Framework with the same paths when generating Allure reports, so that the history-related identifiers and title paths remain consistent across runs. Otherwise, the history may not work correctly, and the report navigation may become confusing.

Checklist

@epszaw epszaw self-requested a review July 18, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant