cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.05k stars 1.09k forks source link

Running Cucumber In the Browser? #2414

Open robmoffat opened 3 months ago

robmoffat commented 3 months ago

🤔 What's the problem you're trying to solve?

Hi,

I am writing a set of conformance tests for FDC3, which is a way for different applications (e.g. web apps) to collaborate in a workflow.

Ideally, I'd like to package these conformance tests as a web GUI, rather than running from the command line. This is something you can do with Mocha, say.

✨ What's your proposed solution?

Cucumber appears to have lots of dependencies on things like node:fs - are these dependencies isolated? Can they be replaced with others? For example, could I load .feature files with a URL rather than a file path?

⛏ Have you considered any alternatives or workarounds?

I've tried unsuccessfully using Vite Polyfills and also looked at Vitest Cucumber Plugin

📚 Any additional context?

No response

dnotes commented 2 days ago

If you're still working on this, I've made a Vitest plugin that parses Gherkin feature files at quickpickle. It's basically a replacement for CucumberJS as a test runner, but using all of the official parsing bits. Would love to hear if it would work in the browser but don't have time to test at the moment.