Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Improve the mochitest to wait for the button to appear before startin… (
Browse files Browse the repository at this point in the history
#2759)

* Improve the mochitest to wait for the button to appear before starting. Also use the mochitest config from the mozilla plugin to save specifying globals.

* Correctly enable the mozilla plugin for ESLint
  • Loading branch information
Standard8 authored and jaredhirsch committed Apr 27, 2017
1 parent 9392fe3 commit 5c6733e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parserOptions:
jsx: true

plugins:
- mozilla
- react
- promise

Expand Down
7 changes: 7 additions & 0 deletions test/addon/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

module.exports = {
"extends": [
"plugin:mozilla/browser-test"
]
}
7 changes: 4 additions & 3 deletions test/addon/browser_screenshots_ui_check.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"use strict";

/* global add_task, is, promiseScreenshotsEnabled, promiseScreenshotsReset,
registerCleanupFunction */

function checkElements(expectPresent, l) {
for (let id of l) {
is(!!document.getElementById(id), expectPresent, "element " + id + (expectPresent ? " is" : " is not") + " present");
Expand All @@ -16,5 +13,9 @@ add_task(function*() {
yield promiseScreenshotsReset();
});

yield BrowserTestUtils.waitForCondition(
() => document.getElementById("screenshots_mozilla_org-browser-action"),
"Screenshots button should be present", 100, 100);

checkElements(true, ["screenshots_mozilla_org-browser-action"]);
});

0 comments on commit 5c6733e

Please sign in to comment.