]> git.donarmstrong.com Git - dactyl.git/blob - common/tests/functional/testVersionCommand.js
Initial import of 1.0~b6
[dactyl.git] / common / tests / functional / testVersionCommand.js
1 var dactyllib = require("utils").module("dactyl");
2
3 var setupModule = function (module) {
4     controller = mozmill.getBrowserController();
5     dactyl = new dactyllib.Controller(controller);
6 };
7
8 var teardownModule = function (module) {
9     dactyl.teardown();
10 }
11
12 var setupTest = function (test) {
13     dactyl.closeMessageWindow();
14 };
15
16 var testVersionCommand_NoArg_VersionStringDisplayed = function () {
17     const EXPECTED_OUTPUT = RegExp(dactyl.applicationName + ".+ (.+) running on:.+"); // XXX
18
19     dactyl.runExCommand("version");
20
21     dactyl.assertMessageWindow(EXPECTED_OUTPUT);
22 };
23
24 var testVersionCommand_BangArg_HostAppVersionPageDisplayed = function () {
25     const EXPECTED_URL = "about:";
26     const EXPECTED_TITLE = "About:";
27     const BLANK_PAGE_URL = "about:blank";
28
29     controller.open(BLANK_PAGE_URL);
30     controller.waitForPageLoad(controller.tabs.activeTab);
31     dactyl.runExCommand("version!");
32     controller.waitForPageLoad(controller.tabs.activeTab);
33
34     controller.assert(function () controller.tabs.activeTab.location.href === EXPECTED_URL);
35     controller.assert(function () controller.tabs.activeTab.title === EXPECTED_TITLE);
36 };
37
38 // vim: sw=4 ts=8 et: