Tests and automation with PhantomJS and CasperJS Henrique Vicente https://github.com/henvic/phantom-casper-simple-talk https://speakerdeck.com/henvic/testes-e-automacao-com-phantomjs-e-casperjs 2nd-open-meeting-pernambucojs Saturday, August 24, 13
faster running integration tests web scraping automation (i.e., mass data insertions) remote rendering (e.g., make PDFs out of HTML + CSS templates to send by email) Saturday, August 24, 13
A WebKit based web stack with a JavaScript API WebKit + Qt, not Node.JS headless Remote debugging GhostDriver: web driver for Selenium Saturday, August 24, 13
page.evaluate() magic Executed code on the page (sandboxed) Like in: “a console.log(“foo”) inside evaluate() happens inside the page context, not like a console.log(“foo”) outside it” Saturday, August 24, 13
WebServer, child_process... WebServer Create a web server child_process Allows invoking of subprocesses and communicates with stdin / stdout / stderr Saturday, August 24, 13
Remote debugging Go to http://localhost:9000/ on a WebKit-based browser --remote-debugger-autorun=yes or __run() on the browser Saturday, August 24, 13
Testing framework developed with JS Works on top of PhantomJS, and now also on top of SlimerJS (which is similar to PhantomJS, but Gecko based) Has its own modules, like PhantomJS (and some just like it) Saturday, August 24, 13
Functional testing with CasperJS Verify if your WordPress install has the following things working out correctly: - login - loading the new post form from a button - form rich editor is opening - creating a post - etc Saturday, August 24, 13
End Tests and automation with PhantomJS and CasperJS Henrique Vicente https://github.com/henvic/phantom-casper-simple-talk https://speakerdeck.com/henvic/testes-e-automacao-com-phantomjs-e-casperjs 2nd-open-meeting-pernambucojs Saturday, August 24, 13