gabarito-selenium
Selenium environment for gabarito.
TL;DR
Install dev dependencies.
npm install gabarito --save-dev
npm install gabarito-selenium --save-dev
Setup runner
// runner.js
var gabarito = require("gabarito");
var SeleniumEnvironment = require("gabarito-selenium");
// setup selenium environment
var seleniumCapabilities = {
browser: "firefox",
version: "47",
platform: "linux"
};
var seleniumHub = "localhost";
var gabaritoHost = "localhost";
var env = new SeleniumEnvironment(
seleniumCapabilities,
seleniumHub,
gabaritoHost);
// setup runner
var runner = new gabarito.plumbing.Runner();
runner.addEnvironment(env);
runner.addFile("test.js");
runner.addReporter(new gabarito.plumbing.ConsoleReporter());
runner.run(function (results) {
console.log(results);
});
The test.js file
// test.js
var assert = gabarito.assert;
gabarito.add("test").
clause("should pass", function () {
assert.isTrue(true);
}).
clause("should fail", function () {
assert.isTrue(false);
});
Run.
node runner.js