{"action":"closed","issue":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/827","repository_url":"https://api.github.com/repos/nightwatchjs/nightwatch","labels_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/827/labels{/name}","comments_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/827/comments","events_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/827/events","html_url":"https://github.com/nightwatchjs/nightwatch/issues/827","id":128250346,"node_id":"MDU6SXNzdWUxMjgyNTAzNDY=","number":827,"title":"Placing a client command into an async call prevents any browser from opening","user":{"login":"therebelrobot","id":679178,"node_id":"MDQ6VXNlcjY3OTE3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/679178?v=4","gravatar_id":"","url":"https://api.github.com/users/therebelrobot","html_url":"https://github.com/therebelrobot","followers_url":"https://api.github.com/users/therebelrobot/followers","following_url":"https://api.github.com/users/therebelrobot/following{/other_user}","gists_url":"https://api.github.com/users/therebelrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/therebelrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therebelrobot/subscriptions","organizations_url":"https://api.github.com/users/therebelrobot/orgs","repos_url":"https://api.github.com/users/therebelrobot/repos","events_url":"https://api.github.com/users/therebelrobot/events{/privacy}","received_events_url":"https://api.github.com/users/therebelrobot/received_events","type":"User","site_admin":false},"labels":[{"id":273348007,"node_id":"MDU6TGFiZWwyNzMzNDgwMDc=","url":"https://api.github.com/repos/nightwatchjs/nightwatch/labels/mocha","name":"mocha","color":"006b75","default":false},{"id":1127429030,"node_id":"MDU6TGFiZWwxMTI3NDI5MDMw","url":"https://api.github.com/repos/nightwatchjs/nightwatch/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-01-22T21:31:11Z","updated_at":"2018-11-21T19:30:01Z","closed_at":"2018-11-21T19:30:01Z","author_association":"NONE","body":"I'm using `bdd` testing with Mocha as the test runner. \n\nExample:\n\n``` js\nbeforeEach(function testUrl(browser, done){\n  var asyncTest = true\n  if(asyncTest){\n    setTimeout(function(){\n      console.log('timeout')\n      browser.url('http://google.com')\n      browser.pause(5000)\n      browser.url(function(results){\n        console.log('timeout UrlCall', results.value)\n        done()\n      })\n    }, 1000)\n  } else{\n    console.log('no timeout')\n    browser.url('http://google.com')\n    browser.pause(5000)\n    browser.url(function(results){\n      console.log('no timeout UrlCall', results.value)\n      done()\n    })\n  }\n})\n```\n\nif `var asyncTest = false`, the browser opens, it `console.log()`'s the url, and continues with the test. If it's set to `true`, and places it in a timeout, the browser never opens, and `browser.url(func)` hangs indefinitely, causing a timeout error.\n\nSpecifically, in my application, I'm running a population script, which asynchronously calls an external API with records that need to be shown in the view. Once that async call is done, the test should begin. It will run the population test, but the rest of the beforeEach (a login script in the browser), never gets run and fails the entire test.\n\nAm I just doing something wrong here? It seems like I _should_ be able to call `browser` commands in an async call... Maybe it relies on context? My way around it right now is to set it to run the async call parallel to any browser calls, and guessing as to how long I should `.pause()` the browser. \n\n<hr/>\n### Environment details:\n- Nightwatch version: `nightwatch v0.8.15`\n- Node.js version: `v5.3.0`\n- OS version: Mac OS X Yosemite 10.10.5 (14F27)\n- Selenium server version: 2.48.2\n- Chrome Webdriver version: `ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b)`\n"}}
{"actor":{"display_login":"stale"}}