Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2017-12-01 01:38:06 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-12-01 01:38:06 +0300
commit9020dac1940fa9c52b9f29748131aa859ab16c29 (patch)
tree731e56ca9c9151cb319affa80480a26919624209 /tests
parentaf3a79c055bfe2c5778b5827ba3d165674315f4b (diff)
Add possibility to restrict piwik access by ip (#12242)
* add possibility to restrict piwik login by ip * better whitelist implementation * move classes to corehome * better error message * better config * make sure ips can be overwritten via DI * fix ui tests
Diffstat (limited to 'tests')
-rw-r--r--tests/UI/expected-screenshots/Login_ip_not_whitelisted.png3
-rw-r--r--tests/UI/specs/Login_spec.js8
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/UI/expected-screenshots/Login_ip_not_whitelisted.png b/tests/UI/expected-screenshots/Login_ip_not_whitelisted.png
new file mode 100644
index 0000000000..fac5e0d7e4
--- /dev/null
+++ b/tests/UI/expected-screenshots/Login_ip_not_whitelisted.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f2e9c6dfe0cdb21c3f544d3f735d4fdd07e65bec0bef10c0da57ed68aa2beb4e
+size 43882
diff --git a/tests/UI/specs/Login_spec.js b/tests/UI/specs/Login_spec.js
index 89bcb6627b..f2018b880e 100644
--- a/tests/UI/specs/Login_spec.js
+++ b/tests/UI/specs/Login_spec.js
@@ -103,4 +103,12 @@ describe("Login", function () {
page.load(formlessLoginUrl);
}, done);
});
+
+ it('should not show login page when ips whitelisted and ip is not matching', function (done) {
+ expect.screenshot('ip_not_whitelisted').to.be.captureSelector('.box', function (page) {
+ testEnvironment.overrideConfig('General', 'login_whitelist_ip', ['199.199.199.199']);
+ testEnvironment.save();
+ page.load('');
+ }, done);
+ });
}); \ No newline at end of file