diff options
author | sgiehl <stefan@matomo.org> | 2022-06-23 17:42:49 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2022-06-23 17:42:49 +0300 |
commit | e3a9ffe0809bc86d4cdb8de4bd6eaac2298da3bc (patch) | |
tree | 22669d99d58e518444751f78ed9f242c1babf20d /plugins/SegmentEditor/tests | |
parent | f12cb9625dc9eaf4ac50293c67525abb5a232bd4 (diff) |
Fix long failing SegmentSelectorEditor testfixtests
Diffstat (limited to 'plugins/SegmentEditor/tests')
-rw-r--r-- | plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js | 27 | ||||
-rw-r--r-- | plugins/SegmentEditor/tests/UI/expected-screenshots/SegmentSelectorEditorTest_complex_segment.png | 4 |
2 files changed, 10 insertions, 21 deletions
diff --git a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js index 738868ae90..63bcae5b46 100644 --- a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js +++ b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js @@ -17,12 +17,8 @@ describe("SegmentSelectorEditorTest", function () { async function selectFieldValue(fieldName, textToSelect) { - await page.webpage.evaluate((fieldName) => { - $(fieldName + ' input.select-dropdown').click(); - }, fieldName); - await page.webpage.evaluate((fieldName, textToSelect) => { - $(fieldName + ' .dropdown-content.active li:contains("' + textToSelect + '"):first').click(); - }, fieldName, textToSelect); + await (await page.jQuery(fieldName + ' input.select-dropdown', { waitFor: true })).click(); + await (await page.jQuery(fieldName + ' .dropdown-content li:contains("' + textToSelect + '"):first', { waitFor: true })).click(); await page.mouse.move(-10, -10); } @@ -267,10 +263,9 @@ describe("SegmentSelectorEditorTest", function () { await selectDimension('.segmentRow0', 'Visitors', 'Browser'); await selectFieldValue('.segmentRow0 .segment-row:eq(0) .metricMatchBlock', 'Is not'); - await page.evaluate(function () { - var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3'; - $('.segmentRow0 .segment-row:first .metricValueBlock input').val(complexValue).change(); - }); + var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3'; + await (await page.jQuery('.segmentRow0 .segment-row:first .metricValueBlock input')).type(complexValue); + await page.waitForTimeout(200); await page.click('.segment-add-or'); await page.waitForFunction(() => !! $('.segmentRow0 .segment-row:eq(1)').length); @@ -279,10 +274,8 @@ describe("SegmentSelectorEditorTest", function () { await selectDimension('.segmentRow0 .segment-row:eq(1)', 'Visitors', 'Browser'); await selectFieldValue('.segmentRow0 .segment-row:eq(1) .metricMatchBlock', 'Is'); - await page.evaluate(function () { - var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3'; - $('.segmentRow0 .segment-row:eq(1) .metricValueBlock input').val(complexValue).change(); - }); + await (await page.jQuery('.segmentRow0 .segment-row:eq(1) .metricValueBlock input')).type(complexValue); + await page.waitForTimeout(200); await page.click('.segment-add-row'); await page.waitForSelector('.segmentRow1 .segment-row'); @@ -291,11 +284,7 @@ describe("SegmentSelectorEditorTest", function () { await selectDimension('.segmentRow1', 'Visitors', 'Browser'); await selectFieldValue('.segmentRow1 .segment-row:first .metricMatchBlock', 'Is not'); - await page.evaluate(function () { - var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3'; - $('.segmentRow1 .metricValueBlock input').val(complexValue).change(); - }); - + await (await page.jQuery('.segmentRow1 .metricValueBlock input')).type(complexValue); await page.waitForTimeout(200); await page.evaluate(function () { diff --git a/plugins/SegmentEditor/tests/UI/expected-screenshots/SegmentSelectorEditorTest_complex_segment.png b/plugins/SegmentEditor/tests/UI/expected-screenshots/SegmentSelectorEditorTest_complex_segment.png index d6263760f6..e30af2a820 100644 --- a/plugins/SegmentEditor/tests/UI/expected-screenshots/SegmentSelectorEditorTest_complex_segment.png +++ b/plugins/SegmentEditor/tests/UI/expected-screenshots/SegmentSelectorEditorTest_complex_segment.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5f0b13892d997be58e77ca6b15e094a4a96d6d846f7becc7008742e4cc9e9efc -size 143342 +oid sha256:1b46a96af8b1243bdd0601b9411066331cd6b3504e3e5e86c5720dfef633703f +size 380388 |