Merge branch 'develop' into feature/automated-weather-tests

# Conflicts:
#	modules/default/weather/weather.js
#	package-lock.json
#	package.json
This commit is contained in:
fewieden
2019-09-11 13:07:31 +02:00
121 changed files with 6959 additions and 4195 deletions

View File

@@ -1,13 +1,8 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
const beforeEach = global.beforeEach;
const afterEach = global.afterEach;
describe("Development console tests", function() {
// This tests fail and crash another tests

View File

@@ -1,7 +1,5 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;

View File

@@ -1,14 +1,9 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const forEach = require("mocha-each");
const describe = global.describe;
const it = global.it;
const beforeEach = global.beforeEach;
const afterEach = global.afterEach;
const forEach = require("mocha-each");
describe("All font files from roboto.css should be downloadable", function() {
helpers.setupTimeout(this);
@@ -18,7 +13,7 @@ describe("All font files from roboto.css should be downloadable", function() {
var fileContent = require("fs").readFileSync(__dirname + "/../../fonts/roboto.css", "utf8");
var regex = /\burl\(['"]([^'"]+)['"]\)/g;
var match = regex.exec(fileContent);
while (match != null) {
while (match !== null) {
// Push 1st match group onto fontFiles stack
fontFiles.push(match[1]);
// Find the next one

View File

@@ -12,7 +12,6 @@ const Application = require("spectron").Application;
const assert = require("assert");
const chai = require("chai");
const chaiAsPromised = require("chai-as-promised");
const path = require("path");
global.before(function() {

View File

@@ -1,7 +1,5 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
@@ -17,7 +15,7 @@ describe("ipWhitelist directive configuration", function () {
beforeEach(function () {
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
}).then(function (startedApp) { app = startedApp; });
});
afterEach(function () {

View File

@@ -1,10 +1,6 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const serverBasicAuth = require("../../servers/basic-auth.js");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
const beforeEach = global.beforeEach;
@@ -72,7 +68,7 @@ describe("Calendar module", function() {
});
});
describe("Basic auth backward compatibilty configuration: DEPRECATED", function() {
describe("Basic auth backward compatibility configuration: DEPRECATED", function() {
before(function() {
serverBasicAuth.listen(8012);
// Set config sample for use in test

View File

@@ -1,8 +1,4 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
@@ -86,5 +82,4 @@ describe("Clock set to spanish language module", function() {
.getText(".clock .week").should.eventually.match(weekRegex);
});
});
});

View File

@@ -1,8 +1,4 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;

View File

@@ -1,7 +1,4 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;

View File

@@ -1,8 +1,4 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
@@ -24,7 +20,6 @@ describe("Test helloworld module", function() {
});
});
afterEach(function() {
return helpers.stopApplication(app);
});
@@ -52,5 +47,4 @@ describe("Test helloworld module", function() {
.getText(".helloworld").should.eventually.equal("Hello World!");
});
});
});

View File

@@ -1,8 +1,4 @@
const helpers = require("../global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;

View File

@@ -1,13 +1,7 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
const beforeEach = global.beforeEach;
const afterEach = global.afterEach;
describe("Position of modules", function () {
helpers.setupTimeout(this);
@@ -25,8 +19,7 @@ describe("Position of modules", function () {
process.env.MM_CONFIG_FILE = "tests/configs/modules/positions.js";
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
}).then(function (startedApp) { app = startedApp; });
});
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third",
@@ -44,5 +37,4 @@ describe("Position of modules", function () {
});
}
});
});

View File

@@ -1,7 +1,5 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
@@ -17,7 +15,7 @@ describe("port directive configuration", function () {
beforeEach(function () {
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
}).then(function (startedApp) { app = startedApp; });
});
afterEach(function () {
@@ -38,7 +36,7 @@ describe("port directive configuration", function () {
});
});
describe("Set port 8100 on enviroment variable MM_PORT", function () {
describe("Set port 8100 on environment variable MM_PORT", function () {
before(function () {
process.env.MM_PORT = 8100;
// Set config sample for use in this test
@@ -56,5 +54,4 @@ describe("port directive configuration", function () {
});
});
});
});

View File

@@ -121,8 +121,7 @@ describe("Translations", function() {
throw e;
}
}
})
});
});
}
});

View File

@@ -1,7 +1,5 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
@@ -11,7 +9,6 @@ const after = global.after;
describe("Vendors", function () {
return; // Test still getting failed in Travis
helpers.setupTimeout(this);
@@ -20,7 +17,7 @@ describe("Vendors", function () {
before(function () {
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
}).then(function (startedApp) { app = startedApp; });
});
after(function () {
@@ -42,5 +39,14 @@ describe("Vendors", function () {
});
});
});
Object.keys(vendors).forEach(vendor => {
it(`should return 404 HTTP code for vendor https://localhost/"${vendor}"`, function() {
urlVendor = "http://localhost:8080/" + vendors[vendor];
request.get(urlVendor, function (err, res, body) {
expect(res.statusCode).to.equal(404);
});
});
});
});
});

View File

@@ -1,8 +1,4 @@
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
@@ -17,7 +13,7 @@ describe("Check configuration without modules", function () {
beforeEach(function () {
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
}).then(function (startedApp) { app = startedApp; });
});
afterEach(function () {
@@ -31,13 +27,12 @@ describe("Check configuration without modules", function () {
it("Show the message MagicMirror title", function () {
return app.client.waitUntilWindowLoaded()
.getText("#module_1_helloworld .module-content").should.eventually.equal("Magic Mirror2")
.getText("#module_1_helloworld .module-content").should.eventually.equal("Magic Mirror2");
});
it("Show the text Michael's website", function () {
return app.client.waitUntilWindowLoaded()
.getText("#module_5_helloworld .module-content").should.eventually.equal("www.michaelteeuw.nl");
});
});