Skip to content

[Feature]: Additional configuration options for fully qualified test case title #291

Description

@Aaron-Pool

The Problem

My team often writes a significant amount of detail the Rule definitions in our feature files. We keep our Feature and Scenario descriptions very succinct and instead put business rules underneath the Rule headings. However, since each Rule generates a describe(...textContents) block, it makes the cli output virtually unreadable and very hard to parse. Is it possible to have some configuration option to manage how a test suite is structured for a given feature file hierarchy.

Proposed Solution

I was thinking you could expand the concept currently seen in examplesTitleFormat? to be just titleFormat?, and it would take the following object:

interface TitleFormat {
  feature?: string | null,
  rule?: string | null,
  scenarioOutline?: string | null, 
  scenario?: string,
  example?: string,
}

This would allow anything that maps to a describe block to be provided null, which would mean that it would map to an anonymous describe group.

Anything not provided would use the default behavior. To clarify, neither scenario nor example could be provided null, as playwright does not allow the test block itself to be anonymous.

This way I could accomplish what I wanted by providing:

{
  titleFormat: {
    rule: null,
  }
}

But if another company instead used the Feature line to hold business requirements and the Rule/Scenario to distinguish to test case, they could instead do:

{
  titleFormat: {
    feature: null
  }
}

Additional Context

No response

Priority Level

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions