{"id":17062354,"url":"https://github.com/devpaul/node-bdd-example","last_synced_at":"2025-04-12T18:13:09.235Z","repository":{"id":9693429,"uuid":"11641437","full_name":"devpaul/node-bdd-example","owner":"devpaul","description":"example bdd with node.js","archived":false,"fork":false,"pushed_at":"2013-12-02T18:56:43.000Z","size":135,"stargazers_count":5,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:13:02.419Z","etag":null,"topics":["bdd","cucumberjs","testing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Azure/azure-content","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devpaul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-24T17:57:50.000Z","updated_at":"2023-01-29T15:40:05.000Z","dependencies_parsed_at":"2022-09-06T22:21:00.442Z","dependency_job_id":null,"html_url":"https://github.com/devpaul/node-bdd-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fnode-bdd-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fnode-bdd-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fnode-bdd-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fnode-bdd-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devpaul","download_url":"https://codeload.github.com/devpaul/node-bdd-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610341,"owners_count":21132919,"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":["bdd","cucumberjs","testing"],"created_at":"2024-10-14T10:49:46.844Z","updated_at":"2025-04-12T18:13:09.211Z","avatar_url":"https://github.com/devpaul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Node BDD Example\nSure you want to join the magical pony ride that is BDD! But how?\n\nThis repository helps to answer that question entirely within the [nodejs] ecosystem.  I use [grunt] with the\n[grunt-cucumber] task to drive [cucumber-js], our BDD/[Gherkin] framework, extended with the [cucumber-wd-plugin] and\ndriven with [wd], the nodejs [selenium] web driver, so [Chrome] terminates cleanly on [saucelabs].\n\nIt sounds complicated, but after the initial setup things are pretty straight-forward.\n\n## Try it out\nIf you don't already have it installed you'll need [nodejs] and [grunt-cli] and a [selenium] server.  I use [saucelabs]\nas my Selenium server, but you can also use this [vagrant selenium grid](https://github.com/cdegroot/vagrant-selenium-grid)\nif you would like to run it locally. Feel free to [contact me][Twitter] if you'd like or [send me a pull request][repo].\n\nYou'll need to set the environment variables `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`. Here's the too-cool-for-school\nway:\n\n```\n    npm install\n    SAUCE_USERNAME=\u003cusername\u003e SAUCE_ACCESS_KEY=\u003caccess key\u003e grunt test\n```\n\nIf you have an issue setting environment variables you can set your username and access key directly in testConfig.js.\nThen you can just run\n```\n    npm install\n    grunt test\n```\n\n## Overview\nIf you ran the example then you should see an automated Google search.  This scenario is defined in the\nfile `Search.feature` using language that you might typically see a user use to explain what they are doing.\n\nCucumber takes that and uses implemented steps under `step_definitions` to map the natural language feature description\nto some code.  It lets people and computers each speak their own language and makes me wonder why computer courses\ndidn't count for foreign language credit.\n\nThere is some magic involved with the `World` stuff, which [cucumber-js] explains better than I would. But it is\nthere to store your context while your scenario is executing.\n\nAnd `interfaces` has all of your page, well, interfaces.  Our UI interfaces are separated from our step implementations\nto reduce the brittleness of tests.  A lot of people have made a lot of money writing a lot of books about this stuff.\n\n## Update!\n[cucumber-js 0.3.2][cucumber0.3.2] provides preliminary \\[unstable api\\] support for plugins through the use of\n```registerListener``` in step definitions. Since the inclusion of this [pull request][pull], this example no longer\nneeds to use the forked version of cucumber and [cucumber-wd-plugin] and [cucumber-eavesdropper] can be used directly\nwith [cucumber-js].\n\n[wd]: https://github.com/admc/wd\n[cucumber-js]: https://github.com/cucumber/cucumber-js\n[grunt]: http://gruntjs.com/\n[grunt-cucumber]: https://github.com/s9tpepper/grunt-cucumber-js\n[cucumber-wd-plugin]: https://github.com/devpaul/cucumber-wd-plugin\n[saucelabs]: https://saucelabs.com\n[selenium]: http://docs.seleniumhq.org/\n[nodejs]: http://nodejs.org/\n[Chrome]: https://code.google.com/p/selenium/wiki/ChromeDriver\n[Gherkin]: https://github.com/cucumber/cucumber/wiki/Gherkin\n[grunt-cli]: http://gruntjs.com/getting-started\n[Twitter]: https://twitter.com/developerPaul\n[repo]: https://github.com/devpaul/node-bdd-example\n[pull]: https://github.com/cucumber/cucumber-js/pull/130\n[cucumber0.3.2]: https://github.com/cucumber/cucumber-js/releases/tag/v0.3.2\n[cucumber-wd-plugin]: https://github.com/devpaul/cucumber-wd-plugin\n[cucumber-eavesdropper]: https://github.com/devpaul/cucumber-eavesdropper-plugin","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaul%2Fnode-bdd-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevpaul%2Fnode-bdd-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaul%2Fnode-bdd-example/lists"}