2017-07-24 22:08:12 +02:00
|
|
|
const helpers = require("./global-setup");
|
|
|
|
const expect = require("chai").expect;
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
const describe = global.describe;
|
|
|
|
const it = global.it;
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Development console tests", function () {
|
2020-04-21 10:37:24 +02:00
|
|
|
// FIXME: This tests fail and crash another tests
|
2017-07-24 22:08:12 +02:00
|
|
|
// Suspect problem with window focus
|
2017-07-20 00:25:10 -04:00
|
|
|
return false;
|
|
|
|
|
2020-04-21 10:37:24 +02:00
|
|
|
/* eslint-disable */
|
2017-07-24 22:08:12 +02:00
|
|
|
helpers.setupTimeout(this);
|
|
|
|
|
2021-04-08 21:12:56 +02:00
|
|
|
let app = null;
|
2017-07-24 22:08:12 +02:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
before(function () {
|
2017-02-05 11:38:01 +01:00
|
|
|
// Set config sample for use in test
|
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
|
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Without 'dev' commandline argument", function () {
|
|
|
|
before(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
})
|
2020-05-11 22:22:32 +02:00
|
|
|
.then(function (startedApp) {
|
2017-07-24 22:08:12 +02:00
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
after(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2020-05-11 22:22:32 +02: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
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("With 'dev' commandline argument", function () {
|
|
|
|
before(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js", "dev"]
|
|
|
|
})
|
2020-05-11 22:22:32 +02:00
|
|
|
.then(function (startedApp) {
|
2017-07-24 22:08:12 +02:00
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
after(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2020-05-11 22:22:32 +02: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
|
|
|
});
|