MagicMirror/tests/e2e/modules_display_spec.js
Karsten Hassel 0e14d3d6e8 snapshot e2e
2021-06-09 00:19:43 +02:00

42 lines
1.1 KiB
JavaScript

const helpers = require("./global-setup");
const describe = global.describe;
const it = global.it;
describe("Display of modules", function () {
helpers.setupTimeout(this);
let app = null;
beforeEach(function () {
return helpers
.startApplication({
args: ["js/electron.js"]
})
.then(function (startedApp) {
app = startedApp;
});
});
afterEach(function () {
return helpers.stopApplication(app);
});
describe("Using helloworld", function () {
beforeAll(function () {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/display.js";
});
it("should show the test header", async () => {
const elem = await app.client.$("#module_0_helloworld .module-header", 10000);
return (elem.getText("#module_0_helloworld .module-header") === "TEST_HEADER");
});
it("should show no header if no header text is specified", async () => {
const elem = await app.client.$("#module_1_helloworld .module-header", 10000);
return (elem.getText("#module_1_helloworld .module-header") === false);
});
});
});