MagicMirror/tests/e2e/dev_console.js

63 lines
1.4 KiB
JavaScript
Raw Normal View History

const helpers = require("./global-setup");
const expect = require("chai").expect;
2017-02-05 11:38:01 +01:00
const describe = global.describe;
const it = global.it;
2017-02-05 11:38:01 +01:00
describe("Development console tests", function() {
2020-04-21 10:37:24 +02:00
// FIXME: This tests fail and crash another tests
// Suspect problem with window focus
return false;
2020-04-21 10:37:24 +02:00
/* eslint-disable */
helpers.setupTimeout(this);
var app = null;
2017-02-05 11:38:01 +01:00
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
});
describe("Without 'dev' commandline argument", function() {
before(function() {
return helpers
.startApplication({
args: ["js/electron.js"]
})
.then(function(startedApp) {
app = startedApp;
});
});
2017-02-05 11:38:01 +01:00
after(function() {
return helpers.stopApplication(app);
});
2017-02-05 11:38:01 +01:00
it("should not open dev console when absent", function() {
2017-02-07 22:29:51 +01:00
return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(false);
2017-02-05 11:38:01 +01:00
});
});
describe("With 'dev' commandline argument", function() {
before(function() {
return helpers
.startApplication({
args: ["js/electron.js", "dev"]
})
.then(function(startedApp) {
app = startedApp;
});
});
after(function() {
return helpers.stopApplication(app);
});
2017-02-05 11:38:01 +01:00
it("should open dev console when provided", function() {
2017-02-07 22:29:51 +01:00
return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(true);
2017-02-05 11:38:01 +01:00
});
});
2020-04-21 10:37:24 +02:00
/* eslint-enable */
2017-02-05 11:38:01 +01:00
});