improve waitForElement

This commit is contained in:
Karsten Hassel
2022-01-13 21:12:15 +01:00
parent 42b80b18f8
commit 2cfafe7bfe
12 changed files with 129 additions and 108 deletions

View File

@@ -3,15 +3,16 @@ const helpers = require("../global-setup");
describe("Alert module", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/alert/default.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done);
});
afterAll(function () {
helpers.stopApplication();
});
it("should show the welcome message", function () {
const elem = document.querySelector(".ns-box .ns-box-inner .light.bright.small");
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("Welcome, start was successful!");
helpers.waitForElement(".ns-box .ns-box-inner .light.bright.small").then((elem) => {
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("Welcome, start was successful!");
});
});
});