Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade guide from TheBrainFamily/cypress-cucumber-preprocessor #689

Open
badeball opened this issue Apr 10, 2022 · 127 comments
Open

Upgrade guide from TheBrainFamily/cypress-cucumber-preprocessor #689

badeball opened this issue Apr 10, 2022 · 127 comments

Comments

@badeball
Copy link
Owner

badeball commented Apr 10, 2022

Transfer of ownership

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.

What's new 🎉

This implementation has been re-written from scratch in TypeScript, has more thorough test coverage and is filled with a bunch of new feature.

  • Support for the Rule keyword.

  • The cypress-tags has been removed and made redundant. Specs containing no matching scenarios are automatically filtered, provided that filterSpecs is set to true.

  • Screenshots are automatically added to JSON reports (including that of failed tests).

  • Other attachments can be added to the report.

  • JSON reports are generated as a single file and manual, post-merging is no longer required.

  • The package is now located under the name @badeball/cypress-cucumber-preprocessor and a deprecation notice will be posted in the old name once NPM transfer is complete.

  • Methods such as Given, When and Then are imported from @badeball/cypress-cucumber-preprocessor, IE. without the ../steps postfix.

  • A large number of issues has implicitly been fixed due to architectural changes.

  • And(..) and But(..) have been deprecated, read more here.

What's missing

  • Bundled features files. This has been deprioritized, due to the associated maintenance cost, awkward implementation and my personal lack of convincing that it's necessary. Using esbuild gives near-instant compilation time of features and removes nearly all performance gain from bundled features anyway.

Changes to configuration

Nearly all configuration options has been removed and there's no distinction between "global" and "non-global" steps anymore. Steps are searched for using patterns and you can chose to include global steps or not.

Below are some configuration examples. Configuration is still implemented using cosmiconfig, meaning that your configuration can reside in multiple locations, such as package.json or .cypress-cucumber-preprocessorrc.json.

Global step definitions exaple

{
  "name": "my project",
  "depdendencies": {},
  "devDepdendencies": {},
  "cypress-cucumber-preprocessor": {
    "stepDefinitions": "cypress/support/step_definitions/**/*.{js,ts}"
  }
}

Step definitions besides scenario

{
  "name": "my project",
  "depdendencies": {},
  "devDepdendencies": {},
  "cypress-cucumber-preprocessor": {
    "stepDefinitions": "cypress/e2e/[filepath].{js,ts}"
  }
}

Step definitions in a directory besides the scenario

{
  "name": "my project",
  "depdendencies": {},
  "devDepdendencies": {},
  "cypress-cucumber-preprocessor": {
    "stepDefinitions": "cypress/e2e/[filepath]/**/*.{js,ts}"
  }
}

Combination of all of the above (default)

{
  "name": "my project",
  "depdendencies": {},
  "devDepdendencies": {},
  "cypress-cucumber-preprocessor": {
    "stepDefinitions": [
      "cypress/e2e/[filepath]/**/*.{js,ts}",
      "cypress/e2e/[filepath].{js,ts}",
      "cypress/support/step_definitions/**/*.{js,ts}"
    ]
  }
}

Still have an issue?

Because this is a re-implementation and thorough test coverage was originally lacking, old issues may resurface and new issue arise. If you have an issue or just a question, please post it below and I'll try to help.

@badeball badeball changed the title Draft: upgrade guide Upgrade guide from TheBrainFamily/cypress-cucumber-preprocessor Apr 10, 2022
@badeball badeball pinned this issue Apr 10, 2022
This was referenced Apr 10, 2022
@ShaharM7
Copy link

Yes
I have an issue please, can you please provide new docs or an example with cypress cucumber and typescript and
@cypress/webpack-preprocesso

It is very hard to take an existing project and config your plugin without an updated example.
I want to use your plugin for a large project, I even can donate code.

How can I talk to you?

Thanks so much!

@badeball
Copy link
Owner Author

All the official examples are updated: https://github.com/badeball/cypress-cucumber-preprocessor/tree/master/examples

It includes one for webpack + typescript.

@ShaharM7
Copy link

@badeball
I am sorry, but it doesn't work,
need to fit the tsconfig file.
Also, I have an error.
It took me too much to config it.
I have an error, on npx cypress run and I opened it an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests