From 51671aff44f2ec35174f2a64a7dbd66147799ee8 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 20 Apr 2020 17:26:00 +0200 Subject: fix metric tooltip ui test --- .../UI/expected-screenshots/UIIntegrationTest_metric_tooltip.png | 4 ++-- tests/UI/specs/UIIntegration_spec.js | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_metric_tooltip.png b/tests/UI/expected-screenshots/UIIntegrationTest_metric_tooltip.png index 716e918254..76163d8ebc 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_metric_tooltip.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_metric_tooltip.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87a2486fc08fd803cbf9d27370b95dc768fa2e69fcca27d25799597f02e53e3c -size 8451 +oid sha256:7446dc1f9fe69fde5206e0688fb166479987a281ab41848c8ce9280df296efda +size 8449 diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js index 72cb206829..5e205a280c 100644 --- a/tests/UI/specs/UIIntegration_spec.js +++ b/tests/UI/specs/UIIntegration_spec.js @@ -378,15 +378,18 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? let elem = await page.jQuery('[data-report="Referrers.getReferrerType"] #nb_visits .thDIV'); await elem.hover(); - await page.jQuery('.columnDocumentation:visible', { waitFor: true }); + let tip = await page.jQuery('.columnDocumentation:visible', { waitFor: true }); + + // manipulate the styles a bit, as it's otherwise not visible on screenshot await page.evaluate(function(){ $('.columnDocumentation:visible').css({ display: 'block!important', + top: 50, + left: 100 }); }); - await page.waitFor(500); - expect(await page.screenshotSelector('.columnDocumentation:visible')).to.matchImage('metric_tooltip'); + expect(await tip.screenshot()).to.matchImage('metric_tooltip'); }); it('should load the referrers > search engines & keywords page correctly', async function () { -- cgit v1.2.3