{"action":"created","issue":{"url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/77","labels_url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/77/comments","events_url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/77/events","html_url":"https://github.com/xolvio/meteor-cucumber/issues/77","id":71578424,"number":77,"title":"Please help me better understand how to use Cucumber","user":{"login":"mbabauer","id":472616,"avatar_url":"https://avatars.githubusercontent.com/u/472616?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabauer","html_url":"https://github.com/mbabauer","followers_url":"https://api.github.com/users/mbabauer/followers","following_url":"https://api.github.com/users/mbabauer/following{/other_user}","gists_url":"https://api.github.com/users/mbabauer/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabauer/subscriptions","organizations_url":"https://api.github.com/users/mbabauer/orgs","repos_url":"https://api.github.com/users/mbabauer/repos","events_url":"https://api.github.com/users/mbabauer/events{/privacy}","received_events_url":"https://api.github.com/users/mbabauer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-28T12:37:27Z","updated_at":"2015-04-30T21:51:53Z","closed_at":null,"body":"This probably doesn't belong as an \"issue\", but I am not sure where else to post this.  I have tried getting help through StackOverflow with limited success, so I am hoping the folks here can help enlighten me.\r\n\r\nI am trying to get some end-to-end testing done using the meteor-cucumber package.  I am new to Cucumber, WebDriver.IO, and Chai, but I can read APIs so I thought I could muddle through this stuff.\r\n\r\nWhere I am struggling is that nothing seems to work the way it is documented.  For instance, in the meteor-cucumber README.MD it is states that Chai and Chai-as-promised is already loaded.  The Chai documentation [here](http://chaijs.com/guide/styles/) has an `assert`, but when I try something like this:\r\n```javascript\r\nthis.browser\r\n  .saveScreenshot('screenshots/afterNewClientDone.png')\r\n  .elements('.clientExpansionCaret', function(err, res) {\r\n    assert.isUndefined(err);\r\n    // do something...\r\n  });\r\n```\r\nI get an error saying:\r\n```\r\n    And I should be able to create a new Client named \"Test Client\" # features/admins_create_form.feature:15\r\n      ReferenceError: assert is not defined\r\n        at WebdriverIO.<anonymous> (/tests/cucumber/features/step_definitions/admin_client_steps.js:33:11)\r\n        at WebdriverIO.<anonymous> (/Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/lib/utils/PromiseHandler.js:152:26)\r\n        at /Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/node_modules/chainit/index.js:137:22\r\n        at RequestHandler.<anonymous> (/Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/lib/utils/RequestHandler.js:223:13)\r\n        at Request.self.callback (/Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/node_modules/request/request.js:121:22)\r\n        at Request.emit (events.js:98:17)\r\n        at Request.<anonymous> (/Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/node_modules/request/request.js:978:14)\r\n        at Request.emit (events.js:117:20)\r\n        at IncomingMessage.<anonymous> (/Users/mbauer/.meteor/packages/xolvio_cucumber/.0.6.6.1f7q5ye++os+web.browser+web.cordova/npm/node_modules/cuke-monkey/node_modules/webdriverio/node_modules/request/request.js:929:12)\r\n        at IncomingMessage.emit (events.js:117:20)\r\n        at _stream_readable.js:944:16\r\n        at process._tickDomainCallback (node.js:486:13)\r\n```\r\n\r\nSo, I tried adding `var assert = require('chai').assert;` at the top, but then the test runner freezes at `[xolvio:cucumber] Cucumber is running`  and never does anything.  The same happened when I tried to add underscore as well.\r\n\r\nPast that, I am getting strange results.  the `.elements()` example above passes a \"result\" object to the callback function, but the `results.value` doesn't look like a real DOM element, and none of the calls like `.getText()` or `.innerHTML` seem to work.  I have many other places where things just haven't seemed to work at all like the APIs seem to suggest they should.\r\n\r\nAs a single developer trying to incorporate this into my development, it is hard to justify to myself the benefits of spending time on these tests when I spend 3 days just trying to get a simple test done where I add something on the page and then click the newly added DOM elements.  Maybe some additional, more \"real-world\" examples would help by showing what good practices look like and how to handle certain situations in your tests?"},"comment":{"url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/comments/97981847","html_url":"https://github.com/xolvio/meteor-cucumber/issues/77#issuecomment-97981847","issue_url":"https://api.github.com/repos/xolvio/meteor-cucumber/issues/77","id":97981847,"user":{"login":"mbabauer","id":472616,"avatar_url":"https://avatars.githubusercontent.com/u/472616?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabauer","html_url":"https://github.com/mbabauer","followers_url":"https://api.github.com/users/mbabauer/followers","following_url":"https://api.github.com/users/mbabauer/following{/other_user}","gists_url":"https://api.github.com/users/mbabauer/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabauer/subscriptions","organizations_url":"https://api.github.com/users/mbabauer/orgs","repos_url":"https://api.github.com/users/mbabauer/repos","events_url":"https://api.github.com/users/mbabauer/events{/privacy}","received_events_url":"https://api.github.com/users/mbabauer/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T21:51:53Z","updated_at":"2015-04-30T21:51:53Z","body":"That's what I did.  I put the package.json under /test/cucumber, then did a `var _ = require('underscore')`.  I also tried with jquery and chai."}}