Skip to content

Add precondition and expected result support - #62

Merged
baev merged 1 commit into
mainfrom
feat-preconditions-support
Nov 2, 2026
Merged

baev merged 1 commit into
mainfrom
feat-preconditions-support

Conversation

@andrcuns

Copy link
Copy Markdown
Contributor

Context

Add preconditions and expected results to Rust test results, matching the support added in allure-ruby. Test authors can document what must be true before a test runs and what outcome it is intended to produce, separately from the test description.

Both fields support independent Markdown and HTML values:

  • precondition and preconditionHtml
  • expectedResult and expectedResultHtml

Set them before execution using TestOptions builders:

TestOptions::new("dashboard")
    .with_precondition("User is logged in")
    .with_expected_result("Dashboard is displayed")

Or update them while a test is running using the thread-bound runtime helpers:

allure_rust_commons::precondition("User is logged in");
allure_rust_commons::expected_result("Dashboard is displayed");

HTML variants are available through with_precondition_html / with_expected_result_html builders and precondition_html / expected_result_html runtime helpers. Adapters can also set the fields through AllureFacade methods or low-level lifecycle parameters.

These values are report metadata only: they do not perform setup or assert the test outcome.

Checklist

@andrcuns andrcuns added the pr:new feature Pull requests that add new user-facing functionality. label Oct 30, 2026
@andrcuns andrcuns self-assigned this Oct 30, 2026
@andrcuns
andrcuns marked this pull request as ready for review October 30, 2026 09:05
@andrcuns
andrcuns requested a review from baev as a code owner October 30, 2026 09:05
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Allure Report Summary

     Environment Duration Stats New Flaky Retry
     All tests 20m 49s Passed tests⁠ 248 6 0 0
     ubuntu-latest-rust-stable 10m 50s Passed tests⁠ 124 3 0 0
     windows-latest-rust-stable 9m 58s Passed tests⁠ 124 3 0 0

Reports: Awesome

Context: de96e01e, CI

Allure TestOps: Allure Rust GitHub actions run (2026-11-02T17:13:10.364Z)

Artifacts used (6)
  • allure-results-smoke-nextest-ubuntu-latest-rust-stable.zip
  • allure-results-smoke-nextest-windows-latest-rust-stable.zip
  • allure-results-smoke-ubuntu-latest-rust-stable.zip
  • allure-results-smoke-windows-latest-rust-stable.zip
  • allure-results-ubuntu-latest-rust-stable.zip
  • allure-results-windows-latest-rust-stable.zip

@baev
baev force-pushed the feat-preconditions-support branch from 0c1dca0 to de96e01 Compare November 2, 2026 17:06
@baev
baev merged commit 7fd1449 into main Nov 2, 2026
14 checks passed
@baev
baev deleted the feat-preconditions-support branch November 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new feature Pull requests that add new user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants