{"id":14969238,"url":"https://github.com/cucumber/cucumber-electron","last_synced_at":"2025-04-06T02:07:43.490Z","repository":{"id":13380800,"uuid":"74269834","full_name":"cucumber/cucumber-electron","owner":"cucumber","description":"Run cucumber.js in electron","archived":false,"fork":false,"pushed_at":"2024-09-17T18:41:57.000Z","size":2791,"stargazers_count":118,"open_issues_count":9,"forks_count":22,"subscribers_count":92,"default_branch":"main","last_synced_at":"2024-10-29T14:46:47.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cucumber.png","metadata":{"funding":{"open_collective":"cucumber","github":"cucumber"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-20T11:34:16.000Z","updated_at":"2024-09-17T18:41:06.000Z","dependencies_parsed_at":"2024-01-08T04:03:26.907Z","dependency_job_id":"f774082d-acc0-4747-86e4-919e8fc23d9d","html_url":"https://github.com/cucumber/cucumber-electron","commit_stats":{"total_commits":250,"total_committers":12,"mean_commits":"20.833333333333332","dds":0.5680000000000001,"last_synced_commit":"402869934cc9246718e6a11e7eeacd1aa759f06b"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-electron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-electron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-electron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber%2Fcucumber-electron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cucumber","download_url":"https://codeload.github.com/cucumber/cucumber-electron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246188679,"owners_count":20737746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:41:25.056Z","updated_at":"2025-03-30T01:08:06.989Z","avatar_url":"https://github.com/cucumber.png","language":"JavaScript","funding_links":["https://opencollective.com/cucumber","https://github.com/sponsors/cucumber"],"categories":[],"sub_categories":[],"readme":"# cucumber-electron\n\nRuns [Cucumber.js](https://github.com/cucumber/cucumber-js) in an [Electron](https://github.com/electron/electron) renderer process. Scenarios have direct access to both a browser DOM and node.js libraries, so they are fast and easy to debug interactively.\n\n[![Build Status](https://github.com/cucumber/cucumber-electron/workflows/build/badge.svg)](https://github.com/cucumber/cucumber-electron/actions)\n\n## Install\n\nBoth Electron and Cucumber.js need to be installed, they are peer dependencies.\nThis gives you the option to choose the version you want to use:\n\n    npm install --save-dev electron @cucumber/cucumber @cucumber/electron\n\n## Usage\n\nCucumber-electron is a wrapper around Cucumber.js, supporting the same\nfeatures and command-line options. You should be able to use it on your project\nwithout any changes.\n\nRun cucumber-electron like it was Cucumber.js, for example:\n\n    npx cucumber-electron ./features/your.feature:123\n\n## API\n\nCucumber Electron provides an API that you can use in your step definitions or hooks.\n\n### App Elements\n\nAn app element is a DOM element where you can mount the application or component under test.\n\n```javascript\nconst { AppElements } = require('@cucumber/cucumber-electron')\n\nBefore(function () {\n  this.appElements = new AppElements()\n})\n\nGiven('{word} has an app element', function (name) {\n  const appElement = this.appElements.create(document, name)\n  \n  // Mount a React Component\n  ReactDOM.render(\u003cMyComponent /\u003e, appElement)\n  \n  // Mount a Vue component\n  new Vue({ el: appElement })\n  \n  // Vanilla DOM\n  appElement.innerHTML = '\u003ch1\u003eHello World\u003c/h1\u003e'\n})\n\nAfter(function () {\n  if (!process.env.CUCUMBER_ELECTRON_KEEP_APP_ELEMENTS) {\n    // Destroy all app elements after each scenario\n    this.appElements.destroyAll()\n  }\n})\n```\n\nIn [interactive debugging](#interactive-debugging) mode this will look something like this:\n\n![App Elements](docs/images/app-elements.png)\n\nSee the [app-elements example](examples/app-elements) for more details.\n\nYou can run it like this:\n\n    CUCUMBER_ELECTRON_KEEP_APP_ELEMENTS=1 ./bin/cucumber-electron.js examples/app-elements --interactive\n\n## Interactive Debugging\n\nThe `--interactive` (or `-i`) command line switch shows a browser window with chrome dev tools and keeps\nthe window open after all features have finished running.\n\nThe interactive debugger will halt execution on any `debugger` statements, or breakpoints you have set in chrome dev tools.\n\nIn interactive mode you can re-run all your scenarios by pressing `CMD-R` (MacOS) or `CTRL-R` (Windows/Linux)\nwhile the browser window has focus.\n\n## Custom Stylesheet\n\nYou can add a custom stylesheet to the DOM with the `--stylesheet [PATH]` option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber%2Fcucumber-electron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcucumber%2Fcucumber-electron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber%2Fcucumber-electron/lists"}