diff options
Diffstat (limited to 'plugins/MultiSites')
5 files changed, 84 insertions, 0 deletions
diff --git a/plugins/MultiSites/tests/UI/MultiSites_spec.js b/plugins/MultiSites/tests/UI/MultiSites_spec.js new file mode 100644 index 0000000000..832955e70a --- /dev/null +++ b/plugins/MultiSites/tests/UI/MultiSites_spec.js @@ -0,0 +1,72 @@ +/*! + * Matomo - free/libre analytics platform + * + * Screenshot integration tests for MultiSites. + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("MultiSitesTest", function () { + this.timeout(0); + + var generalParams = 'idSite=1&period=year&date=2012-08-09'; + var selector = '#multisites,.expandDataTableFooterDrawer'; + + var createdSiteId = null; + + before(function (done) { + var callback = function (error, response) { + if (error) { + done(error, response); + return; + } + + createdSiteId = response.value; + done(); + }; + + testEnvironment.callApi("SitesManager.addSite", { + siteName: '%3CMy%20website%22%27%3E%3B%2C%3F with a very very very very long stupid name', + urls: 'http%3A%2F%2Fpiwik.org'}, + callback); + }); + + after(function (done) { + if (createdSiteId) { + testEnvironment.callApi("SitesManager.deleteSite", {idSite: createdSiteId}, done); + } + }); + + it('should load the all websites dashboard correctly', function (done) { + this.retries(3); + + expect.screenshot('all_websites').to.be.captureSelector(selector, function (page) { + page.load("?" + generalParams + "&module=MultiSites&action=index"); + page.wait(3000); + }, done); + }); + + it('should load next page correctly', function (done) { + this.retries(3); + + expect.screenshot('all_websites_page_1').to.be.captureSelector(selector, function (page) { + page.click('.paging .next'); + page.wait(1000); + }, done); + }); + + it('should search correctly', function (done) { + expect.screenshot('all_websites_search').to.be.captureSelector(selector, function (page) { + page.sendKeys('.site_search input', 'Site'); + page.click('.site_search .search_ico'); + }, done); + }); + + it('should toggle sort order when click on current metric', function (done) { + expect.screenshot('all_websites_changed_sort_order').to.be.captureSelector(selector, function (page) { + page.click('#visits .heading'); + }, done); + }); + +}); diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png new file mode 100644 index 0000000000..3c2fc1ef8b --- /dev/null +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28cde14696cab904cdf1ff20caa839456f559ef1b4c165ba5b02fcd42a351d3b +size 77346 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png new file mode 100644 index 0000000000..98a1bf9f35 --- /dev/null +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15a766fe64a245931131000412d5e2ad9ede120306d9dd2b12960772d7211044 +size 67240 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png new file mode 100644 index 0000000000..3c2fc1ef8b --- /dev/null +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28cde14696cab904cdf1ff20caa839456f559ef1b4c165ba5b02fcd42a351d3b +size 77346 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png new file mode 100644 index 0000000000..2d2063916a --- /dev/null +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9ebb3b39db30606aacecc9cb2b0c1695d7e9447e65244b2ef61d22f5821fe64 +size 67203 |