MagicMirror/tests/e2e/modules_display_spec.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-08-01 12:20:16 +02:00
const helpers = require("./global-setup");
const describe = global.describe;
const it = global.it;
describe("Display of modules", function () {
helpers.setupTimeout(this);
var 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 () {
before(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 () => {
2021-01-30 20:29:59 +01:00
const elem = await app.client.$("#module_0_helloworld .module-header", 10000);
return elem.getText("#module_0_helloworld .module-header").should.eventually.equal("TEST_HEADER");
2020-08-01 12:20:16 +02:00
});
it("should show no header if no header text is specified", async () => {
2021-01-30 20:29:59 +01:00
const elem = await app.client.$("#module_1_helloworld .module-header", 10000);
return elem.getText("#module_1_helloworld .module-header").should.eventually.equal(false);
2020-08-01 12:20:16 +02:00
});
});
});