MagicMirror/tests/e2e/dev_console.js
Karsten Hassel 67011c0c32 snapshot e2e
2021-06-08 00:47:40 +02:00

60 lines
1.5 KiB
JavaScript

const helpers = require("./global-setup");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
describe("Development console tests", function () {
helpers.setupTimeout(this);
let app = null;
beforeAll(function () {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
});
describe("Without 'dev' commandline argument", function () {
beforeAll(function () {
return helpers
.startApplication({
args: ["js/electron.js"]
})
.then(function (startedApp) {
app = startedApp;
});
});
afterAll(function () {
return helpers.stopApplication(app);
});
it("should not open dev console when absent", async function () {
await app.client.waitUntilWindowLoaded();
return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(false);
});
});
// describe("With 'dev' commandline argument", function () {
// beforeAll(function () {
// return helpers
// .startApplication({
// args: ["js/electron.js", "dev"]
// })
// .then(function (startedApp) {
// app = startedApp;
// });
// });
// afterAll(function () {
// return helpers.stopApplication(app);
// });
// it("should open dev console when provided", async function () {
// expect(await app.client.getWindowCount()).to.equal(2);
// await app.client.waitUntilWindowLoaded();
// return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(true);
// });
// });
});