{"id":7603,"date":"2015-09-14T17:15:29","date_gmt":"2015-09-14T17:15:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/09\/14\/alternative-to-casperjs-for-use-with-cucumber-js-open-source-projects-n1k0-casperjs\/"},"modified":"2015-09-14T17:15:29","modified_gmt":"2015-09-14T17:15:29","slug":"alternative-to-casperjs-for-use-with-cucumber-js-open-source-projects-n1k0-casperjs","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/09\/14\/alternative-to-casperjs-for-use-with-cucumber-js-open-source-projects-n1k0-casperjs\/","title":{"rendered":"Alternative to CasperJS for use with Cucumber.js-open source projects n1k0\/casperjs"},"content":{"rendered":"<p>After lots of research and trial and error I have chosen the following stack for Frontend BDD testing:<\/p>\n<ul>\n<li>Cucumber.js<\/li>\n<li>CasperJS (through SpookyJS)<\/li>\n<li>PhantomJS<\/li>\n<\/ul>\n<p>I would like to avoid CasperJS run queues and use PhantomJS directly (through phantom-proxy) with callbacks in each step:<\/p>\n<pre><code>@World = (cb) -&gt;\n    @phantom = require \"phantom-proxy\"\n    cb()\n\n@Before (cb) -&gt;\n    self = this\n    @phantom.create {}, (proxy) -&gt;\n        self.proxy = proxy\n        self.page = proxy.page\n        cb()\n\n@After (cb) -&gt;\n    @proxy.end -&gt;\n        cb()\n\n@When \/^I go to url \"([^\"]*)\"$\/, (url, cb) -&gt;\n    @page.open url, -&gt;\n        cb()\n<\/code><\/pre>\n<p>making the whole more logical and BDD-like.<\/p>\n<p>Additionally, SpookyJS doesn&#8217;t provide a full API for CasperJS.<\/p>\n<p>The PhantomJS API, however, is quite low-level. Is there any other tool that provides CasperJS-like functionality (clicking, waiting for elements, etc) for Node.js without using run queues?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After lots of research and trial and error I have chosen the following stack for Frontend BDD testing: Cucumber.js CasperJS (through SpookyJS) PhantomJS I would like to avoid CasperJS run queues and use PhantomJS directly (through phantom-proxy) with callbacks in each step: @World = (cb) -&gt; @phantom = require &#8220;phantom-proxy&#8221; cb() @Before (cb) -&gt; self [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7603","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7603"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7603\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}