{"id":20328881,"url":"https://github.com/kaliber5/ember-cli-yadda","last_synced_at":"2026-03-04T08:31:55.275Z","repository":{"id":36795488,"uuid":"41102293","full_name":"kaliber5/ember-cli-yadda","owner":"kaliber5","description":"Write cucumber specs for ember-cli applications","archived":false,"fork":false,"pushed_at":"2023-03-05T15:30:51.000Z","size":3561,"stargazers_count":42,"open_issues_count":19,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-02-06T00:30:29.792Z","etag":null,"topics":["bdd","cocumber","ember","ember-addon","hacktoberfest","testing","yadda"],"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/kaliber5.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-08-20T15:05:26.000Z","updated_at":"2024-05-30T02:30:34.000Z","dependencies_parsed_at":"2023-07-12T14:48:22.082Z","dependency_job_id":null,"html_url":"https://github.com/kaliber5/ember-cli-yadda","commit_stats":{"total_commits":240,"total_committers":17,"mean_commits":"14.117647058823529","dds":0.65,"last_synced_commit":"11362550eb84c5511076ba8d47a68004c222461c"},"previous_names":["albertjan/ember-cli-yadda","curit/ember-cli-yadda"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/kaliber5/ember-cli-yadda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliber5%2Fember-cli-yadda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliber5%2Fember-cli-yadda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliber5%2Fember-cli-yadda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliber5%2Fember-cli-yadda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaliber5","download_url":"https://codeload.github.com/kaliber5/ember-cli-yadda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliber5%2Fember-cli-yadda/sbom","scorecard":{"id":548301,"data":{"date":"2025-08-11","repo":{"name":"github.com/kaliber5/ember-cli-yadda","commit":"11362550eb84c5511076ba8d47a68004c222461c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/kaliber5/ember-cli-yadda/ci.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"106 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-6vfc-qv3f-vr6c","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-pc58-wgmc-hfjr","Warn: Project is vulnerable to: GHSA-vvv8-xw5f-3f88","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4","Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653","Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj","Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67","Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w","Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2","Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-xfhp-gmh8-r8v2","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T10:06:17.203Z","repository_id":36795488,"created_at":"2025-08-20T10:06:17.203Z","updated_at":"2025-08-20T10:06:17.203Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bdd","cocumber","ember","ember-addon","hacktoberfest","testing","yadda"],"created_at":"2024-11-14T20:08:21.869Z","updated_at":"2026-03-04T08:31:55.255Z","avatar_url":"https://github.com/kaliber5.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/kaliber5/ember-cli-yadda/actions/workflows/ci.yml/badge.svg)](https://github.com/kaliber5/ember-cli-yadda/actions/workflows/ci.yml)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-yadda.svg)](http://emberobserver.com/addons/ember-cli-yadda)\n# Ember-cli-yadda\n\nThis Ember CLI addon facilitates writing BDD tests in the Gherkin language and executing them against your Ember app.\n\n[@mschinis (Micheal Schinis)](https://github.com/mschinis) Did a great talk at @emberlondon [BDD approach with ember using `ember-cli-yadda`](https://vimeo.com/146828818).\n\nIt uses the [yadda](https://github.com/acuminous/yadda) library to parse and run your feature files, and integrates into\nyour Ember test setup using either [ember-qunit](https://github.com/emberjs/ember-qunit) or\n[ember-mocha](https://github.com/emberjs/ember-mocha).\n\nThe following describes the use of ember-cli-yadda \u003e= v0.4.0 which works only with the latest modern\nEmber testing APIs, as laid out in the RFCs\n[232](https://github.com/emberjs/rfcs/blob/master/text/0232-simplify-qunit-testing-api.md)\nand\n[268](https://github.com/emberjs/rfcs/blob/master/text/0268-acceptance-testing-refactor.md).\n\nFor the older APIs use v0.3.x and have a look at our [Legacy Guide](docs/legacy.md).\n\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v3.20 or above\n* Ember CLI v3.20 or above\n* Node.js v12 or above\n* ember-auto-import v2 or Embroider\n\n\u003e Due to the way `yadda` is written, you need to add some [custom webpack config options](https://github.com/kaliber5/ember-cli-yadda/blob/master/ember-cli-build.js#L19-L38) when using Embroider!\n\n\nInstallation\n------------------------------------------------------------------------------\n\nInstalling ember-cli-yadda is a breeze. All you need to do is run the following command in your project directory.\n\n```sh\nember install ember-cli-yadda\n```\n\nThis adds the following files:\n\n```\n/tests/acceptance/steps/steps.js\n/tests/integration/steps/steps.js\n/tests/unit/steps/steps.js\n/tests/helpers/yadda-annotations.js\n```\n\nYou may specify the version of yadda by adding it in package.json and running `npm install`.\n\n## Upgrading\n\nSee the [Release Notes](https://github.com/albertjan/ember-cli-yadda/releases).\n\n## Usage\n\nThe following describes the specific features and Ember integration points of ember-cli-yadda. For general documentation\non how to write yadda-based tests please consult the [Yadda User Guide](https://acuminous.gitbooks.io/yadda-user-guide/en/).\n\n### Creating feature files\n\nThis ember-cli addon provides you with a blueprint with which you can create feature files:\n\n```sh\nember g feature [feature title] --type=[acceptance|integration|unit]\n```\n\n#### Acceptance tests\n\nFor acceptance tests you can omit the `--type`  option. So you can use `ember g feature [feature title]` which generates\na feature file for your acceptance tests and a step definition.\n\nFor example:\n\n```sh\nember g feature make-a-feature\n```\n\nThis will generate the following files in your project directory:\n\n```\n/tests/acceptance/steps/make-a-feature-steps.js\n/tests/acceptance/make-a-feature.feature\n```\n\n#### Integration or unit tests\n\nTo create an integration or unit test, you can use `ember g feature [feature title] --type=integration` for an\nintegration test, or `--type=unit` for a unit test. This generates a feature and step definition file where you can\nwrite your tests.\n\nFor example:\n\n```sh\nember g feature make-a-feature --type=unit\n```\n\nThis will generate the following files in your project directory:\n\n```\n/tests/unit/steps/make-a-feature-steps.js\n/tests/unit/make-a-feature.feature\n```\n\n### Writing tests\n\nLet's take this example of an acceptance test feature:\n\n```gherkin\n@setupApplicationTest\nFeature: bananas rot\n\n  Scenario: bananas rot faster when next to apples\n    Given I have a bananas\n    And it's next to an apples\n    When left together for a while\n    Then the banana rots\n```\n\nThe `@setupApplicationTest` annotation will setup all scenarios of this feature as application tests, using the\n`setupApplicationTest()` function provided by either `ember-qunit` or `ember-mocha`. See the [Annotations](#annotations)\nsection below for more information on how to setup your tests.\n\nBecause we probably have more features about bananas, we add the `Given I have bananas` to the global steps file:\n`/tests/acceptance/steps.js`\n\n```js\nimport yadda from 'yadda';\nimport { visit } from '@ember/test-helpers';\n\nexport default function(assert) {\n  return yadda.localisation.default.library()\n    .given(\"I have bananas\", async function() {\n      await visit(\"/bananas\");\n    });\n}\n```\n\n*Notice that the preferable way to handle asynchronous steps like the one above is to use `async`/ `await`. But you can\nalso explicitly return a promise or use a `next()` [callback](https://acuminous.gitbooks.io/yadda-user-guide/en/usage/step-libraries.html).*\n\nThe fact that \"it's next to apples\" is probably unique to this Feature so we'll add it to the feature specific step definitions in `/tests/acceptance/steps/bananas-rot-feature-steps.js`. That will look like this:\n\n```js\nimport steps from './steps';\n\n// step definitions that are shared between features should be moved to the\n// tests/accptance/steps/steps.js file\n\nexport default function(assert) {\n  return steps(assert)\n    .given('it\\'s next to apples', function() {\n      let apples = this.element.querySelectorAll('.apple');\n      assert.ok(apples.length \u003e 0)\n    })\n    .when('left together for a while', function(next) {\n      // bananas rot really quickly next to apples.\n      setTimeout(next, 1000);\n    })\n    .then('the banana rots', function () {\n      let banana = this.element.querySelector('.banana');\n      assert.ok(banana.classList.contains('rotten'));\n    });\n}\n```\n\n#### Important information\n\n##### Scope and helpers\n\nember-cli-yadda passes the original scope down to each step definition. This means that you have access to the same\ncontext (like `this.element` or `this.owner`) and helpers from `@ember/test-helpers` (like `click()`), as you did when\nwriting a normal test in QUnit/Mocha.\n\n##### Sharing variables between steps\n\nYou can easily share variables between your steps, by either creating a new variable outside your step chain, or by storing the values in `this.ctx` in each step.\n\nFor Example:\n```js\n  import steps from './steps';\n\n  // Variable outside step chain\n  let something = '';\n\n  export default function(assert) {\n    return steps(assert)\n      .given('I add something to the context', function() {\n        // Assign 'hello' to the variable outside the step chain\n        something = 'hello';\n        // Assign 'there' to a new variable in `this.ctx`\n        this.ctx.something = 'there';\n        assert.ok(true, this.step);\n      })\n      .then('it should be there in the next step', function() {\n        // Do an assertion to check that 'there' has been passed correctly\n        // to the next step\n        assert.equal(this.ctx.something, 'there', this.step);\n      })\n      .then('external variable should be there in the next step', function(){\n        // Assert that the external variable still holds the information\n        // we set in the first step\n        assert.equal(something,'hello',this.step);\n      });\n  }\n```\n\n### Annotations\n\nYou already saw the use of the `@setupApplicationTest` annotation in the example feature file above.\nYadda's [support for annotations](https://acuminous.gitbooks.io/yadda-user-guide/en/feature-specs/annotations.html) can\nbe used to customize the way tests are run.\n\nThe implementation for the way certain annotations affect your tests lives in the `tests/yadda-annotations.js` file.\nThe addon installs this file with a default implementation as described below, but you can freely customize it at your\nwill.\n\n#### Skipping tests\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\nYou can skip tests by adding the `@ignore` annotation above the Scenario or Feature.\n\n#### Test suites\n\nYou can set `ENV.annotations` to an array of annotations (either statically or e.g. by assigning them from an\nenvironment variable like `process.env.ANNOTATIONS`). This will then run only those Features or Scenarios that have one\nof these annotations assigned.\n\n#### Setup tests\n\nFor each of the setup functions already known from `ember-qunit` or `ember-mocha`, there exists a corresponding\nannotation to setup your Feature/Scenario accordingly:\n\n- `@setupTest` for (unit) tests requiring the DI container of Ember to be set up\n- `@setupRenderingTest` for (integration) tests allowing you to call `render`, e.g. for component tests\n- `@setupApplicationTest` for (acceptance) tests requiring the whole application to be booted\n\n#### Customization\n\nYou can customize how annotations are handled in your app's `tests/yadda-annotations.js` file, e.g. to add support for\nadditional annotations, or extend the existing ones. This module has to export these hooks, that are called by this\naddon's test runner:\n\n- `runFeature`: called for each feature. If you return a function, this will be called to run the feature, instead of\n  the default implementation.\n- `runScenario`: similar to `runFeature`, but called for each scenario.\n- `setupFeature`: called for each feature to setup the test environment. You can call QUnit's or Mocha's `beforeEach`\n  and `afterEach` functions here to add custom setup/teardown work.\n- `setupScenario`: similar to `setupFeature`, but called for each scenario.\n\nHave a look at the existing implementation and the comments present in your `tests/yadda-annotations.js` file!\n\nHere is an example to extend the defaul implementation of the `@setupApplicationTest` annotation to also call the\n`setupMirage()` function provided by `ember-cli-mirage` to setup the Mirage server:\n\n```js\nimport setupMirage from 'ember-cli-mirage/test-support/setup-mirage';\n\n// your existing tests/yadda-annotations.js file...\n\nfunction setupYaddaTest(annotations) {\n  if (annotations.setupapplicationtest) { // lower case!\n    return function(hooks) {\n      setupApplicationTest(hooks);\n      setupMirage(hooks);\n    }\n  }\n  // ...\n}\n```\n\n### Yadda Configuration\nIf you need to set Yadda configuration, add the following to `ember-cli-build.js`:\n\n```javascript\nmodule.exports = function(defaults) {\n  let app = new EmberApp(defaults, {\n\n    'ember-cli-yadda': {\n      yaddaOptions: { // passed through to yadda parseFeature()\n        language: 'Polish', // converted to Yadda.localisation.Polish\n        leftPlaceholderChar: '\u003c',\n        rightPlaceholderChar: '\u003e'\n      }\n\n    }\n  });\n```\nSee [yadda FeatureParser](https://github.com/acuminous/yadda/blob/master/lib/parsers/FeatureParser.js#L8) for yadda options.\n\n## Inner workings\n\nThis ember addon registers a preprocessor that parses `.feature` / `.spec` / `.specification` files using [yadda](https://github.com/acuminous/yadda) and generates a `-test.js` file in the apropriate test folder. It also adds a little loader helper ``/tests/helpers/yadda.js`` because yadda does not define an amd module.\n\nThe addon also adds ES6 modules `/tests/[type]/steps/steps` you can extend in feature specific step definitions. Any shared step definitions should be moved to these file or included there, depending on the type of test you are running. Feature specific step definitions reside in ``/tests/[type]/steps/``. The generated feature test js files import a ``/tests/[type]/steps/[feature title]-steps`` module, where type can either be `acceptance`, `integration` or `unit`.\n\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliber5%2Fember-cli-yadda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliber5%2Fember-cli-yadda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliber5%2Fember-cli-yadda/lists"}