Skip to content

fix(core, awesome): remove duplicated step details#242

Merged
delatrie merged 8 commits intomainfrom
issue-201-step-errors
Jul 2, 2025
Merged

fix(core, awesome): remove duplicated step details#242
delatrie merged 8 commits intomainfrom
issue-201-step-errors

Conversation

@delatrie
Copy link
Copy Markdown
Collaborator

@delatrie delatrie commented Jul 1, 2025

The PR removed a step's details from all parent steps. That only applies to details with identical messages. If the messages differ, all the details are retained.

The implementation is based on the hasSimilarErrorInSubSteps flag introduced in #149, but it makes the flag recursive, which fixes #201.

E2E page objects refactoring

The idea behind the refactoring is to allow defining fixtures to check parts of pages, specifically, the steps of a test on the test result page. Here is the list of changes:

  • Split screenshot into screenshot and attachScreenshot. The former can be overridden to attach screenshots of specific elements.

  • Make TreePage and TestResultPage derive from CommonPage instead of PageObject.

  • Implement StepResultFixture to check steps. Currently, it only contains locators and methods to check status details. Other locators and methods can be added to verify parameters, attachments, etc. Use TestResult.getStepByName or StepResultFixture.getSubstepByName to create a fixture for a step.

    Use StepResultFixture.attachScreenshot to attach a screenshot of the step to Allure (the step must be visible in the report).

  • Implement a custom toHaveDetails Playwright matcher. Example:

    import { expect, test } from "../../playwright.js";
    
    /* ... */
    
    test("My step must have message and trace", async () => {
      const step = testResultPage.getStepByName("My step");
      await step.toggleDetails();
      await expect(step).toHaveDetails("Lorem ipsum", "dolor sit amet");
    });

    If an expected value is provided for the step's trace, make sure the step's details are expanded.

    We may add other matches in the future. If the module becomes too large, we may split it into separate modules and combine them into a single extension point as described here.

Other changes

  • Define an issue template for @allurereport/e2e.
  • Remove an unused variable from environments.test.ts
  • Implement an e2e test for nested steps with details

Fixes #201

@delatrie delatrie added the type:bug Something isn't working label Jul 1, 2025
@delatrie delatrie requested a review from todti July 2, 2025 10:22
@delatrie delatrie merged commit 6c1f898 into main Jul 2, 2025
5 checks passed
@delatrie delatrie deleted the issue-201-step-errors branch July 2, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Awesome: duplicated errors rendered each other parent step

2 participants