Skip to content

Add precondition and expected result support - #665

Merged
andrcuns merged 1 commit into
masterfrom
feat-preconditions-support
Oct 29, 2026
Merged

andrcuns merged 1 commit into
masterfrom
feat-preconditions-support

Conversation

@andrcuns

@andrcuns andrcuns commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Context

Ruby tests can now report preconditions and expected results separately from the test description. This makes it easier to explain what must be true before a test runs and what a successful outcome should look like, without combining everything into one description.

Adds support for precondition, preconditionHtml, expectedResult, and expectedResultHtml in test results, with helpers that work like the existing description helpers:

Allure.add_precondition("User is logged in")
Allure.add_expected_result("Dashboard is displayed")

# Use explicit HTML when rich formatting is needed.
Allure.precondition_html("<p>User is logged in</p>")
Allure.expected_result_html("<p>Dashboard is displayed</p>")

These fields complement the existing description and support Markdown or explicit HTML, just like descriptions. The corresponding Allure 3 report support was added in allure-framework/allure3#1189: Awesome reports display Precondition before test execution and Expected result after teardown.

Checklist

@andrcuns andrcuns added the pr:new feature New features label Oct 29, 2026
@andrcuns andrcuns self-assigned this Oct 29, 2026
@andrcuns
andrcuns marked this pull request as ready for review October 29, 2026 08:38
@andrcuns
andrcuns requested a review from formaceft-93 October 29, 2026 08:38
@andrcuns
andrcuns enabled auto-merge October 29, 2026 08:42
@github-actions

Copy link
Copy Markdown

Allure Report Summary

     Environment Duration Stats New Flaky Retry
     All tests 3s Passed tests⁠ 1158 1158 0 0
     ubuntu-ruby-3_3-oj-false 585ms Passed tests⁠ 193 193 0 0
     ubuntu-ruby-3_3-oj-true 498ms Passed tests⁠ 193 193 0 0
     ubuntu-ruby-3_4-oj-false 711ms Passed tests⁠ 193 193 0 0
     ubuntu-ruby-3_4-oj-true 346ms Passed tests⁠ 193 193 0 0
     ubuntu-ruby-4_0-oj-false 384ms Passed tests⁠ 193 193 0 0
     ubuntu-ruby-4_0-oj-true 655ms Passed tests⁠ 193 193 0 0

Allure TestOps: Allure Ruby GitHub actions run (2026-10-29T08:55:51.205Z)

Artifacts used (6)
  • allure-results-test-ruby-3.3-oj-false.zip
  • allure-results-test-ruby-3.3-oj-true.zip
  • allure-results-test-ruby-3.4-oj-false.zip
  • allure-results-test-ruby-3.4-oj-true.zip
  • allure-results-test-ruby-4.0-oj-false.zip
  • allure-results-test-ruby-4.0-oj-true.zip

@formaceft-93 formaceft-93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@andrcuns
andrcuns added this pull request to the merge queue Oct 29, 2026
Merged via the queue into master with commit 366c8ac Oct 29, 2026
16 checks passed
@andrcuns
andrcuns deleted the feat-preconditions-support branch October 29, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants