{"action":"created","issue":{"url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/226","repository_url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs","labels_url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/226/comments","events_url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/226/events","html_url":"https://github.com/nathanboktae/mocha-phantomjs/issues/226","id":134410750,"number":226,"title":"Use this as a bridge?","user":{"login":"dschinkel","id":338798,"avatar_url":"https://avatars.githubusercontent.com/u/338798?v=3","gravatar_id":"","url":"https://api.github.com/users/dschinkel","html_url":"https://github.com/dschinkel","followers_url":"https://api.github.com/users/dschinkel/followers","following_url":"https://api.github.com/users/dschinkel/following{/other_user}","gists_url":"https://api.github.com/users/dschinkel/gists{/gist_id}","starred_url":"https://api.github.com/users/dschinkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschinkel/subscriptions","organizations_url":"https://api.github.com/users/dschinkel/orgs","repos_url":"https://api.github.com/users/dschinkel/repos","events_url":"https://api.github.com/users/dschinkel/events{/privacy}","received_events_url":"https://api.github.com/users/dschinkel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T21:48:26Z","updated_at":"2016-02-17T22:57:17Z","closed_at":"2016-02-17T22:57:17Z","body":"So is mocha-phantomjs a phantom-to-node bridge?  \r\n\r\nIf so, if I want to start using the Phantom API, what syntax should I use?  I mean there are other bridges out there like phantomjs-node which have their own wrapper syntax but what if I'm using mocha-phantomjs?\r\n\r\nexample lets say I want to do this in my some-spec.js:\r\n\r\n```\r\nbefore(function() {\r\n    phantom.create().then(function(ph) {\r\n        ph.createPage().then(function(page) {\r\n            page.open('https://stackoverflow.com/').then(function(status) {\r\n                status = status\r\n            })\r\n        });\r\n    });\r\n})\r\n```\r\n\r\nthe above is phantomjs-node syntax as I have phantom = require('phantom') at the top of my file.  So would I use phantomjs-node in conjunction with mocha-phantomjs or what?  \r\n\r\nI'm able to run my tests through my test-runner.html but then I really just want to run this via command-line like I have been which is mocha-phantomjs test/features/specs/test-runner.html which works as in I can get my test to pass without the phantom api stuff.  Once I try to introduce the phantom code above, it bombs after I bundle my spec."},"comment":{"url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/comments/185448038","html_url":"https://github.com/nathanboktae/mocha-phantomjs/issues/226#issuecomment-185448038","issue_url":"https://api.github.com/repos/nathanboktae/mocha-phantomjs/issues/226","id":185448038,"user":{"login":"nathanboktae","id":1989335,"avatar_url":"https://avatars.githubusercontent.com/u/1989335?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanboktae","html_url":"https://github.com/nathanboktae","followers_url":"https://api.github.com/users/nathanboktae/followers","following_url":"https://api.github.com/users/nathanboktae/following{/other_user}","gists_url":"https://api.github.com/users/nathanboktae/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanboktae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanboktae/subscriptions","organizations_url":"https://api.github.com/users/nathanboktae/orgs","repos_url":"https://api.github.com/users/nathanboktae/repos","events_url":"https://api.github.com/users/nathanboktae/events{/privacy}","received_events_url":"https://api.github.com/users/nathanboktae/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T22:57:17Z","updated_at":"2016-02-17T22:57:17Z","body":"> So is mocha-phantomjs a phantom-to-node bridge?\r\n\r\nNo, it's not. It's a way to use phantomjs as your browser to test your **client side** mocha tests in that browser. Node.js is used as the command line parser and npm as the distribution mechanism, but that's it. The core brains is in [mocha-phantomjs-core](https://github.com/nathanboktae/mocha-phantomjs-core) which that project has no Node.js\r\n\r\nMocha runs in the browser, so you write browser tests in Mocha. Just as if you were to run your browser tests in mocha by opening Chrome and going to `file://foo/bar/tests.html` or whatever the URL is, you instead use `mocha-phantomjs` to run those client side tests and output the results using other mocha reporters to the console.\r\n\r\nIf you want to write tests where your driving phantom clicking a page, there are other drivers for it like you linked to zombie.js or whatnot."}}