Tracking issue: Spin out a core library for JavaScript runners to build on
@davidjgoss ci sta già lavorando.
Dal 3/3/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Background
The direction of travel for Cucumber in the JavaScript ecosystem is to not ship our own test runner, but instead provide as nice a way as possible to extend existing test runners with Cucumber functionality.
There were already examples of this in the wild:
- https://github.com/badeball/cypress-cucumber-preprocessor
- https://github.com/vitalets/playwright-bdd
- https://github.com/portabletext/editor/tree/main/packages/racejar
And we've now released an implementation that extends the Node.js test runner: https://github.com/cucumber/cucumber-node
Whilst all of these implementations use the low-level libraries (gherkin, cucumber-expressions, tag-expressions etc) to good effect, they are all doing roughly the same thing in terms of pickles + code = test cases. We could do with a core library to provide this, reducing the maintenance burden of the existing projects and lowering the barrier to entry for new ones.
Requirements
This core should not be specific to any JavaScript runtime - it should work in the browser, on Node.js, Deno and Bun with just language features and as few dependencies as possible.
We should agree early on what is in and out of scope of this core.
In scope
- Registration and validation of support code (steps, hooks, parameter types)
- Assembly of executable test cases from pickles plus the support code
DataTable- it would be good to handle this consistently across implementations, it makes sense to live here as it doesn't quite warrant its own polyglot library- Methods to produce Cucumber Messages for the support code and test cases
Out of scope
- Sourcing and filtering of pickles, because this is going to vary between runner implementations e.g. cucumber-node using a module loader vs racejar that accepts text vs cucumber-js that streams from the file system. The
gherkinlibrary makes it pretty easy to go from source to pickles in a few lines of code so this is not a big concern as far as duplication goes. - Injecting context to support code functions including the "world", because again this will vary between implementations e.g. cucumber-node injecting context as the first argument vs cucumber-js binding world to
this- the test case assembly part should have a generic way to enable this, but nothing more - Snippets for the same reasons as above
- Projecting the test cases onto the test runner for actual execution
- Doing anything with the Cucumber Messages, because we should not assume the implementation can or will use them
Proposal
The parts of cucumber-node that deal with these "core" capabilities are already mostly decoupled. A good first pass would be to spin out a core module in-place as a POC, and sense check that against the other existing implementations and see where it falls down.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 3.4k
- Fork
- 676
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cucumber/common
-
Upgrade to TypeScript 7Forse di nuovo libera @davidjgoss l’ha presa 124 giorni fa e non c’è nessuna pull request aperta. Apertalanguage: javascript
-
Allowing both DocString and DataTable on a single stepForse di nuovo libera @mpkorstanje l’ha presa 129 giorni fa e non c’è nessuna pull request aperta. Aperta
cucumber/common#2315 · 23 commenti · 1 reazione · 1 assegnatario ·
-
Enable static analysisForse di nuovo libera @mpkorstanje l’ha presa 220 giorni fa e non c’è nessuna pull request aperta. Aperta
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100