diff --git a/tests/configs/modules/newsfeed/prohibited_words.js b/tests/configs/modules/newsfeed/prohibited_words.js new file mode 100644 index 00000000..e039385e --- /dev/null +++ b/tests/configs/modules/newsfeed/prohibited_words.js @@ -0,0 +1,39 @@ +/* Magic Mirror Test config newsfeed module + * + * MIT Licensed. + */ +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 12, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true, + enableRemoteModule: true + } + }, + + modules: [ + { + module: "newsfeed", + position: "bottom_bar", + config: { + feeds: [ + { + title: "Rodrigo Ramirez Blog", + url: "http://localhost:8080/tests/configs/data/feed_test_rodrigoramirez.xml" + } + ], + prohibitedWords: ["QPanel"] + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/e2e/modules/newsfeed_spec.js b/tests/e2e/modules/newsfeed_spec.js index 0b10c47d..dae3d86b 100644 --- a/tests/e2e/modules/newsfeed_spec.js +++ b/tests/e2e/modules/newsfeed_spec.js @@ -30,7 +30,21 @@ describe("Newsfeed module", function () { }); it("should show the newsfeed title", function () { - return app.client.waitUntilTextExists(".newsfeed .small", "Rodrigo Ramirez Blog", 10000); + return app.client.waitUntilTextExists(".newsfeed .newsfeed-source", "Rodrigo Ramirez Blog", 10000); + }); + + it("should show the newsfeed article", function () { + return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "QPanel", 10000); + }); + }); + + describe("Custom configuration", function () { + before(function () { + process.env.MM_CONFIG_FILE = "tests/configs/modules/newsfeed/prohibited_words.js"; + }); + + it("should not show articles with prohibited words", function () { + return app.client.waitUntilTextExists(".newsfeed .newsfeed-title", "Problema VirtualBox", 10000); }); });