diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-03-30 23:56:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 23:56:02 +0300 |
commit | da1fec50e51071c775278ac2b9c2eb5db7a20f2f (patch) | |
tree | 704e7d0ebe0477fe02c3ac9057e8bb67f27b079b /plugins/UserCountryMap | |
parent | 119e62cd5cc076396dd83736e402d4f470acadd8 (diff) |
Moves various UI tests to their plugins (#12649)
* move Overlay UI tests to Overlay plugin
* remove UI files that has been moved
* move Login UI tests to Login plugin
* check for element instead of comparing screenshots
* Move Installation UI tests to it's plugin
* Move UI tests for Marketplace to Marketplace plugin
* Updates Sync Screenshots command to download test files to correct directories
* ensure shortcut help is always tested with same useragent
* Move VisitorMap UI tests to UserCountryMap plugin
* Move Morpheus UI tests to plugin
* Move MultiSites UI tests zu plugin
* Move ActionsDataTable UI tests to Actions plugin
* Renames Test directories to tests
* Move UsersManager UI tests to plugin
* Move CoreUpdater UI tests to plugin
* Move DBStats UI tests to plugin
* Move Transitions UI tests to plugin
* Move Insights UI tests to plugin
* improve UI tests splitting on travis
* Moves SegmentEditor UI tests to plugin
* Moves SitesManager UI tests to plugin
* Moves ImageGraph UI tests to plugin
* move live ui test files to git lfs
* remove retry
* update test file
* improve splitting for travis
* prevent test from failing randomly
Diffstat (limited to 'plugins/UserCountryMap')
5 files changed, 72 insertions, 0 deletions
diff --git a/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js b/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js new file mode 100644 index 0000000000..c8685a3e7f --- /dev/null +++ b/plugins/UserCountryMap/tests/UI/VisitorMap_spec.js @@ -0,0 +1,60 @@ +/*! + * Piwik - free/libre analytics platform + * + * Visitor Map screenshot tests. + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("VisitorMap", function () { + this.timeout(0); + + var url = "?module=Widgetize&action=iframe&moduleToWidgetize=UserCountryMap&idSite=1&period=year&date=2012-08-09&" + + "actionToWidgetize=visitorMap&viewDataTable=table&filter_limit=5&isFooterExpandedInDashboard=1", + urlWithCities = "?module=Widgetize&action=iframe&moduleToWidgetize=UserCountryMap&idSite=3&period=week&date=yesterday&" + + "actionToWidgetize=visitorMap&viewDataTable=table&filter_limit=5&isFooterExpandedInDashboard=1"; + + it("should display the bounce rate metric correctly", function (done) { + this.retries(3); + + expect.screenshot('bounce_rate').to.be.similar(0.002).to.capture(function (page) { + page.load(url); + page.evaluate(function () { + $('.userCountryMapSelectMetrics').val('bounce_rate').trigger('change'); + }); + page.mouseMove('.UserCountryMap_map.kartograph'); + }, done); + }); + + it("should display the average time on site metric correctly", function (done) { + expect.screenshot('avg_time_on_site').to.be.similar(0.002).to.capture(function (page) { + page.evaluate(function () { + $('.userCountryMapSelectMetrics').val('avg_time_on_site').trigger('change'); + }); + page.mouseMove('.UserCountryMap_map.kartograph'); + }, done); + }); + + it("should display the regions layer correctly", function (done) { + expect.screenshot('regions').to.be.similar(0.002).to.capture(function (page) { + page.load(urlWithCities); + page.evaluate(function () { + // zoom into USA + var path = window.visitorMap.map.getLayer('countries').getPaths({iso: "USA"})[0].svgPath[0]; + $(path).click(); + }); + page.evaluate(function () { + // go to regions view + var path = window.visitorMap.map.getLayer('countries').getPaths({iso: "USA"})[0].svgPath[0]; + $(path).click(); + }); + }, done); + }); + + it("should display the cities layer correctly", function (done) { + expect.screenshot('cities').to.be.similar(0.002).to.capture(function (page) { + page.click('.UserCountryMap-btn-city'); + }, done); + }); +}); diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_avg_time_on_site.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_avg_time_on_site.png new file mode 100644 index 0000000000..ceb7af09ad --- /dev/null +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_avg_time_on_site.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b700da83b5b12979d23b2f2d068d6ecf27595ddcffcf8082363c0d4ebec3de17 +size 189886 diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_bounce_rate.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_bounce_rate.png new file mode 100644 index 0000000000..c4026194f2 --- /dev/null +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_bounce_rate.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43f1e81a0a440b37126fbc028a971e742b103721f59a4ce6b5f362fbb904b0d2 +size 189092 diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png new file mode 100644 index 0000000000..30a9ce43e4 --- /dev/null +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_cities.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f3f0e40d23b460a7efca8b67d312418ccb95e17db83913fdec72037291aabf0 +size 117136 diff --git a/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png new file mode 100644 index 0000000000..0ccb5cf81e --- /dev/null +++ b/plugins/UserCountryMap/tests/UI/expected-screenshots/VisitorMap_regions.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23c6affafe3db866251746f771e2c2fe48d09150fceb4d8f1c60bcdfb4596337 +size 116052 |