diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-01-22 07:23:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 07:23:56 +0300 |
commit | f845d5290931829dab8d038ae10991692a387c48 (patch) | |
tree | f27dd2e26f915b35dfe98ea018bcfd373048e9bb /plugins/SegmentEditor/tests | |
parent | 2d6c8e597d110e2664a866cf667c2ea6e2cc2909 (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.js | 47 |
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); + }); }); |