Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-01-22 07:23:56 +0300
committerGitHub <noreply@github.com>2019-01-22 07:23:56 +0300
commitf845d5290931829dab8d038ae10991692a387c48 (patch)
treef27dd2e26f915b35dfe98ea018bcfd373048e9bb /plugins/SegmentEditor/tests
parent2d6c8e597d110e2664a866cf667c2ea6e2cc2909 (diff)
Add UI test for complex segment + fix couple bugs to get test to pass. (#13909)
* Add UI test for complex segment + fix couple bugs to get test to pass. * fix test
Diffstat (limited to 'plugins/SegmentEditor/tests')
-rw-r--r--plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
index b6d4df0691..2b17e6f7ae 100644
--- a/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
+++ b/plugins/SegmentEditor/tests/UI/SegmentSelectorEditor_spec.js
@@ -27,6 +27,7 @@ describe("SegmentSelectorEditorTest", function () {
$(fieldName + ' .dropdown-content.active li:contains("' + textToSelect + '"):first').click();
}, fieldName, textToSelect);
});
+ page.click({ x: -10, y: -10 });
}
function selectDimension(page, prefixSelector, category, name)
@@ -226,4 +227,50 @@ describe("SegmentSelectorEditorTest", function () {
page.click('.segmentationContainer .title');
}, done);
});
+
+ it('should correctly handle complex segments w/ encoded characters and whitespace', function (done) {
+ expect.screenshot('complex_segment').to.be.capture(function (page) {
+ page.load(url);
+
+ page.click('.segmentationContainer .title');
+ page.click('a.add_new_segment');
+ page.sendKeys('input.edit_segment_name', 'complex segment');
+
+ selectDimension(page, '.segmentRow0', 'Visitors', 'Browser');
+ selectFieldValue(page, '.segmentRow0 .segment-row:eq(0) .metricMatchBlock', 'Is not');
+
+ page.evaluate(function () {
+ var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3';
+ $('.segmentRow0 .segment-row:first .metricValueBlock input').val(complexValue).change();
+ });
+
+ page.click('.segment-add-or');
+
+ // configure or condition
+ selectDimension(page, '.segmentRow0 .segment-row:eq(1)', 'Visitors', 'Browser');
+ selectFieldValue(page, '.segmentRow0 .segment-row:eq(1) .metricMatchBlock', 'Is');
+
+ page.evaluate(function () {
+ var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3';
+ $('.segmentRow0 .segment-row:eq(1) .metricValueBlock input').val(complexValue).change();
+ });
+
+ page.click('.segment-add-row');
+
+ // configure and condition
+ selectDimension(page, '.segmentRow1', 'Visitors', 'Browser');
+ selectFieldValue(page, '.segmentRow1 .segment-row:first .metricMatchBlock', 'Is not');
+
+ page.evaluate(function () {
+ var complexValue = 's#2&#--_*+?# #5"\'&<>.22,3';
+ $('.segmentRow1 .metricValueBlock input').val(complexValue).change();
+ });
+ page.evaluate(function () {
+ $('button.saveAndApply').click();
+ });
+ page.evaluate(function () {
+ console.log(window.location.href);
+ });
+ }, done);
+ });
});