badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.31k stars 144 forks source link

Support suite-level test configuration via Feature tags #1158

Closed mallison closed 4 months ago

mallison commented 5 months ago

Current behavior

Suite-level configuration, eg testIsolation, cannot be applied using tags.

Eg.

@testIsolation(false)
Feature: Apply Feature tags at the suite level

    Scenario: Open a page
        Given I load a page

    Scenario: the page still exists
        Then the page should exist

Does not work.

Desired behavior

Tags set on a Feature get applied to the corresponding describe so that suite-level configuration can be altered.

Test code to reproduce

I've created a small repository with a single feature file to demonstrate the issue https://github.com/marvelapp/suite-level-tags

In this repo when I run the test suite I see

No commands were issued in this test

for each scenario.

Screenshot 2024-02-19 at 12 16 00

I see from the code that this will never work because configuration set via tags is always set on the test, ie it.

If this feature request is reasonable I'm happy to create a pull request for it.

Versions

Checklist

badeball commented 4 months ago

If this feature request is reasonable I'm happy to create a pull request for it.

That'd be fine. I recommend that you specify the desired behavior using tests before implementing anything though, and use that to propose new behavior.

mallison commented 4 months ago

I recommend that you specify the desired behavior using tests

I've create a pull request with a test showing the desired behaviour. I'd played around with implementation, as it looked like a small change, so I pushed those changes too.

badeball commented 4 months ago

This has been fixed with v20.0.2.