From 8786b3348c6f80df1525387c960c480c27743dfc Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Tue, 14 Nov 2023 15:21:39 +0100 Subject: [PATCH] Improve loading time for UI tests loading the (default) dashboard (#21477) * Change default UI test fixture, so default dashboard does include only one widget * use new dashboard ids in tests * avoid screenshotting unneeded parts in DashboardManager UI tests * updates expected UI test files * Move dashboard relaated UI tests to dashboard plugin * apply review feedback Co-authored-by: Marc Neudert * updates expected UI test files --------- Co-authored-by: Marc Neudert --- .../tests/UI/SingleMetricView_spec.js | 4 +- .../tests/UI/DashboardManager_spec.js | 22 +- plugins/Dashboard/tests/UI/Dashboard_spec.js | 393 ++++-------------- .../tests/UI/WidgetizedDashboard_spec.js | 334 +++++++++++++++ .../DashboardManager_create_new.png | 4 +- .../DashboardManager_expanded.png | 4 +- .../DashboardManager_removed.png | 4 +- .../DashboardManager_widget_list_shown.png | 4 +- .../DashboardManager_widget_preview.png | 4 +- .../Dashboard_change_layout.png | 3 - .../expected-screenshots/Dashboard_copied.png | 3 - .../Dashboard_create_new.png | 3 - .../Dashboard_dashboard1_mobile.png | 0 .../Dashboard_dashboard2.png | 0 .../Dashboard_dashboard3.png | 0 .../Dashboard_dashboard4.png | 0 .../Dashboard_dashboard5.png | 0 ...board_default_widget_selection_changed.png | 3 - .../expected-screenshots/Dashboard_loaded.png | 3 - .../Dashboard_removed.png | 3 - .../expected-screenshots/Dashboard_rename.png | 3 - .../expected-screenshots/Dashboard_reset.png | 3 - .../Dashboard_segmented.png | 3 - .../Dashboard_widget_add_widget.png | 3 - .../Dashboard_widget_maximise.png | 3 - .../Dashboard_widget_minimised.png | 3 - .../Dashboard_widget_move.png | 3 - .../Dashboard_widget_move_removed.png | 3 - .../Dashboard_widget_refresh.png | 3 - .../Dashboard_widget_unmaximise.png | 3 - .../Dashboard_widget_unminimise.png | 3 - .../WidgetizedDashboard_change_layout.png | 3 + .../WidgetizedDashboard_copied.png | 3 + .../WidgetizedDashboard_create_new.png | 3 + ...board_default_widget_selection_changed.png | 3 + ...idgetizedDashboard_invalid_token_auth.png} | 0 .../WidgetizedDashboard_loaded.png | 3 + ...WidgetizedDashboard_loaded_token_auth.png} | 0 .../WidgetizedDashboard_removed.png | 3 + .../WidgetizedDashboard_rename.png | 3 + .../WidgetizedDashboard_reset.png | 3 + ...g => WidgetizedDashboard_rowevolution.png} | 0 .../WidgetizedDashboard_segmented.png | 3 + .../WidgetizedDashboard_widget_add_widget.png | 3 + .../WidgetizedDashboard_widget_maximise.png | 3 + .../WidgetizedDashboard_widget_minimised.png | 3 + .../WidgetizedDashboard_widget_move.png | 3 + ...idgetizedDashboard_widget_move_removed.png | 3 + .../WidgetizedDashboard_widget_refresh.png | 3 + .../WidgetizedDashboard_widget_unmaximise.png | 3 + .../WidgetizedDashboard_widget_unminimise.png | 3 + tests/PHPUnit/Fixtures/UITestFixture.php | 56 +-- .../Menus_mobile_left.png | 4 +- .../QuickAccess_search_1.png | 4 +- .../QuickAccess_search_2.png | 4 +- .../QuickAccess_search_category.png | 2 +- .../QuickAccess_search_no_result.png | 4 +- .../QuickAccess_search_sites.png | 4 +- tests/UI/expected-screenshots/Theme_home.png | 4 +- tests/UI/specs/Comparison_spec.js | 2 +- tests/UI/specs/UIIntegration_spec.js | 66 --- 61 files changed, 530 insertions(+), 495 deletions(-) create mode 100644 plugins/Dashboard/tests/UI/WidgetizedDashboard_spec.js delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_change_layout.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_copied.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_create_new.png rename tests/UI/expected-screenshots/UIIntegrationTest_dashboard5_mobile.png => plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard1_mobile.png (100%) rename tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png => plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard2.png (100%) rename tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png => plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard3.png (100%) rename tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png => plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard4.png (100%) rename tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png => plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard5.png (100%) delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_default_widget_selection_changed.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rename.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_segmented.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_add_widget.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_minimised.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move_removed.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_refresh.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png delete mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unminimise.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_change_layout.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_copied.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_create_new.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_default_widget_selection_changed.png rename plugins/Dashboard/tests/UI/expected-screenshots/{Dashboard_invalid_token_auth.png => WidgetizedDashboard_invalid_token_auth.png} (100%) create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded.png rename plugins/Dashboard/tests/UI/expected-screenshots/{Dashboard_loaded_token_auth.png => WidgetizedDashboard_loaded_token_auth.png} (100%) create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_removed.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rename.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_reset.png rename plugins/Dashboard/tests/UI/expected-screenshots/{Dashboard_rowevolution.png => WidgetizedDashboard_rowevolution.png} (100%) create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_segmented.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_add_widget.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_maximise.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_minimised.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move_removed.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_refresh.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unmaximise.png create mode 100644 plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unminimise.png diff --git a/plugins/CoreHome/tests/UI/SingleMetricView_spec.js b/plugins/CoreHome/tests/UI/SingleMetricView_spec.js index d0722973b79..15c7b5a721d 100644 --- a/plugins/CoreHome/tests/UI/SingleMetricView_spec.js +++ b/plugins/CoreHome/tests/UI/SingleMetricView_spec.js @@ -11,9 +11,9 @@ describe('SingleMetricView', function () { this.timeout(0); var url = "?module=Widgetize&action=iframe&idSite=1&period=year&date=2012-08-09&moduleToWidgetize=Dashboard&" - + "actionToWidgetize=index&idDashboard=5"; + + "actionToWidgetize=index&idDashboard=1"; var rangeUrl = "?module=Widgetize&action=iframe&idSite=1&period=range&date=2012-08-07,2012-08-10&moduleToWidgetize=Dashboard&" - + "actionToWidgetize=index&idDashboard=5"; + + "actionToWidgetize=index&idDashboard=1"; it('should load correctly', async function () { await page.goto(url); diff --git a/plugins/Dashboard/tests/UI/DashboardManager_spec.js b/plugins/Dashboard/tests/UI/DashboardManager_spec.js index d739e1cd6cc..d2b24c24af4 100644 --- a/plugins/Dashboard/tests/UI/DashboardManager_spec.js +++ b/plugins/Dashboard/tests/UI/DashboardManager_spec.js @@ -11,10 +11,11 @@ describe("DashboardManager", function () { const selectorToCapture = '.dashboard-manager,.dashboard-manager .dropdown'; const generalParams = 'idSite=1&period=day&date=2012-01-01'; - const url = '?module=CoreHome&action=index&' + generalParams + '#?' + generalParams + '&category=Dashboard_Dashboard&subcategory=5'; + const url = '?module=CoreHome&action=index&' + generalParams + '#?' + generalParams + '&category=Dashboard_Dashboard&subcategory=1'; it("should load correctly", async function() { await page.goto(url); + await page.waitForNetworkIdle(); expect(await page.screenshotSelector(selectorToCapture)).to.matchImage('loaded'); }); @@ -62,6 +63,11 @@ describe("DashboardManager", function () { }); it("should create new dashboard with new default widget selection when create dashboard process completed", async function() { + // check that widget count on currently loaded dashboard is correct, so we are able to say if + // number of widgets has changed after creating and loading the new one + const widgetsCountBefore = await page.evaluate(() => $('#dashboardWidgetsArea .widget').length); + expect(widgetsCountBefore).to.equal(1); + await page.click('.dashboard-manager .title'); await page.click('li[data-action="createDashboard"]'); await page.waitForSelector('#createDashboardName', { visible: true }); @@ -97,7 +103,12 @@ describe("DashboardManager", function () { await page.waitForNetworkIdle(); await page.waitForTimeout(100); // wait for widgets to render fully - expect(await page.screenshot({ fullPage: true })).to.matchImage('create_new'); + // check new dashboard was loaded, which should have 10 widgets + const widgetsCount = await page.evaluate(() => $('#dashboardWidgetsArea .widget').length); + expect(widgetsCount).to.equal(10); + + // check dashboard has been added to menu, causing menu to switch from listing to selector + expect(await page.screenshotSelector('#secondNavBar .menuTab.active')).to.matchImage('create_new'); }); @@ -120,6 +131,11 @@ describe("DashboardManager", function () { await page.waitForSelector('.widget'); await page.waitForNetworkIdle(); - expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); + // check initial dashboard was loaded again, which should have 1 widget only + const widgetsCount = await page.evaluate(() => $('#dashboardWidgetsArea .widget').length); + expect(widgetsCount).to.equal(1); + + // check dashboard has been removed from menu, causing menu to switch from selector to listing + expect(await page.screenshotSelector('#secondNavBar .menuTab.active')).to.matchImage('removed'); }); }); diff --git a/plugins/Dashboard/tests/UI/Dashboard_spec.js b/plugins/Dashboard/tests/UI/Dashboard_spec.js index 25bc323e988..9c85a252f66 100644 --- a/plugins/Dashboard/tests/UI/Dashboard_spec.js +++ b/plugins/Dashboard/tests/UI/Dashboard_spec.js @@ -6,329 +6,80 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ - describe("Dashboard", function () { - this.timeout(0); - - var url = "?module=Widgetize&action=iframe&idSite=1&period=year&date=2012-08-09&moduleToWidgetize=Dashboard&" - + "actionToWidgetize=index&idDashboard=5"; - - var removeAllExtraDashboards = async function() { - var dashboards = await testEnvironment.callController("Dashboard.getAllDashboards", {}); - dashboards = (dashboards || []).filter(function (dash) { - return parseInt(dash.iddashboard) > 5; - }); - - var removeDashboard = async function (i) { - if (i >= dashboards.length) { - return; - } - - console.log("Removing dashboard ID = " + dashboards[i].iddashboard); - await testEnvironment.callApi("Dashboard.removeDashboard", {idDashboard: dashboards[i].iddashboard}); - await removeDashboard(i + 1); - }; - - await removeDashboard(0); - }; - - var setup = async function() { - // make sure live widget doesn't refresh constantly for UI tests - testEnvironment.overrideConfig('General', 'live_widget_refresh_after_seconds', 1000000); - // ensure tour widget always shows the same state - testEnvironment.completeAllChallenges = 1; - testEnvironment.testUseMockAuth = 1; - testEnvironment.save(); - // save empty layout for dashboard ID = 5 - var layout = [ - [ - { - uniqueId: "widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution", - parameters: {module: "VisitsSummary", action: "getEvolutionGraph", columns: "nb_visits"} - } - ], - [], - [] - ]; + var generalParams = 'idSite=1&period=year&date=2012-08-09', + urlBase = 'module=CoreHome&action=index&' + generalParams; - await testEnvironment.callController("Dashboard.saveLayout", {name: 'D4', layout: JSON.stringify(layout), idDashboard: 5, idSite: 2}); - await testEnvironment.callController("Dashboard.saveLayoutAsDefault", {layout: 0}); - await removeAllExtraDashboards(); + before(async function () { + testEnvironment.queryParamOverride = { + forceNowValue: testEnvironment.forcedNowTimestamp, + visitorId: testEnvironment.forcedIdVisitor, + realtimeWindow: 'false' }; - - before(setup); - after(setup); - - it("should load correctly", async function() { - await page.goto(url); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('loaded'); - }); - - it("should move a widget when widget is drag & dropped", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - await page.mouse.down(); - - var col2 = await page.jQuery('#dashboardWidgetsArea > .col:eq(2)'); - await col2.hover(); - await page.mouse.up(); - await page.waitForNetworkIdle(); - await page.waitForTimeout(100); - await page.mouse.move(-10, -10); - - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_move'); - }); - - it("should refresh widget when widget refresh icon clicked", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - - await page.click('.button#refresh'); - await page.mouse.move(-10, -10); - - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_refresh'); - }); - - it("should minimise widget when widget minimise icon clicked", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - await page.click('.button#minimise'); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_minimised'); - }); - - it("should unminimise widget when widget maximise icon is clicked after being minimised", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - await page.click('.button#maximise'); - await page.mouse.move(-10, -10); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_unminimise'); - }); - - it("should maximise widget when widget maximise icon is clicked", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - await page.click('.button#maximise'); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_maximise'); - }); - - it("should close maximise dialog when minimise icon is clicked", async function() { - var widget = await page.$('.widgetTop'); - await widget.hover(); - await page.click('.button#minimise'); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_unmaximise'); - }); - - it("should add a widget when a widget is selected in the dashboard manager", async function() { - await page.click('.dashboard-manager .title'); - - await page.waitForSelector('.widgetpreview-categorylist>li'); - - var live = await page.jQuery('.widgetpreview-categorylist>li:contains(Goals)'); // have to mouse move twice... otherwise Live! will just be highlighted - await live.hover(); - await live.click(); - - var behaviour = await page.jQuery('.widgetpreview-categorylist>li:contains(Behaviour):first'); - await behaviour.hover(); - await behaviour.click(); - - var pages = await page.jQuery('.widgetpreview-widgetlist>li:contains(Pages):first'); - await pages.hover(); - await pages.click(); - - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_add_widget'); - }); - - it("should open row evolution", async function() { - var row = await page.jQuery('#dashboardWidgetsArea .dataTable tbody td:contains(thankyou)'); - await row.hover(); - var icon = await page.waitForSelector('#dashboardWidgetsArea .dataTable tbody a.actionRowEvolution'); - await icon.click(); - await page.waitForSelector('.ui-dialog'); - await page.waitForNetworkIdle(); - var dialog = await page.$('.ui-dialog'); - expect(await dialog.screenshot()).to.matchImage('rowevolution'); - }); - - it("should remove widget when remove widget icon is clicked", async function() { - await page.click('.ui-dialog-titlebar-close'); // close row evolution - - var widget = '[id="widgetActionsgetPageUrls"]'; - - var titlebar = await page.$(widget + ' .widgetTop'); - await titlebar.hover(); - - var icon = await page.$(widget + ' .button#close'); - await icon.click(); - - var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); - await button.click(); - - await page.mouse.move(-10, -10); - await page.waitForTimeout(250); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_move_removed'); - }); - - it("should change dashboard layout when new layout is selected", async function() { - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="showChangeDashboardLayoutDialog"]'); - await page.click('.modal.open div[layout="50-50"]'); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Save)'); - await button.click(); - await page.mouse.move(-10, -10); - await page.waitForTimeout(250); // animation - await page.evaluate(() => $('.evolution-annotations').css('display','none')); - expect(await page.screenshot({ fullPage: true })).to.matchImage('change_layout'); - }); - - it("should rename dashboard when dashboard rename process completed", async function() { - await page.evaluate(() => $('.evolution-annotations').css('display','none')); - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="renameDashboard"]'); - await page.evaluate(() => $('#newDashboardName').val('newname')); - await page.waitForTimeout(250); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Save)'); - await button.click(); - await page.mouse.move(-10, -10); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('rename'); - }); - - it("should copy dashboard successfully when copy dashboard process completed", async function() { - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="copyDashboardToUser"]'); - await page.waitForTimeout(100); // wait for animation - await page.evaluate(function () { - $('#copyDashboardName').val(''); - }); - await page.type('#copyDashboardName', 'new 💩'); - await page.waitForSelector('#copyDashboardUser [value="superUserLogin"]'); - await page.select('#copyDashboardUser', 'superUserLogin'); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)'); - await button.click(); - await page.waitForFunction("$('.ui-confirm :contains(\"Current dashboard successfully copied to selected user.\").length > 0')"); - - await page.goto(url.replace("idDashboard=5", "idDashboard=6")); - await page.mouse.move(-10, -10); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('copied'); - }); - - it("should reset dashboard when reset dashboard process completed", async function() { - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="resetDashboard"]'); - await page.waitForSelector('.modal.open'); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); - await button.click(); - await page.waitForNetworkIdle(); - await page.mouse.move(-10, -10); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - await page.waitForTimeout(500); // wait for widgets to render fully - - expect(await page.screenshot({ fullPage: true })).to.matchImage('reset'); - }); - - it("should remove dashboard when remove dashboard process completed", async function() { - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="removeDashboard"]'); - await page.waitForSelector('.modal.open'); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); - await button.click(); - await page.mouse.move(-10, -10); - await page.waitForTimeout(200); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); - }); - - it("should not fail when default widget selection changed", async function() { - await page.goto(url); - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="setAsDefaultWidgets"]'); - var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); - await button.click(); - await page.waitForTimeout(200); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('default_widget_selection_changed'); - }); - - it("should create new dashboard with new default widget selection when create dashboard process completed", async function() { - await page.click('.dashboard-manager .title'); - await page.click('li[data-action="createDashboard"]'); - await page.waitForSelector('#createDashboardName', { visible: true }); - - // try to type the text a few times, as it sometimes doesn't get the full value - var name = 'newdash2'; - for (var i=0; i<5; i++) { - await page.evaluate(function() { - $('#createDashboardName').val(''); - }); - await page.type('#createDashboardName', name); - await page.waitForTimeout(500); // sometimes the text doesn't seem to type fast enough - - var value = await page.evaluate(function() { - return $('#createDashboardName').prop('value'); - }); - - if (value === name) { - break; - } - } - - var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)'); - await button.click(); - await page.mouse.move(-10, -10); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('create_new'); - }); - - it("should load segmented dashboard", async function() { - await removeAllExtraDashboards(); - await page.goto(url + '&segment=' + encodeURIComponent("browserCode==FF")); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('segmented'); - }); - - it("should load correctly with token_auth", async function() { - testEnvironment.testUseMockAuth = 0; - testEnvironment.save(); - - var tokenAuth = "a4ca4238a0b923820dcc509a6f75849f"; - await page.goto(url.replace("idDashboard=5", "idDashboard=1") + '&token_auth=' + tokenAuth); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('loaded_token_auth'); - }); - - it("should fail to load with invalid token_auth", async function() { - testEnvironment.testUseMockAuth = 0; - testEnvironment.save(); - - var tokenAuth = "anyInvalidToken"; - await page.goto(url.replace("idDashboard=5", "idDashboard=1") + '&token_auth=' + tokenAuth); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('invalid_token_auth'); - }); - - + testEnvironment.completeNoChallenge = true; + testEnvironment.pluginsToLoad = ['CustomDirPlugin']; + testEnvironment.save(); + }); + + after(function () { + delete testEnvironment.queryParamOverride; + delete testEnvironment.completeNoChallenge; + }); + + it("should load dashboard2 correctly", async function () { + await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=2"); + await page.waitForNetworkIdle(); + await page.evaluate(function () { + // Prevent random sizing error eg. http://builds-artifacts.matomo.org/ui-tests.master/2301.1/screenshot-diffs/diffviewer.html + $("[widgetid=widgetActionsgetOutlinks] .widgetContent").text('Displays different at random -> hidden'); + }); + + pageWrap = await page.$('.pageWrap'); + expect(await pageWrap.screenshot()).to.matchImage('dashboard2'); + }); + + it("should load dashboard3 correctly", async function () { + await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=3"); + await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + + pageWrap = await page.$('.pageWrap'); + expect(await pageWrap.screenshot()).to.matchImage('dashboard3'); + }); + + it("should load dashboard4 correctly", async function () { + await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=4"); + await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + await page.evaluate(() => { // give table headers constant width so the screenshot stays the same + $('.dataTableScroller').css('overflow-x', 'scroll'); + }); + await page.waitForTimeout(500); + pageWrap = await page.$('.pageWrap'); + expect(await pageWrap.screenshot()).to.matchImage('dashboard4'); + }); + + it("should load dashboard5 correctly", async function () { + await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=5"); + await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + + pageWrap = await page.$('.pageWrap'); + expect(await pageWrap.screenshot()).to.matchImage('dashboard5'); + }); + + it("should display dashboard correctly on a mobile phone", async function () { + await page.webpage.setViewport({ + width: 480, + height: 320 + }); + await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=1"); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('dashboard1_mobile'); + }); }); diff --git a/plugins/Dashboard/tests/UI/WidgetizedDashboard_spec.js b/plugins/Dashboard/tests/UI/WidgetizedDashboard_spec.js new file mode 100644 index 00000000000..2e17961bbf9 --- /dev/null +++ b/plugins/Dashboard/tests/UI/WidgetizedDashboard_spec.js @@ -0,0 +1,334 @@ +/*! + * Matomo - free/libre analytics platform + * + * Dashboard screenshot tests. + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("WidgetizedDashboard", function () { + this.timeout(0); + + var url = "?module=Widgetize&action=iframe&idSite=1&period=year&date=2012-08-09&moduleToWidgetize=Dashboard&" + + "actionToWidgetize=index&idDashboard=1"; + + var removeAllExtraDashboards = async function() { + var dashboards = await testEnvironment.callController("Dashboard.getAllDashboards", {}); + dashboards = (dashboards || []).filter(function (dash) { + return parseInt(dash.iddashboard) > 5; + }); + + var removeDashboard = async function (i) { + if (i >= dashboards.length) { + return; + } + + console.log("Removing dashboard ID = " + dashboards[i].iddashboard); + await testEnvironment.callApi("Dashboard.removeDashboard", {idDashboard: dashboards[i].iddashboard}); + await removeDashboard(i + 1); + }; + + await removeDashboard(0); + }; + + var setup = async function() { + // make sure live widget doesn't refresh constantly for UI tests + testEnvironment.overrideConfig('General', 'live_widget_refresh_after_seconds', 1000000); + // ensure tour widget always shows the same state + testEnvironment.completeAllChallenges = 1; + testEnvironment.testUseMockAuth = 1; + testEnvironment.save(); + + // save empty layout for dashboard ID = 1 + var layout = [ + [ + { + uniqueId: "widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution", + parameters: {module: "VisitsSummary", action: "getEvolutionGraph", columns: "nb_visits"} + } + ], + [], + [] + ]; + + await testEnvironment.callController("Dashboard.saveLayout", {name: 'D4', layout: JSON.stringify(layout), idDashboard: 1, idSite: 2}); + await testEnvironment.callController("Dashboard.saveLayoutAsDefault", {layout: 0}); + await removeAllExtraDashboards(); + }; + + before(setup); + after(setup); + + it("should load correctly", async function() { + await page.goto(url); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('loaded'); + }); + + it("should move a widget when widget is drag & dropped", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + await page.mouse.down(); + + var col2 = await page.jQuery('#dashboardWidgetsArea > .col:eq(2)'); + await col2.hover(); + await page.mouse.up(); + await page.waitForNetworkIdle(); + await page.waitForTimeout(100); + await page.mouse.move(-10, -10); + + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_move'); + }); + + it("should refresh widget when widget refresh icon clicked", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + + await page.click('.button#refresh'); + await page.mouse.move(-10, -10); + + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_refresh'); + }); + + it("should minimise widget when widget minimise icon clicked", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + await page.click('.button#minimise'); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_minimised'); + }); + + it("should unminimise widget when widget maximise icon is clicked after being minimised", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + await page.click('.button#maximise'); + await page.mouse.move(-10, -10); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_unminimise'); + }); + + it("should maximise widget when widget maximise icon is clicked", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + await page.click('.button#maximise'); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_maximise'); + }); + + it("should close maximise dialog when minimise icon is clicked", async function() { + var widget = await page.$('.widgetTop'); + await widget.hover(); + await page.click('.button#minimise'); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_unmaximise'); + }); + + it("should add a widget when a widget is selected in the dashboard manager", async function() { + await page.click('.dashboard-manager .title'); + + await page.waitForSelector('.widgetpreview-categorylist>li'); + + var live = await page.jQuery('.widgetpreview-categorylist>li:contains(Goals)'); // have to mouse move twice... otherwise Live! will just be highlighted + await live.hover(); + await live.click(); + + var behaviour = await page.jQuery('.widgetpreview-categorylist>li:contains(Behaviour):first'); + await behaviour.hover(); + await behaviour.click(); + + var pages = await page.jQuery('.widgetpreview-widgetlist>li:contains(Pages):first'); + await pages.hover(); + await pages.click(); + + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_add_widget'); + }); + + it("should open row evolution", async function() { + var row = await page.jQuery('#dashboardWidgetsArea .dataTable tbody td:contains(thankyou)'); + await row.hover(); + var icon = await page.waitForSelector('#dashboardWidgetsArea .dataTable tbody a.actionRowEvolution'); + await icon.click(); + await page.waitForSelector('.ui-dialog'); + await page.waitForNetworkIdle(); + var dialog = await page.$('.ui-dialog'); + expect(await dialog.screenshot()).to.matchImage('rowevolution'); + }); + + it("should remove widget when remove widget icon is clicked", async function() { + await page.click('.ui-dialog-titlebar-close'); // close row evolution + + var widget = '[id="widgetActionsgetPageUrls"]'; + + var titlebar = await page.$(widget + ' .widgetTop'); + await titlebar.hover(); + + var icon = await page.$(widget + ' .button#close'); + await icon.click(); + + var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); + await button.click(); + + await page.mouse.move(-10, -10); + await page.waitForTimeout(250); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('widget_move_removed'); + }); + + it("should change dashboard layout when new layout is selected", async function() { + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="showChangeDashboardLayoutDialog"]'); + await page.click('.modal.open div[layout="50-50"]'); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Save)'); + await button.click(); + await page.mouse.move(-10, -10); + await page.waitForTimeout(250); // animation + await page.evaluate(() => $('.evolution-annotations').css('display','none')); + expect(await page.screenshot({ fullPage: true })).to.matchImage('change_layout'); + }); + + it("should rename dashboard when dashboard rename process completed", async function() { + await page.evaluate(() => $('.evolution-annotations').css('display','none')); + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="renameDashboard"]'); + await page.evaluate(() => $('#newDashboardName').val('newname')); + await page.waitForTimeout(250); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Save)'); + await button.click(); + await page.mouse.move(-10, -10); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('rename'); + }); + + it("should copy dashboard successfully when copy dashboard process completed", async function() { + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="copyDashboardToUser"]'); + await page.waitForTimeout(100); // wait for animation + await page.evaluate(function () { + $('#copyDashboardName').val(''); + }); + await page.type('#copyDashboardName', 'new 💩'); + await page.waitForSelector('#copyDashboardUser [value="superUserLogin"]'); + await page.select('#copyDashboardUser', 'superUserLogin'); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)'); + await button.click(); + await page.waitForFunction("$('.ui-confirm :contains(\"Current dashboard successfully copied to selected user.\").length > 0')"); + + await page.goto(url.replace("idDashboard=1", "idDashboard=6")); + await page.mouse.move(-10, -10); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('copied'); + }); + + it("should reset dashboard when reset dashboard process completed", async function() { + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="resetDashboard"]'); + await page.waitForSelector('.modal.open'); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); + await button.click(); + await page.waitForNetworkIdle(); + await page.mouse.move(-10, -10); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + await page.waitForTimeout(500); // wait for widgets to render fully + + expect(await page.screenshot({ fullPage: true })).to.matchImage('reset'); + }); + + it("should remove dashboard when remove dashboard process completed", async function() { + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="removeDashboard"]'); + await page.waitForSelector('.modal.open'); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); + await button.click(); + await page.mouse.move(-10, -10); + await page.waitForTimeout(200); + await page.waitForNetworkIdle(); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('removed'); + }); + + it("should not fail when default widget selection changed", async function() { + await page.goto(url); + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="setAsDefaultWidgets"]'); + var button = await page.jQuery('.modal.open .modal-footer a:contains(Yes)'); + await button.click(); + await page.waitForTimeout(200); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('default_widget_selection_changed'); + }); + + it("should create new dashboard with new default widget selection when create dashboard process completed", async function() { + await page.click('.dashboard-manager .title'); + await page.click('li[data-action="createDashboard"]'); + await page.waitForSelector('#createDashboardName', { visible: true }); + + // try to type the text a few times, as it sometimes doesn't get the full value + var name = 'newdash2'; + for (var i=0; i<5; i++) { + await page.evaluate(function() { + $('#createDashboardName').val(''); + }); + await page.type('#createDashboardName', name); + await page.waitForTimeout(500); // sometimes the text doesn't seem to type fast enough + + var value = await page.evaluate(function() { + return $('#createDashboardName').prop('value'); + }); + + if (value === name) { + break; + } + } + + var button = await page.jQuery('.modal.open .modal-footer a:contains(Ok)'); + await button.click(); + await page.mouse.move(-10, -10); + await page.waitForSelector('.widget'); + await page.waitForNetworkIdle(); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('create_new'); + }); + + it("should load segmented dashboard", async function() { + await removeAllExtraDashboards(); + await page.goto(url + '&segment=' + encodeURIComponent("browserCode==FF")); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('segmented'); + }); + + it("should load correctly with token_auth", async function() { + testEnvironment.testUseMockAuth = 0; + testEnvironment.save(); + + var tokenAuth = "a4ca4238a0b923820dcc509a6f75849f"; + await page.goto(url.replace("idDashboard=5", "idDashboard=1") + '&token_auth=' + tokenAuth); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('loaded_token_auth'); + }); + + it("should fail to load with invalid token_auth", async function() { + testEnvironment.testUseMockAuth = 0; + testEnvironment.save(); + + var tokenAuth = "anyInvalidToken"; + await page.goto(url.replace("idDashboard=5", "idDashboard=1") + '&token_auth=' + tokenAuth); + + expect(await page.screenshot({ fullPage: true })).to.matchImage('invalid_token_auth'); + }); + + +}); diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png index 7d32c7b5c04..177624b9f80 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_create_new.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c2ed2d28fff739a93c6323ed836ea3fa6b997e5344c501f86294932d2a5b655 -size 305124 +oid sha256:105ec5c0d9ae68a17e189b55606cccf72dae21810f460497767d1b19e04f98d6 +size 3423 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_expanded.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_expanded.png index 88a9e77fb5c..acc2f198433 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_expanded.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_expanded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9556c3fdcc024c8c39851c9f664718c5d6319d73b3ad26fc683157ccfdf21d8c -size 53097 +oid sha256:6da361c457e8b591d0c81e14787bea4dfd6595d89e73d9ee6892b8df0a083a30 +size 52878 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png index a501ecdde9e..a1bbd486d52 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_removed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cdb66fc60cc11b9c9d15e7415c52a237be370416ccef7f8077cc7262986bc6a4 -size 509165 +oid sha256:59f6117157112d7f40888aea65b299bda61e2d1d8da30948e65983f82c2d24f3 +size 12584 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_list_shown.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_list_shown.png index 072d6f68c33..ba86398eb71 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_list_shown.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_list_shown.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68a07ee081ddd8a95c25729c1ce85ee82dccd3cf724b8f8c4207792de6a8b5f0 -size 66432 +oid sha256:749d1e78a9f86baa8da9577c1b02ed6df60db5f17c1f46daf57874abad3a62b8 +size 66199 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png index 43e1a4c6bda..4639e279cd6 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:faf79059ac38b159b35c3f231aef10016697d6b92c4f86f4e52a617550f1f003 -size 78857 +oid sha256:c7dfa986d198808eedb3d4a1de9a43ed54b3e58fc5ebb6dbb79a5dcac4830fa6 +size 78611 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_change_layout.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_change_layout.png deleted file mode 100644 index f7233d6e18c..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_change_layout.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f809c402825a72351aa6ba468f398b8b77ee4452956402ac4450ceab929ed65b -size 28113 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_copied.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_copied.png deleted file mode 100644 index a79a1f7cf46..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_copied.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:384bce1f3eedd99c61136254f7e6d80fa7875774fe9a99e7017b192df58d3742 -size 29971 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_create_new.png deleted file mode 100644 index b7b63bc70b6..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_create_new.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c82c83a647d18c297311b489a73ebd51c5667a11d4489cd8a729ab75d11c9bdd -size 29732 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard5_mobile.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard1_mobile.png similarity index 100% rename from tests/UI/expected-screenshots/UIIntegrationTest_dashboard5_mobile.png rename to plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard1_mobile.png diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard2.png similarity index 100% rename from tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png rename to plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard2.png diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard3.png similarity index 100% rename from tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png rename to plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard3.png diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard4.png similarity index 100% rename from tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png rename to plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard4.png diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard5.png similarity index 100% rename from tests/UI/expected-screenshots/UIIntegrationTest_dashboard4.png rename to plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_dashboard5.png diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_default_widget_selection_changed.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_default_widget_selection_changed.png deleted file mode 100644 index 3fe1ffdb2aa..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_default_widget_selection_changed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c46bdb8572fb3c308cd7730fd3fe4cd9e06c2b60ccbe7c2dd1f68e21cdc8af7a -size 29126 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded.png deleted file mode 100644 index 57ea13aa6f2..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6b823a9ee4e4975dfa787b4100fc2a0ff90927e6e6c4afd1eb9a338e0af4d9aa -size 28665 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png deleted file mode 100644 index 45b2b376248..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_removed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02fdd95c806cf2efe9c50ef392d4aaf09f5a3fde63218a0bc4500812c1ca6290 -size 772798 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rename.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rename.png deleted file mode 100644 index 84aec70abcd..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rename.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf293a49c319248666cd9c216391d73deba62114318bd3a47f3dcb967ea70ce9 -size 28780 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png deleted file mode 100644 index f3fc33136bf..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_reset.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:455818085d8b885c5db2ad10814d65cdeb9902b8f6498bdab8a8ee489db42eae -size 361757 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_segmented.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_segmented.png deleted file mode 100644 index 18ad8c3142c..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_segmented.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3827012f4fd236a907b2c0bec46dd23637b648b0e542094a9fe446bddce7fcd -size 30080 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_add_widget.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_add_widget.png deleted file mode 100644 index 7e4cd33ab10..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_add_widget.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:44bb9433bcfc93a023b06ed447812179622c92e12561a65af9981d20b8e8c28c -size 210394 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png deleted file mode 100644 index 7a8b6b146c3..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:113a638395c1f93ea7e3724b8a1c189efb0b1b132f9086bdf131ca12aba3a05a -size 33445 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_minimised.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_minimised.png deleted file mode 100644 index 07cfd678d2e..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_minimised.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b91c2950902ed6cd5410bf6567d64420c2275809a56c609379b9ba05c82e378f -size 21891 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move.png deleted file mode 100644 index 818daefaa15..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:371d3113b1c65bf513b8484af5828478da97fa2530f6cde838f47d9a349567d5 -size 28737 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move_removed.png deleted file mode 100644 index 818daefaa15..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_move_removed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:371d3113b1c65bf513b8484af5828478da97fa2530f6cde838f47d9a349567d5 -size 28737 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_refresh.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_refresh.png deleted file mode 100644 index 818daefaa15..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_refresh.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:371d3113b1c65bf513b8484af5828478da97fa2530f6cde838f47d9a349567d5 -size 28737 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png deleted file mode 100644 index 3a6b0ea2d7a..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:374c917fad157cf5f511b247f5e07fcb3ab488cec27c9ae07625b73b721522ef -size 31525 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unminimise.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unminimise.png deleted file mode 100644 index 818daefaa15..00000000000 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unminimise.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:371d3113b1c65bf513b8484af5828478da97fa2530f6cde838f47d9a349567d5 -size 28737 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_change_layout.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_change_layout.png new file mode 100644 index 00000000000..7f62e90b399 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_change_layout.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27a924addf803ef572f9cc37bacd8ed1aeab70252dae5dccc36f67ded94ca727 +size 28495 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_copied.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_copied.png new file mode 100644 index 00000000000..b4b2d000e05 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_copied.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0aabc6fe8fc38f5c19da1b9e96aa22f500f5c5a21006d44736ee5c4465154a87 +size 30261 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_create_new.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_create_new.png new file mode 100644 index 00000000000..7e08922c461 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_create_new.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a1667d6de67938e0a7674c535571b28fac9dedd39e6583f2815ba45d9dd1c80 +size 30023 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_default_widget_selection_changed.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_default_widget_selection_changed.png new file mode 100644 index 00000000000..f40b33f1271 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_default_widget_selection_changed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43b2b90718a12eee80b4b356c91da2390db27a1df85e7f8ed36eae961c378fea +size 29441 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_invalid_token_auth.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_invalid_token_auth.png similarity index 100% rename from plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_invalid_token_auth.png rename to plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_invalid_token_auth.png diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded.png new file mode 100644 index 00000000000..45b73d24e34 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a744da1eb80f57d38ea298b4011336f7004bdc92a7e5d3a9f803097711326fb +size 29044 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded_token_auth.png similarity index 100% rename from plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_loaded_token_auth.png rename to plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_loaded_token_auth.png diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_removed.png new file mode 100644 index 00000000000..f40b33f1271 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_removed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43b2b90718a12eee80b4b356c91da2390db27a1df85e7f8ed36eae961c378fea +size 29441 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rename.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rename.png new file mode 100644 index 00000000000..5ded70249ab --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rename.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3cb5ce217c2c78f309889f3e772b0318bc0a2a4d9fec89954658f71bca88a16 +size 29095 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_reset.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_reset.png new file mode 100644 index 00000000000..e4e91764279 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_reset.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ecc9fc473a3a6456ed1fac0f4c6c16fed9dc7f09654d62b79d24ec6cde10854 +size 362006 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rowevolution.png similarity index 100% rename from plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png rename to plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_rowevolution.png diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_segmented.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_segmented.png new file mode 100644 index 00000000000..f380a4cb9bb --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_segmented.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38308e1dc0a19008cffc0b340029c932a0d6fe297070f0eff84dc12efc05b3f6 +size 30391 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_add_widget.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_add_widget.png new file mode 100644 index 00000000000..d4adc7d79a7 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_add_widget.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:597d4392e0a335b820bab8793144ca7f72db4b17635d22a9ec659d4dcb4e1737 +size 210817 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_maximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_maximise.png new file mode 100644 index 00000000000..a176d1bdddf --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_maximise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d76f238f69e46dff4d24b310f6d04096d0b11ecd82a3fc5222553a51d8b4cd6 +size 33744 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_minimised.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_minimised.png new file mode 100644 index 00000000000..5fcca8bad91 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_minimised.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a5a636b319b4143c6d0e1edd5c2b26f13b8a13361fcf146c390ffaddc7400b6 +size 22197 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move.png new file mode 100644 index 00000000000..cf1ab6d909d --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db2aad46a711054b02e0bde72a3014fec985d5db43fec982153629dc9e85e94a +size 29114 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move_removed.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move_removed.png new file mode 100644 index 00000000000..cf1ab6d909d --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_move_removed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db2aad46a711054b02e0bde72a3014fec985d5db43fec982153629dc9e85e94a +size 29114 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_refresh.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_refresh.png new file mode 100644 index 00000000000..cf1ab6d909d --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_refresh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db2aad46a711054b02e0bde72a3014fec985d5db43fec982153629dc9e85e94a +size 29114 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unmaximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unmaximise.png new file mode 100644 index 00000000000..7384715e334 --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unmaximise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04fa3bfb076c435aa678d91123ccbaac0ca7ba2ae327e25cb9740020bcfa7acd +size 31893 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unminimise.png b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unminimise.png new file mode 100644 index 00000000000..cf1ab6d909d --- /dev/null +++ b/plugins/Dashboard/tests/UI/expected-screenshots/WidgetizedDashboard_widget_unminimise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db2aad46a711054b02e0bde72a3014fec985d5db43fec982153629dc9e85e94a +size 29114 diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index da64a7e54f8..f48550b6d57 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -368,6 +368,33 @@ private function addNewSitesForSiteSelector() /** Creates two dashboards that split the widgets up into different groups. */ public function setupDashboards() { + $oldGet = $_GET; + + $_GET['idSite'] = 1; + $_GET['token_auth'] = \Piwik\Piwik::getCurrentUserTokenAuth(); + + // create almost empty dashboard first, as this will be loaded as default quite often + $dashboard = [ + [ + [ + 'uniqueId' => "widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution", + 'parameters' => [ + 'module' => 'VisitsSummary', + 'action' => 'getEvolutionGraph', + 'forceView' => '1', + 'viewDataTable' => 'graphEvolution' + ] + ] + ], + [], + [] + ]; + + $_GET['name'] = 'D4'; + $_GET['layout'] = json_encode($dashboard); + $_GET['idDashboard'] = 1; + FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout'); + $dashboardColumnCount = 3; $dashboardCount = 4; @@ -381,10 +408,6 @@ public function setupDashboards() $dashboards[] = $layout; } - $oldGet = $_GET; - $_GET['idSite'] = 1; - $_GET['token_auth'] = \Piwik\Piwik::getCurrentUserTokenAuth(); - // collect widgets & sort them so widget order is not important $allWidgets = Request::processRequest('API.getWidgetMetadata', [ 'idSite' => 1 @@ -459,33 +482,10 @@ public function setupDashboards() $_GET['name'] = 'dashboard name' . $id; } $_GET['layout'] = json_encode($layout); - $_GET['idDashboard'] = $id + 1; + $_GET['idDashboard'] = $id + 2; FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout'); } - // create empty dashboard - $dashboard = [ - [ - [ - 'uniqueId' => "widgetVisitsSummarygetEvolutionGraphforceView1viewDataTablegraphEvolution", - 'parameters' => [ - 'module' => 'VisitsSummary', - 'action' => 'getEvolutionGraph', - 'forceView' => '1', - 'viewDataTable' => 'graphEvolution' - ] - ] - ], - [], - [] - ]; - - $_GET['name'] = 'D4'; - $_GET['layout'] = json_encode($dashboard); - $_GET['idDashboard'] = 5; - $_GET['idSite'] = 2; - FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout'); - $_GET = $oldGet; } diff --git a/tests/UI/expected-screenshots/Menus_mobile_left.png b/tests/UI/expected-screenshots/Menus_mobile_left.png index 13b0bd6e1a6..2b1be5bfef6 100644 --- a/tests/UI/expected-screenshots/Menus_mobile_left.png +++ b/tests/UI/expected-screenshots/Menus_mobile_left.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3e7ef6320ff5d65ffa53f586a0b4ffbc1e092ea7bd5352f7c72eeb1266681b6 -size 207791 +oid sha256:1f84e05966f4821892cea97a9d450ecdb4b91018f36caf843274f4be028e0d88 +size 207829 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_1.png b/tests/UI/expected-screenshots/QuickAccess_search_1.png index f7d7961d1b3..be20fe39b6a 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_1.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f54cbdbf504c5195571050c99bef149d8ee8ff235b8eefaa331a898a3800bdb7 -size 95872 +oid sha256:ab5638dc2113dfeb23351029c78b9bead6d7e272404d49395100f47ac8c0410a +size 95866 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_2.png b/tests/UI/expected-screenshots/QuickAccess_search_2.png index 48e0d900e60..351e5baf48a 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_2.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:11c98a45bb9144dde7e7af7df02d34c7a20aaf7a0ac4720820e77a8c8c5510ea -size 14309 +oid sha256:15a5644a3dac994b5bb4f68dce7d586296badac0191a8e0cd5d24e20c2bc9678 +size 14308 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_category.png b/tests/UI/expected-screenshots/QuickAccess_search_category.png index e9d0ca27c1c..c4f60f5c54d 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_category.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_category.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b819e34887c8bfde0a8ed9cf7253deaf9a5a569475c47e993e26e062f19dfa02 +oid sha256:08ae36ba445dcaf2117e80522f00b0ab2e1ed1587e52a7fd4f49e27d24c680d7 size 11249 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_no_result.png b/tests/UI/expected-screenshots/QuickAccess_search_no_result.png index fca4db0a554..950394587fd 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_no_result.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_no_result.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b59b820f96f9c31f74f0c860a0435982e04991ac1bf0539cfc45f71b7ff9026 -size 6549 +oid sha256:97db9e9cc24af9727234585a3feceaca46babeab03fa7a76af2af752b110243f +size 6548 diff --git a/tests/UI/expected-screenshots/QuickAccess_search_sites.png b/tests/UI/expected-screenshots/QuickAccess_search_sites.png index 65b2f61552d..383da15a97d 100644 --- a/tests/UI/expected-screenshots/QuickAccess_search_sites.png +++ b/tests/UI/expected-screenshots/QuickAccess_search_sites.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a57eae31b0acb3bc8d4446b26b3293a248c59123c1e35259ec879e1f03a6140 -size 44004 +oid sha256:703f1e434c84b96400d1a71c71843c56742b63a56167703098234d1b0a28975e +size 44003 diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png index 33d4557b532..b46bc55f468 100644 --- a/tests/UI/expected-screenshots/Theme_home.png +++ b/tests/UI/expected-screenshots/Theme_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cf6b9dfd842daad5ebc0b50177a950c2d7cac827c80dcc6900e3c7a61c374a8 -size 779091 +oid sha256:7329afc5e9de1eb3fd7f7b8ad5d4a90f46617a1f1f0300abdc86a3b1c34a8687 +size 72103 diff --git a/tests/UI/specs/Comparison_spec.js b/tests/UI/specs/Comparison_spec.js index b0b3ef87c57..e5c4e6b93df 100644 --- a/tests/UI/specs/Comparison_spec.js +++ b/tests/UI/specs/Comparison_spec.js @@ -10,7 +10,7 @@ describe("Comparison", function () { const generalParams = 'idSite=1&period=range&date=2012-01-12,2012-01-17', urlBase = 'module=CoreHome&action=index&' + generalParams, - dashboardUrl = "?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=5", + dashboardUrl = "?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=1", comparePeriod = "&compareDates[]=2012-01-01,2012-01-31&comparePeriods[]=range", compareSegment = "&compareSegments[]=continentCode%3D%3Deur", compareParams = comparePeriod + compareSegment, diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js index 9c8fdb2481c..65e63072ea1 100644 --- a/tests/UI/specs/UIIntegration_spec.js +++ b/tests/UI/specs/UIIntegration_spec.js @@ -56,72 +56,6 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? testEnvironment.save(); }); - // dashboard tests - describe("dashboard", function () { - this.title = parentSuite.title; // to make sure the screenshot prefix is the same - - it("should load dashboard1 correctly", async function () { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=1"); - await page.waitForNetworkIdle(); - await page.evaluate(function () { - // Prevent random sizing error eg. http://builds-artifacts.matomo.org/ui-tests.master/2301.1/screenshot-diffs/diffviewer.html - $("[widgetid=widgetActionsgetOutlinks] .widgetContent").text('Displays different at random -> hidden'); - }); - - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('dashboard1'); - }); - - it("should load dashboard2 correctly", async function () { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=2"); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('dashboard2'); - }); - - it("should load dashboard3 correctly", async function () { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=3"); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - await page.evaluate(() => { // give table headers constant width so the screenshot stays the same - $('.dataTableScroller').css('overflow-x', 'scroll'); - }); - await page.waitForTimeout(500); - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('dashboard3'); - }); - - it("should load dashboard4 correctly", async function () { - await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=4"); - await page.waitForNetworkIdle(); - await page.waitForSelector('.widget'); - await page.waitForNetworkIdle(); - - pageWrap = await page.$('.pageWrap'); - expect(await pageWrap.screenshot()).to.matchImage('dashboard4'); - }); - - it("should display dashboard correctly on a mobile phone", async function () { - await page.webpage.setViewport({ - width: 480, - height: 320 - }); - await page.goto("?" + urlBase + "#?" + generalParams + "&category=Dashboard_Dashboard&subcategory=5"); - await page.waitForNetworkIdle(); - - expect(await page.screenshot({ fullPage: true })).to.matchImage('dashboard5_mobile'); - - await page.webpage.setViewport({ - width: 1350, - height: 768 - }); - }); - }); - describe("misc", function () { this.title = parentSuite.title; // to make sure the screenshot prefix is the same