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:
authorStefan Giehl <stefan@piwik.org>2017-07-18 00:14:10 +0300
committerGitHub <noreply@github.com>2017-07-18 00:14:10 +0300
commitef044ae8069f45ca97d53e62cd9351acedbae197 (patch)
tree3e405c10623af77256921ebe72cc02adc82cccb7 /tests
parent03ec8cd950d099feb62d865d08b696d8f94439b1 (diff)
Add UI tests for invalid idSite param (#11875)
Diffstat (limited to 'tests')
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite.png3
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite_superuser.png3
-rw-r--r--tests/UI/specs/UIIntegration_spec.js16
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite.png b/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite.png
new file mode 100644
index 0000000000..cd08ac10df
--- /dev/null
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d12a66e33198fb92cd8282c34db52edb1e8b185c0013612799aba41861824491
+size 34054
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite_superuser.png b/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite_superuser.png
new file mode 100644
index 0000000000..85b10e80f5
--- /dev/null
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_invalid_idsite_superuser.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d9ecb48b4ca979eb679f2850c45c44ae6ab14b793f63a01f67adbd7cd81204a6
+size 37918
diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js
index e2c2ef347f..3e25078267 100644
--- a/tests/UI/specs/UIIntegration_spec.js
+++ b/tests/UI/specs/UIIntegration_spec.js
@@ -580,6 +580,22 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik?
}, done);
});
+ // invalid site parameter
+ it('should show login form for non super user if invalid idsite given', function (done) {
+ testEnvironment.testUseMockAuth = 0;
+ testEnvironment.save();
+
+ expect.screenshot('invalid_idsite').to.be.capture(function (page) {
+ page.load("?module=CoreHome&action=index&idSite=10006&period=week&date=2017-06-04");
+ }, done);
+ });
+
+ it('should show error for super user if invalid idsite given', function (done) {
+ expect.screenshot('invalid_idsite_superuser').to.be.capture(function (page) {
+ page.load("?module=CoreHome&action=index&idSite=10006&period=week&date=2017-06-04");
+ }, done);
+ });
+
// DB error message
it('should fail correctly when db information in config is incorrect', function (done) {