1 var dactyllib = require("utils").module("dactyl");
3 const FIND_TEST_PAGE = collector.addHttpResource("./data/") + "find.html";
5 var setupModule = function (module) {
6 controller = mozmill.getBrowserController();
7 dactyl = new dactyllib.Controller(controller);
10 var teardownModule = function (module) {
14 var setupTest = function (test) {
15 controller.open(FIND_TEST_PAGE);
16 controller.waitForPageLoad(controller.tabs.activeTab);
17 controller.sleep(1000);
20 var testFindCommand_PresentAlphabeticText_TextSelected = function () {
21 assertTextFoundInPage("letter")
24 var testFindCommand_PresentNumericText_TextSelected = function () {
25 assertTextFoundInPage("3.141")
28 var testFindCommand_MissingText_ErrorMessageDisplayed = function () {
29 const MISSING_TEXT = "8c307545a017f60add90ef08955e148e";
30 const PATTERN_NOT_FOUND_ERROR = "E486: Pattern not found: " + MISSING_TEXT;
32 runTextSearchCommand(MISSING_TEXT);
34 dactyl.assertErrorMessage(PATTERN_NOT_FOUND_ERROR);
37 function runTextSearchCommand(str) {
38 dactyl.runViCommand("/" + str);
39 dactyl.runViCommand([["VK_RETURN"]]);
44 function assertTextFoundInPage(text) {
45 runTextSearchCommand(text);
46 dactyl.assertSelection(text);