From daad8bca69e9111473311037623355fb88da814f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?=
Date: Sun, 26 Mar 2017 17:36:45 -0300
Subject: [PATCH 1/2] Add test e2e helloworld module with default config text.
---
.../modules/helloworld/helloworld_default.js | 31 +++++++++++++++++++
tests/e2e/modules/helloworld_spec.js | 30 +++++++++++++-----
2 files changed, 54 insertions(+), 7 deletions(-)
create mode 100644 tests/configs/modules/helloworld/helloworld_default.js
diff --git a/tests/configs/modules/helloworld/helloworld_default.js b/tests/configs/modules/helloworld/helloworld_default.js
new file mode 100644
index 00000000..710000f0
--- /dev/null
+++ b/tests/configs/modules/helloworld/helloworld_default.js
@@ -0,0 +1,31 @@
+/* Magic Mirror
+ *
+ * Test config sample module hello world default config
+ *
+ * By Rodrigo RamÃrez Norambuena https://rodrigoramirez.com
+ * MIT Licensed.
+ */
+
+var config = {
+ port: 8080,
+ ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
+
+ language: "en",
+ timeFormat: 24,
+ units: "metric",
+ electronOptions: {
+ webPreferences: {
+ nodeIntegration: true,
+ },
+ },
+
+ modules: [
+ {
+ module: "helloworld",
+ position: "bottom_bar"
+ }
+ ]
+};
+
+/*************** DO NOT EDIT THE LINE BELOW ***************/
+if (typeof module !== "undefined") {module.exports = config;}
diff --git a/tests/e2e/modules/helloworld_spec.js b/tests/e2e/modules/helloworld_spec.js
index f956effb..8053373e 100644
--- a/tests/e2e/modules/helloworld_spec.js
+++ b/tests/e2e/modules/helloworld_spec.js
@@ -4,10 +4,6 @@ const app = globalSetup.app;
describe("Test helloworld module", function () {
this.timeout(20000);
- before(function() {
- // Set config sample for use in test
- process.env.MM_CONFIG_FILE = "tests/configs/modules/helloworld/helloworld.js";
- });
beforeEach(function (done) {
app.start().then(function() { done(); } );
@@ -17,8 +13,28 @@ describe("Test helloworld module", function () {
app.stop().then(function() { done(); });
});
- it("Test message helloworld module", function () {
- return app.client.waitUntilWindowLoaded()
- .getText(".helloworld").should.eventually.equal("Test HelloWorld Module");
+ describe("helloworld set config text", function () {
+ before(function() {
+ // Set config sample for use in test
+ process.env.MM_CONFIG_FILE = "tests/configs/modules/helloworld/helloworld.js";
+ });
+
+ it("Test message helloworld module", function () {
+ return app.client.waitUntilWindowLoaded()
+ .getText(".helloworld").should.eventually.equal("Test HelloWorld Module");
+ });
});
+
+ describe("helloworld default config text", function () {
+ before(function() {
+ // Set config sample for use in test
+ process.env.MM_CONFIG_FILE = "tests/configs/modules/helloworld/helloworld_default.js";
+ });
+
+ it("Test message helloworld module", function () {
+ return app.client.waitUntilWindowLoaded()
+ .getText(".helloworld").should.eventually.equal("Hello World!");
+ });
+ });
+
});
From 2de543f5f9423d23f792f6a8fe19c31f24dd34ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?=
Date: Sun, 20 Aug 2017 22:49:23 -0300
Subject: [PATCH 2/2] Add Changelog entry for new e2e test for helloworld
module
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a68b174..5637f7af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add unit tests for function `roundValue` in currentweather module.
- Add test e2e showWeek feature in spanish language.
- Add warning Log when is used old authentication method in the calendar module.
+- Add test e2e for helloworld module with default config text
### Updated
- Changed 'default.js' - listen on all attached interfaces by default.