badeball / cypress-cucumber-preprocessor

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

Type definitions for CucumberDataCollector #570

Closed jmezach closed 2 years ago

jmezach commented 3 years ago

Current behavior

I'm writing some test scenario's in which it would be beneficial to have some metadata about the scenario that is being executed. I found out that this information is available using window.testState. However I'm writing my test code in TypeScript, so I don't have any type definitions. I've worked around this limitation by defining my own types for now, but obviously that isn't very maintainable in the long run.

Desired behavior

It would be nice if this library included type definitions based on the CucumberDataCollector type and then exposes that as testState on window.

Test code to reproduce

Given('this scenario is being run', () => {
  // Get some metadata of the scenario
  const scenario = window.testState.currentScenario;
  // Property 'testState' does not exist on type 'Window & typeof globalThis'. ts(2339)
});

Versions

badeball commented 2 years ago

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.