A simple interface to use the Zombie.js(Node.js) framework with PHPUnit for functional testing.
- Execute Zombie.js functional tests in PHPUnit
- Tests run in parallel and are easily scaled
- Allows for using the latest version of Node.js and Zombie.js
- Node.js (tested with version 0.10.21)
- Zombie.js (tested with version 2.0.0-alpha24)
- Q (tested with version 0.9.7)
npm install zombie q
- Modify the existing test case to point to the correct Node execution path and test URL
- Tests should inherit from the TestCase class and be placed in zombie/tests
- Run all tests in PHPUnit, or run a specific test with:
node TestInterface.js http://localhost Path/To/YourTest.js
var TestCase = require('../TestCase'); //load base test class
function ExampleTest() {
} //create new test class
ExampleTest.prototype = new TestCase(__filename); //inherit from base test class
//override required run function
ExampleTest.prototype.run = function(browser, baseUrl) {
//TODO: run your test and call either this.pass() or this.fail('reason')
return this.deferred.promise;
};
module.exports = ExampleTest;