diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png index ddf7d08c2fb..7eb0b6ce43e 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:139f76e3aee25dee9a2db5b10d3b20d44c72ca425ad7ef62649aabc59f4c7ea2 -size 5379766 +oid sha256:eae5afe060db0f8fdd6be3aff4da37a801034316f160f32c9180d46175baaffc +size 5379547 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png index f2562049e2e..bde7529267e 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07eae07d4d64145903c7c8560b851fce4218411a903b711bfdcaea593485df37 -size 159811 +oid sha256:dbff8f2ad16c331b4af88d0b421a789067f0d691b0325ff03334ce83e26b4fb6 +size 159686 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_websites.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_websites.png index caf9f7a5c8d..8ac46042aff 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_websites.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_manage_websites.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a1bb9303bb5a7174be55121f25fa77d6bf0490e58f1ccefbe7a45a88999c6ff7 -size 260693 +oid sha256:eba093f6680cd10e23a49c2f0e2f5ac321e0a300872119680cf21131c6c80ba6 +size 260548 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png index d2264f0d2fb..bedd4f32cfe 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b4a8209a2963b1efc21036d6add141bf6bc6de8a139099e8464503f743dbdef -size 1103288 +oid sha256:e68300609143f588ee7d5ef6eae8dbb156504adc286ec87c89d8145d969b3e2a +size 1103116 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png index 6bcd81a7984..27276f0f810 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_plugins_no_internet.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a1c9352210c35e6156c40b86e15af00cad10f13ea8b0f4b2927bbd68afa43bea -size 1103912 +oid sha256:9183cc74e6721a6964eb79f0b98d1d2bcc83eb383dbfa9e0d4703879de8bd7f3 +size 1103697 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png index 72c1b14bf66..6cad2bef697 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_general.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c0ad0e4f77181c8f0d3be2f10070ee65368a7e7fcf60ecb45eac87c50aacaa3 -size 1340536 +oid sha256:f5520fbe048984b10b570e2a5173ac968e6547336836c3b816e7c8def07e3ed6 +size 1340291 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging.png index 8e6fe519168..988125e8ddb 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a77f826f220569b562d3f34b57fa2fbddf795444face7d082cbbb9e515db8988 -size 147419 +oid sha256:ebe254c3a0732767ae3d4da3161567b6a362515bf7ada006800c1e68c556adbd +size 147305 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging_provider.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging_provider.png index 0ada0df2b2a..6c8b5089539 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging_provider.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_settings_mobilemessaging_provider.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a3a8ae683aa8a17858531b0663688fc98dc40cabf73d14a4f4a01ec16271243 -size 117218 +oid sha256:36ddaabec6ac23bd811c0a30ad21887ea6960ace12367e0c3814991fb432e6c4 +size 117053 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_themes.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_themes.png index c8060780d55..61cd764f877 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_themes.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_themes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:422e02e7d9d79836881fa283bf5683098c0c8d37dce4e58aea20ff84af8445c3 -size 78617 +oid sha256:a3d105121ef5f7feef80be20ebbe4119f8c72040a3c0515013cbb470bbe9de84 +size 78496 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_visitor_generator.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_visitor_generator.png index 578748148c7..ff87b4739cd 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_visitor_generator.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_visitor_generator.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b77ca353438f2044908ac06f67bdd1e47139668fdf62d45e225a5aabe1e78bde -size 72129 +oid sha256:f8b3c777a7969be425a3a919c48b7b33427b6fc6d96bc48236bed7dd19d2ff9b +size 71998 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png index 8ff71bf0c76..a0e10eb76bf 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df1dbf51a9c4067a5a23647b519d3b6ed8bbcffdcbbd7f059af0793be59bc627 -size 5149450 +oid sha256:9329a448445edbbe22b55d5c4efcacf48371dd66e2795dd912c341f10b2d56c7 +size 5149224 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_email_reports.png b/tests/UI/expected-screenshots/UIIntegrationTest_email_reports.png index b7aa5db05bc..f100378df39 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_email_reports.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_email_reports.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a11720700371066e6cd76f1a4f65ae3f804a16f24991f960002f879f0c898bf2 -size 97066 +oid sha256:bb6298d8472f045baf622d96b01dc800c8bd685cf2f2631fe19dc45c6473b803 +size 96898 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_email_reports_editor.png b/tests/UI/expected-screenshots/UIIntegrationTest_email_reports_editor.png index 713359c11ba..7733f7a95a8 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_email_reports_editor.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_email_reports_editor.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7233662699cdbd366ddf7e85e5ab3ef6eca943dfa98fc9051f9a82f7770e9b33 -size 482918 +oid sha256:436f3b9ea527525c411c445840ea437924a26a24eec1f194a6907a10ff5e36f8 +size 482781 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png b/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png index b57146e832a..ab59e205d03 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_glossary.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cdf275427f36629a4aaaffb48d2d2365ded119f7a2f830d1f294bfa1bc380f32 -size 604432 +oid sha256:48f5716651e458690e5284e90cad470c49e3eb831d51430a8e18df425dc7f096 +size 604258 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_visits.png b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_visits.png index 135431ded9c..2398a34ac08 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_visits.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_visitors_realtime_visits.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3bee79de3dafb1ff0d667073698baad2e2b1d8ccbbef309f69032cb896252552 -size 90281 +oid sha256:688f72a3bdb0960b453983530a3ff231394b1b58bccd73a277478f15bdb8183e +size 71837 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_widgets_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_widgets_listing.png index be9ece5049b..2ee13d9fbf7 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_widgets_listing.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_widgets_listing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0851bf11699b135a97970c2759ac9f9c66028a39defd500d89293521175d21a -size 191423 +oid sha256:d749993777bcfb0b7b960a97e01114248ce4b3d7678cf61651709eddb3f1ab80 +size 191130 diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js index 65e63072ea1..58503779b63 100644 --- a/tests/UI/specs/UIIntegration_spec.js +++ b/tests/UI/specs/UIIntegration_spec.js @@ -56,6 +56,18 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? testEnvironment.save(); }); + async function screenshotPageWrap() { + await page.evaluate(function () { + $('#secondNavBar').css('visibility', 'hidden'); // hide navbar so shadow isn't shown on screenshot + }); + const pageWrap = await page.$('.pageWrap'); + const screenshot = await pageWrap.screenshot(); + await page.evaluate(function () { + $('#secondNavBar').css('visibility', 'visible'); // show navbar again + }); + return screenshot; + } + describe("misc", function () { this.title = parentSuite.title; // to make sure the screenshot prefix is the same @@ -66,8 +78,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? it("should load the page of a plugin located in a custom directory", async function () { await page.goto("?module=CustomDirPlugin&action=index&idSite=1&period=day&date=yesterday"); - const pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('customdirplugin'); + expect(await screenshotPageWrap()).to.matchImage('customdirplugin'); }); // shortcuts help @@ -112,12 +123,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? // Notifications it('should load the notifications page correctly', async function() { await page.goto("?" + generalParams + "&module=ExampleUI&action=notifications&idSite=1&period=day&date=yesterday"); - await page.evaluate(function () { - $('#secondNavBar').css('visibility', 'hidden'); // hide navbar so shadow isn't shown - }); - - const pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('notifications'); + expect(await screenshotPageWrap()).to.matchImage('notifications'); }); // Fatal error safemode @@ -189,8 +195,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.evaluate(() => { // give table headers constant width so the screenshot stays the same $('.dataTableScroller').css('overflow-x', 'scroll'); }); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_overview_columns'); + expect(await screenshotPageWrap()).to.matchImage('visitors_overview_columns'); }); it('should reload the visitors > overview page when clicking on the visitors overview page element again', async function () { @@ -198,8 +203,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.waitForNetworkIdle(); await page.waitForSelector('.piwik-graph'); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_overview'); + expect(await screenshotPageWrap()).to.matchImage('visitors_overview'); }); it('should be possible to change the limit of evolution chart', async function () { @@ -211,8 +215,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.mouse.move(0, 0); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_overview_limit'); + expect(await screenshotPageWrap()).to.matchImage('visitors_overview_limit'); }); it('should keep the limit when reload the page', async function () { @@ -221,16 +224,14 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? delete testEnvironment.ignoreClearAllViewDataTableParameters; testEnvironment.save(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_overview_limit'); + expect(await screenshotPageWrap()).to.matchImage('visitors_overview_limit'); }); it('should load the visitors > devices page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Visitors&subcategory=DevicesDetection_Devices"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_devices'); + expect(await screenshotPageWrap()).to.matchImage('visitors_devices'); }); it('should load visitors > locations & provider page correctly', async function () { @@ -238,40 +239,35 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.waitForNetworkIdle(); await page.waitForTimeout(500); // wait for map widget to render - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_locations_provider'); + expect(await screenshotPageWrap()).to.matchImage('visitors_locations_provider'); }); it('should load the visitors > software page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Visitors&subcategory=DevicesDetection_Software"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_software'); + expect(await screenshotPageWrap()).to.matchImage('visitors_software'); }); it('should load the visitors > times page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Visitors&subcategory=VisitTime_SubmenuTimes"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_times'); + expect(await screenshotPageWrap()).to.matchImage('visitors_times'); }); it('should load the visitors > engagement page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=VisitorInterest_Engagement"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_engagement'); + expect(await screenshotPageWrap()).to.matchImage('visitors_engagement'); }); it('should load the visitors > custom variables page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Visitors&subcategory=CustomVariables_CustomVariables"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('visitors_custom_vars'); + expect(await screenshotPageWrap()).to.matchImage('visitors_custom_vars'); }); it('should load the visitors > real-time map page correctly', async function () { @@ -300,12 +296,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? //await page.click('#pauseImage'); // prevent refreshes breaking the tests await page.waitForTimeout(100); - pageWrap = await page.$('#root'); - await page.evaluate(function() { - // hide navBar to skip random failed - $('#secondNavBar').hide(); - }); - expect(await pageWrap.screenshot()).to.matchImage('visitors_realtime_visits'); + expect(await screenshotPageWrap()).to.matchImage('visitors_realtime_visits'); }); }); @@ -318,8 +309,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.mouse.move(-10, -10); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_pages'); + expect(await screenshotPageWrap()).to.matchImage('actions_pages'); }); // actions pages @@ -335,48 +325,42 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); await page.mouse.move(-10, -10); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_pages_tooltip_help'); + expect(await screenshotPageWrap()).to.matchImage('actions_pages_tooltip_help'); }); it('should load the actions > entry pages page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuPagesEntry"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_entry_pages'); + expect(await screenshotPageWrap()).to.matchImage('actions_entry_pages'); }); it('should load the actions > exit pages page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuPagesExit"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_exit_pages'); + expect(await screenshotPageWrap()).to.matchImage('actions_exit_pages'); }); it('should load the actions > page titles page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuPageTitles"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_page_titles'); + expect(await screenshotPageWrap()).to.matchImage('actions_page_titles'); }); it('should load the actions > site search page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Actions_SubmenuSitesearch"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_site_search'); + expect(await screenshotPageWrap()).to.matchImage('actions_site_search'); }); it('should load the actions > outlinks page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=General_Outlinks"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_outlinks'); + expect(await screenshotPageWrap()).to.matchImage('actions_outlinks'); }); it('should load the segmented vlog correctly for outlink containing a &', async function () { @@ -403,16 +387,14 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.waitForTimeout(500); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_downloads'); + expect(await screenshotPageWrap()).to.matchImage('actions_downloads'); }); it('should load the actions > contents page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=General_Actions&subcategory=Contents_Contents&period=day&date=2012-01-01"); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_contents'); + expect(await screenshotPageWrap()).to.matchImage('actions_contents'); }); it("should show all corresponding content pieces when clicking on a content name", async function () { @@ -425,8 +407,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); await page.mouse.move(-10, -10); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_content_name_piece'); + expect(await screenshotPageWrap()).to.matchImage('actions_content_name_piece'); }); it("should show all tracked content pieces when clicking on the table", async function () { @@ -434,8 +415,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await elem.click(); await page.waitForNetworkIdle(); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_content_piece'); + expect(await screenshotPageWrap()).to.matchImage('actions_content_piece'); }); it("should show all corresponding content names when clicking on a content piece", async function () { @@ -448,8 +428,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); await page.mouse.move(-10, -10); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('actions_content_piece_name'); + expect(await screenshotPageWrap()).to.matchImage('actions_content_piece_name'); }); }); @@ -473,43 +452,37 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=ExampleUI_GetTemperaturesDataTable"); await page.mouse.move(-10, -10); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_dataTables'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_dataTables'); }); it('should load the example ui > barGraph page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=Bar%20graph"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_barGraph'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_barGraph'); }); it('should load the example ui > pieGraph page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=Pie%20graph"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_pieGraph'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_pieGraph'); }); it('should load the example ui > tagClouds page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=Tag%20clouds"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_tagClouds'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_tagClouds'); }); it('should load the example ui > sparklines page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=Sparklines"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_sparklines'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_sparklines'); }); it('should load the example ui > evolution graph page correctly', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=ExampleUI_UiFramework&subcategory=Evolution%20Graph"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_evolutionGraph'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_evolutionGraph'); }); it('should load the example ui > treemap page correctly', async function () { @@ -517,8 +490,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.waitForNetworkIdle(); await page.waitForTimeout(500); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('exampleui_treemap'); + expect(await screenshotPageWrap()).to.matchImage('exampleui_treemap'); }); it('should load sparklines view correctly even when there is no matching row', async function () { @@ -587,15 +559,13 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? it('should load the ecommerce log page', async function () { await page.goto("?" + urlBase + "#?" + generalParams + "&category=Goals_Ecommerce&subcategory=Goals_EcommerceLog"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('ecommerce_log'); + expect(await screenshotPageWrap()).to.matchImage('ecommerce_log'); }); it('should load the ecommerce log page with segment', async function () { await page.goto("?" + urlBase + "&segment=countryCode%3D%3DCN#?" + generalParams + "&category=Goals_Ecommerce&subcategory=Goals_EcommerceLog&segment=countryCode%3D%3DCN"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('ecommerce_log_segmented'); + expect(await screenshotPageWrap()).to.matchImage('ecommerce_log_segmented'); }); it('should load the ecommerce products page', async function () { @@ -623,8 +593,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? it('should load the Admin home page correct', async function () { await page.goto("?" + generalParams + "&module=CoreAdminHome&action=home"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_home'); + expect(await screenshotPageWrap()).to.matchImage('admin_home'); }); // Admin user settings (plugins not displayed) @@ -634,8 +603,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? $('.form-help:contains(UTC time is)').hide(); }); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_manage_websites'); + expect(await screenshotPageWrap()).to.matchImage('admin_manage_websites'); }); it('should load the Settings > General Settings admin page correctly', async function () { @@ -647,8 +615,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); await page.waitForTimeout(750); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_settings_general'); + expect(await screenshotPageWrap()).to.matchImage('admin_settings_general'); }); it('should load the Privacy Opt out iframe correctly', async function () { @@ -662,8 +629,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.goto("?" + generalParams + "&module=MobileMessaging&action=index"); await page.waitForNetworkIdle(); - const pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_settings_mobilemessaging'); + expect(await screenshotPageWrap()).to.matchImage('admin_settings_mobilemessaging'); }) it('should switch the SMS provider correctly', async function () { @@ -674,22 +640,19 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.waitForNetworkIdle(); await page.waitForTimeout(200); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_settings_mobilemessaging_provider'); + expect(await screenshotPageWrap()).to.matchImage('admin_settings_mobilemessaging_provider'); }); it('should load the themes admin page correctly', async function () { await page.goto("?" + generalParams + "&module=CorePluginsAdmin&action=themes"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_themes'); + expect(await screenshotPageWrap()).to.matchImage('admin_themes'); }); it('should load the plugins admin page correctly', async function () { await page.goto("?" + generalParams + "&module=CorePluginsAdmin&action=plugins"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_plugins'); + expect(await screenshotPageWrap()).to.matchImage('admin_plugins'); }); it('should load the plugins admin page correctly when internet disabled', async function () { @@ -700,15 +663,13 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.goto("?" + generalParams + "&module=CorePluginsAdmin&action=plugins"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_plugins_no_internet'); + expect(await screenshotPageWrap()).to.matchImage('admin_plugins_no_internet'); }); it('should load the config file page correctly', async function () { await page.goto("?" + generalParams + "&module=Diagnostics&action=configfile"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_diagnostics_configfile'); + expect(await screenshotPageWrap()).to.matchImage('admin_diagnostics_configfile'); }); it('should load the Settings > Visitor Generator admin page correctly', async function () { @@ -718,8 +679,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? $p.text($p.text().replace(/\(change .*\)/g, '')); }); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('admin_visitor_generator'); + expect(await screenshotPageWrap()).to.matchImage('admin_visitor_generator'); }); }); @@ -729,8 +689,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? it('should load the glossary correctly', async function () { await page.goto("?" + generalParams + "&module=API&action=glossary"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('glossary'); + expect(await screenshotPageWrap()).to.matchImage('glossary'); }); it('should load the glossary correctly widgetized', async function () { @@ -781,15 +740,13 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); }); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('widgets_listing'); + expect(await screenshotPageWrap()).to.matchImage('widgets_listing'); }); it('should load the API listing page correctly', async function () { await page.goto("?" + generalParams + "&module=API&action=listAllAPI"); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('api_listing'); + expect(await screenshotPageWrap()).to.matchImage('api_listing'); }); it('should load the email reports page correctly', async function () { @@ -798,8 +755,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? $('#header').hide(); }); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('email_reports'); + expect(await screenshotPageWrap()).to.matchImage('email_reports'); }); it('should show the generated report when clicking the download button', async function () { @@ -816,8 +772,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? await page.goto("?" + generalParams + "&module=ScheduledReports&action=index"); await page.click('.entityTable tr:nth-child(4) button[title="Edit"]'); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('email_reports_editor'); + expect(await screenshotPageWrap()).to.matchImage('email_reports_editor'); }); // date range clicked @@ -941,8 +896,8 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? $('.visitor-profile-widget-link > span').text('{REPLACED_ID}'); }); - const pageWrap = await page.$('#Piwik_Popover'); - expect(await pageWrap.screenshot()).to.matchImage('visitor_profile_not_segmented'); + const popover = await page.$('#Piwik_Popover'); + expect(await popover.screenshot()).to.matchImage('visitor_profile_not_segmented'); }); it('should display API errors properly without showing them as notifications', async function () {