mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #728 from roramirez/global-setup-test
Refactoring some e2e tests.
This commit is contained in:
commit
c4435279de
@ -1,25 +1,5 @@
|
|||||||
const Application = require("spectron").Application;
|
const globalSetup = require("./global-setup");
|
||||||
const path = require("path");
|
const app = globalSetup.app;
|
||||||
const chai = require("chai");
|
|
||||||
const chaiAsPromised = require("chai-as-promised");
|
|
||||||
|
|
||||||
var electronPath = path.join(__dirname, "../../", "node_modules", ".bin", "electron");
|
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
electronPath += ".cmd";
|
|
||||||
}
|
|
||||||
|
|
||||||
var appPath = path.join(__dirname, "../../js/electron.js");
|
|
||||||
|
|
||||||
var app = new Application({
|
|
||||||
path: electronPath,
|
|
||||||
args: [appPath]
|
|
||||||
});
|
|
||||||
|
|
||||||
global.before(function () {
|
|
||||||
chai.should();
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Electron app environment", function () {
|
describe("Electron app environment", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
34
tests/e2e/global-setup.js
Normal file
34
tests/e2e/global-setup.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Magic Mirror
|
||||||
|
*
|
||||||
|
* Global Setup Test Suite
|
||||||
|
*
|
||||||
|
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
|
||||||
|
* MIT Licensed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Application = require("spectron").Application;
|
||||||
|
const path = require("path");
|
||||||
|
const chai = require("chai");
|
||||||
|
const chaiAsPromised = require("chai-as-promised");
|
||||||
|
|
||||||
|
var electronPath = path.join(__dirname, "../../", "node_modules", ".bin", "electron");
|
||||||
|
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
electronPath += ".cmd";
|
||||||
|
}
|
||||||
|
|
||||||
|
var appPath = path.join(__dirname, "../../js/electron.js");
|
||||||
|
|
||||||
|
var app = new Application({
|
||||||
|
path: electronPath,
|
||||||
|
args: [appPath]
|
||||||
|
});
|
||||||
|
|
||||||
|
global.before(function () {
|
||||||
|
chai.should();
|
||||||
|
chai.use(chaiAsPromised);
|
||||||
|
});
|
||||||
|
|
||||||
|
exports.app = app;
|
@ -1,25 +1,5 @@
|
|||||||
const Application = require("spectron").Application;
|
const globalSetup = require("../global-setup");
|
||||||
const path = require("path");
|
const app = globalSetup.app;
|
||||||
const chai = require("chai");
|
|
||||||
const chaiAsPromised = require("chai-as-promised");
|
|
||||||
|
|
||||||
var electronPath = path.join(__dirname, "../../../", "node_modules", ".bin", "electron");
|
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
electronPath += ".cmd";
|
|
||||||
}
|
|
||||||
|
|
||||||
var appPath = path.join(__dirname, "../../../js/electron.js");
|
|
||||||
|
|
||||||
var app = new Application({
|
|
||||||
path: electronPath,
|
|
||||||
args: [appPath]
|
|
||||||
});
|
|
||||||
|
|
||||||
global.before(function () {
|
|
||||||
chai.should();
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Clock set to spanish language module", function () {
|
describe("Clock set to spanish language module", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,25 +1,5 @@
|
|||||||
const Application = require("spectron").Application;
|
const globalSetup = require("../global-setup");
|
||||||
const path = require("path");
|
const app = globalSetup.app;
|
||||||
const chai = require("chai");
|
|
||||||
const chaiAsPromised = require("chai-as-promised");
|
|
||||||
|
|
||||||
var electronPath = path.join(__dirname, "../../../", "node_modules", ".bin", "electron");
|
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
electronPath += ".cmd";
|
|
||||||
}
|
|
||||||
|
|
||||||
var appPath = path.join(__dirname, "../../../js/electron.js");
|
|
||||||
|
|
||||||
var app = new Application({
|
|
||||||
path: electronPath,
|
|
||||||
args: [appPath]
|
|
||||||
});
|
|
||||||
|
|
||||||
global.before(function () {
|
|
||||||
chai.should();
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Clock module", function () {
|
describe("Clock module", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,26 +1,7 @@
|
|||||||
const Application = require("spectron").Application;
|
const globalSetup = require("../global-setup");
|
||||||
const path = require("path");
|
const app = globalSetup.app;
|
||||||
const chai = require("chai");
|
const chai = require("chai");
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const chaiAsPromised = require("chai-as-promised");
|
|
||||||
|
|
||||||
var electronPath = path.join(__dirname, "../../../", "node_modules", ".bin", "electron");
|
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
electronPath += ".cmd";
|
|
||||||
}
|
|
||||||
|
|
||||||
var appPath = path.join(__dirname, "../../../js/electron.js");
|
|
||||||
|
|
||||||
var app = new Application({
|
|
||||||
path: electronPath,
|
|
||||||
args: [appPath]
|
|
||||||
});
|
|
||||||
|
|
||||||
global.before(function () {
|
|
||||||
chai.should();
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Compliments module", function () {
|
describe("Compliments module", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,25 +1,5 @@
|
|||||||
const Application = require("spectron").Application;
|
const globalSetup = require("../global-setup");
|
||||||
const path = require("path");
|
const app = globalSetup.app;
|
||||||
const chai = require("chai");
|
|
||||||
const chaiAsPromised = require("chai-as-promised");
|
|
||||||
|
|
||||||
var electronPath = path.join(__dirname, "../../../", "node_modules", ".bin", "electron");
|
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
|
||||||
electronPath += ".cmd";
|
|
||||||
}
|
|
||||||
|
|
||||||
var appPath = path.join(__dirname, "../../../js/electron.js");
|
|
||||||
|
|
||||||
var app = new Application({
|
|
||||||
path: electronPath,
|
|
||||||
args: [appPath]
|
|
||||||
});
|
|
||||||
|
|
||||||
global.before(function () {
|
|
||||||
chai.should();
|
|
||||||
chai.use(chaiAsPromised);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("Test helloworld module", function () {
|
describe("Test helloworld module", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user