diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-09-01 16:37:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 16:37:38 +0300 |
commit | a3ee690ea3863ff16a828ac0afbc77243bb45f5b (patch) | |
tree | 77f3341e86608894b1020725700b348bbcd44567 /plugins/CustomDimensions | |
parent | ba1facfd1ecb4e618f3162aedbdb3170e9461e50 (diff) |
Use newer version of Puppeteer for UI tests (#17880)
* Use latest version of Puppeteer for UI tests
* use newer node on travis
* test
* use waitForTimeout / waitForSelector instead of waitFor
* Handle BC for removed waitFor method
* Updates expected UI test files
* update submodules
* improve/fix some UI tests
* Updates expected UI test files
* improve/fix some UI tests
* update url-parse dependency
* simplify some UI tests
* update screenshot
* avoid using merged assets that are broken
* fix expected compare exit code
* don't use merged assets for TwoFactorAuth UI tests
it seems due to too many requests to login, logout and other pages merging the CoreJS assets somehow fails, and results in returning an empty file. Even the reload fails to serve the correct content, so maybe the file, the content should be written to, is somehow locked. Disabling the merged assets seems to fix this issue for this tests. Locally the tests are also running correctly with merged assets.
* improve handling of automatic css / js reloading in UI tests
* increase timeouts of TwoFactorAuth UI tests
* fix 2fa ui test
* revert change
* update new screenshot
* updates UI screenshots
* submodule updates
Diffstat (limited to 'plugins/CustomDimensions')
11 files changed, 36 insertions, 34 deletions
diff --git a/plugins/CustomDimensions/tests/UI/CustomDimensions_spec.js b/plugins/CustomDimensions/tests/UI/CustomDimensions_spec.js index 1aed4a0176..329c32fda5 100644 --- a/plugins/CustomDimensions/tests/UI/CustomDimensions_spec.js +++ b/plugins/CustomDimensions/tests/UI/CustomDimensions_spec.js @@ -24,27 +24,28 @@ describe("CustomDimensions", function () { var popupSelector = '.ui-dialog:visible'; async function capturePageWrap (screenName, test) { - await test(); - var elem = await page.jQuery('.pageWrap'); - expect(await elem.screenshot()).to.matchImage(screenName); + await captureSelector(screenName, '.pageWrap', test) } async function captureSelector (screenName, selector, test) { + await page.webpage.setViewport({ + width: 1350, + height: 768, + }); await test(); - var elem = await page.jQuery(selector); - expect(await elem.screenshot()).to.matchImage(screenName); + expect(await page.screenshotSelector(selector)).to.matchImage(screenName); } async function closeOpenedPopover() { - await page.waitFor(100); + await page.waitForTimeout(100); const closeButton = await page.jQuery('.ui-dialog:visible .ui-icon-closethick:visible'); if (!closeButton) { return; } await closeButton.click(); - await page.waitFor(100); + await page.waitForTimeout(100); } async function triggerRowAction(labelToClick, nameOfRowActionToTrigger) @@ -52,11 +53,11 @@ describe("CustomDimensions", function () { var rowToMatch = 'td.label:contains(' + labelToClick + '):first'; await (await page.jQuery('table.dataTable tbody ' + rowToMatch)).hover(); - await page.waitFor(50); + await page.waitForTimeout(50); await (await page.jQuery(rowToMatch + ' a.'+ nameOfRowActionToTrigger + ':visible')).hover(); // necessary to get popover to display await (await page.jQuery(rowToMatch + ' a.' + nameOfRowActionToTrigger + ':visible')).click(); await page.mouse.move(-10, -10); - await page.waitFor(250); // wait for animation + await page.waitForTimeout(250); // wait for animation await page.waitForNetworkIdle(); } @@ -86,7 +87,7 @@ describe("CustomDimensions", function () { await page.goto( "?" + urlBase + "#?" + generalParams + "&category=Goals_Goals&subcategory=General_Overview"); await (await page.jQuery('.reportsByDimensionView .dimension:contains(MyName1)')).click(); await page.waitForNetworkIdle(); - await page.waitFor(100); + await page.waitForTimeout(100); }); }); @@ -108,12 +109,13 @@ describe("CustomDimensions", function () { it('should offer only segmented visitor log and row action for first level entries', async function () { await capturePageWrap('report_actions_rowactions', async function () { - await (await page.jQuery('td.label:contains(en):first')).hover(); + await page.hover('tr:first-child td.label'); }); }); it('should be able to render insights', async function () { await capturePageWrap('report_action_insights', async function () { + await page.mouse.move(0, 0); await page.evaluate(function(){ $('[data-footer-icon-id="insightsVisualization"]').click(); }); @@ -146,7 +148,7 @@ describe("CustomDimensions", function () { await (await page.jQuery('.dataTable .subDataTable .value:contains(en):first')).click(); await page.waitForNetworkIdle(); await (await page.jQuery('td.label:contains(en_US)')).hover(); - await page.waitFor(100); + await page.waitForTimeout(100); }); }); @@ -169,9 +171,9 @@ describe("CustomDimensions", function () { await page.goto(reportUrlDimension3); await (await page.jQuery('.dataTable .subDataTable .value:contains(en):first')).click(); await page.waitForNetworkIdle(); - await page.waitFor(100); + await page.waitForTimeout(100); await (await page.jQuery('td.label:contains(en_US)')).hover(); - await page.waitFor(100); + await page.waitForTimeout(100); await triggerRowAction('en_US', 'actionTransitions'); }); }); diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action.png index 5a8af9f5c5..e60fa0e00f 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8bbb87ed594a62115a605fe4887f13a1dbbb8637544763e77855f843e1f1869 -size 28747 +oid sha256:adedd01ca10b9805ae9a40a88936d2ce80e09430918cd0a5cf85172f9f1482d9 +size 30844 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_insights.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_insights.png index f4c4bca85e..30fff46fd4 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_insights.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_insights.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed42e651e67b065861556c898c2fe001b8c1a41a9511c70594d000466ab66744 -size 31867 +oid sha256:602134cce513f2284c9e1481fe52dd23304b8919c8e2571e11578850237d77f5 +size 30740 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png index 2520f01035..6765908e4c 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:62c436230351fa8304633315b2f2967195a00b43257a944283d74921be736bdc -size 53014 +oid sha256:502c692ae468f9d294ae83902c8222afb4fc3f7a8d1b3dea53bca2505f21c9c4 +size 56262 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png index 01224b4494..416b66d07d 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:932a692a8708986cf165484598f4cfa6774ecef70aa4d463f3519d1f3a9b637c -size 74177 +oid sha256:6368680ecc7e5982ddd961fe1b3dc1d257d68879d2122f8e382e15de21679391 +size 74140 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png index 3f7086c9fe..82e5e940f7 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0e85ea9d85f3c1b0ce1fc5ea9d017b73bb69320d7632419230010f5bb3130e -size 83646 +oid sha256:e80673f1b62256a6760afd19ac8eb13c07413c4fff615a49d9259fa7a2be9546 +size 83644 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png index 8ac2bd6eac..35aeb50e8f 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b583778122329745abd12f69cdc51006fa889677e0055341b5171db17b0b411f -size 31887 +oid sha256:de9a7441eeec02ed6c0eaacf58fb14fe14fcd851edc0d5acbfdbff7eb08217fc +size 33729 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png index 19405f4018..65a5718b17 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9cfc899633bead41bffc486b99434c27ef987892213b1e12aceb7f85a13d2bb3 -size 64404 +oid sha256:bf25b1aa3ca129e0b54df11e5de08097256e911946a4e4ff086b6d70621773a2 +size 64439 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_segmented_visitorlog.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_segmented_visitorlog.png index d0fc011e38..6559166c58 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_segmented_visitorlog.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_segmented_visitorlog.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:859274ab2a28c233cd91f61b4e42900a4f3554b948c37cb9f47ccd51eb984a56 -size 118695 +oid sha256:c43ccaa361c22602defc19b854b2319ffb027e7a3e618b4347a86b4b2b797d43 +size 118687 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_goals_overview.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_goals_overview.png index 42bbd023f2..54ee01d97a 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_goals_overview.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_goals_overview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa2ad7bedc67e12b50977b5eb03186961af944ecd335ee44aa75baeae73ad208 -size 69652 +oid sha256:bec61778342a5246850e71f6f9a6971824d93f98ad76ad67df5417c8adb1782e +size 71713 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_visit.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_visit.png index c7fb6f8559..b360054aec 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_visit.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_visit.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7e863697a73b5e7e3fc61e75926e8b48103da6d0cac0844adcc65af14773c176 -size 23463 +oid sha256:f6fac7d21dd5e7e737c965de7d3355a908b249a395e23bae391c06ddaaf69674 +size 24312 |