Skip to content

Commit

Permalink
Test: check existence of the start button (related to #34)
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Mar 5, 2015
1 parent f02c7ac commit a23e7c5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* See license.txt for terms of usage */

"use strict";

const { main } = require("../index.js");
const { resolve } = require("sdk/core/promise");

/**
* Load Pixel Perfect add-on.
*/
function loadPixelPerfect() {
main({loadReason: "install"});
return resolve();
};

// Exports from this module
exports.loadPixelPerfect = loadPixelPerfect;
21 changes: 21 additions & 0 deletions test/test-start-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* See license.txt for terms of usage */

"use strict";

const { StartButton } = require("../lib/start-button.js");
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
const { loadPixelPerfect } = require("./common.js");

/**
* Check that the start button is available in Firefox toolbar.
*/
exports["test Start Button"] = function(assert, done) {
loadPixelPerfect().then(() => {
let browser = getMostRecentBrowserWindow();
let element = StartButton.getButton(browser.document);
assert.ok(element, "The start button must be available");
done();
});
};

require("sdk/test").run(exports);

0 comments on commit a23e7c5

Please sign in to comment.