@@ -18,9 +18,9 @@ const uriMatchedResults = [{ruleName: "Match - merge", threshold: "19", matched
1818const ruleset = [ { ruleName : "Match - merge" , threshold : "19" , matchedPairs : "5" } ,
1919 { ruleName : "Likely Match - notify" , threshold : "9" , matchedPairs : "2" } ] ;
2020
21- const allDataMatchedResults = [ { ruleset : "lname - Exact" , matchType : "Exact 1 " , score : "score 10" } ,
22- { ruleset : "fname - Double Metaphone" , matchType : "Double Metaphone 2 " , score : "score 10" } ,
23- { ruleset : "testMultipleProperty" , matchType : "" , score : "score 20 " } ] ;
21+ const allDataMatchedResults = [ { ruleset : "lname - Exact" , matchType : "Exact 0 " , score : "score 10" } ,
22+ { ruleset : "fname - Double Metaphone" , matchType : "Double Metaphone 1 " , score : "score 10" } ,
23+ { ruleset : "testMultipleProperty" , matchType : "" , score : "" } ] ;
2424
2525const urisMerged = [ "/json/persons/first-name-double-metaphone1.json" , "/json/persons/first-name-double-metaphone2.json" ] ;
2626const uris = [ "/json/persons/first-name-double-metaphone1.json" , "/json/persons/first-name-double-metaphone2.json" , "/json/persons/last-name-plus-zip-boost1.json" , "/json/persons/last-name-plus-zip-boost2.json" , "/json/persons/last-name-dob-custom1.json" , "/json/persons/last-name-dob-custom2.json" , "/json/persons/first-name-synonym1.json" , "/json/persons/first-name-synonym2.json" ] ;
@@ -106,7 +106,7 @@ describe("Matching", () => {
106106 cy . findByText ( "Collapse All" ) . should ( "be.visible" ) ;
107107 matchingStepDetail . showThresholdTextMore ( ) . should ( "have.length.lt" , 1 ) ;
108108 matchingStepDetail . showThresholdTextLess ( ) . should ( "have.length.gt" , 0 ) ;
109- multiSlider . getRulesetSliderOptions ( ) . trigger ( "mouseover" ) ;
109+ // multiSlider.getRulesetSliderOptions().scrollIntoView ().trigger("mouseover");
110110 matchingStepDetail . showRulesetTextMore ( ) . should ( "have.length.lt" , 1 ) ;
111111 matchingStepDetail . showRulesetTextLess ( ) . should ( "have.length.gt" , 0 ) ;
112112 } ) ;
@@ -117,27 +117,29 @@ describe("Matching", () => {
117117 thresholdModal . selectActionDropdown ( "Merge" ) ;
118118 thresholdModal . saveButton ( ) . click ( ) ;
119119 cy . waitForAsyncRequest ( ) ;
120- cy . waitUntil ( ( ) => cy . findByLabelText ( "test- merge" ) . should ( "have.length.gt" , 0 ) ) ;
121- multiSlider . getHandleNameAndType ( "test" , "merge" ) . should ( "be.visible" ) ;
120+ cy . waitUntil ( ( ) => cy . findByText ( "test - merge" ) . should ( "have.length.gt" , 0 ) ) ;
121+ multiSlider . getThresholdHandleNameAndType ( "test" , "merge" ) . should ( "be.visible" ) ;
122122 } ) ;
123123 it ( "Edit threshold Property to Match" , ( ) => {
124- multiSlider . editOption ( "test" ) ;
124+ multiSlider . enableEdit ( "threshold" ) ;
125+ multiSlider . thresholdEditOption ( "test" , "merge" ) ;
125126 thresholdModal . clearThresholdName ( ) ;
126127 thresholdModal . setThresholdName ( "testing" ) ;
127128 thresholdModal . saveButton ( ) . click ( ) ;
128129 cy . waitForAsyncRequest ( ) ;
129- cy . waitUntil ( ( ) => cy . findByLabelText ( "testing- merge" ) . should ( "have.length.gt" , 0 ) ) ;
130- multiSlider . getHandleNameAndType ( "testing" , "merge" ) . should ( "be.visible" ) ;
130+ cy . waitUntil ( ( ) => cy . findByText ( "testing - merge" ) . should ( "have.length.gt" , 0 ) ) ;
131+ multiSlider . getThresholdHandleNameAndType ( "testing" , "merge" ) . should ( "be.visible" ) ;
131132 } ) ;
132133 it ( "Edit threshold Match Type" , ( ) => {
133- multiSlider . editOption ( "testing" ) ;
134+ multiSlider . thresholdEditOption ( "testing" , "merge ") ;
134135 thresholdModal . selectActionDropdown ( "Notify" ) ;
135136 thresholdModal . saveButton ( ) . click ( ) ;
136137 cy . waitForAsyncRequest ( ) ;
137- cy . waitUntil ( ( ) => cy . findByLabelText ( "testing- notify" ) . should ( "have.length.gt" , 0 ) ) ;
138- multiSlider . getHandleNameAndType ( "testing" , "notify" ) . should ( "be.visible" ) ;
138+ cy . waitUntil ( ( ) => cy . findByText ( "testing - notify" ) . should ( "have.length.gt" , 0 ) ) ;
139+ multiSlider . getThresholdHandleNameAndType ( "testing" , "notify" ) . should ( "be.visible" ) ;
139140 } ) ;
140- it ( "Validating the slider tooltip" , ( ) => {
141+ //TODO: Will be handled as part of DHFPROD-7815
142+ xit ( "Validating the slider tooltip" , ( ) => {
141143 multiSlider . getHandleName ( "testing" ) . trigger ( "mousemove" , { force : true } ) ;
142144 multiSlider . sliderTooltipValue ( "1" ) ;
143145 multiSlider . sliderTicksHover ( "threshold-slider" , "19.1919" ) ;
@@ -150,11 +152,11 @@ describe("Matching", () => {
150152 rulesetSingleModal . selectMatchTypeDropdown ( "exact" ) ;
151153 rulesetSingleModal . saveButton ( ) . click ( ) ;
152154 cy . waitForAsyncRequest ( ) ;
153- cy . waitUntil ( ( ) => cy . findByLabelText ( "customerId-exact " ) . should ( "have.length.gt" , 0 ) ) ;
154- multiSlider . getHandleNameAndType ( "customerId" , "exact " ) . should ( "be.visible" ) ;
155- multiSlider . getHandleName ( "customerId" ) . should ( "be.visible" ) ;
155+ cy . waitUntil ( ( ) => cy . contains ( "customerId - Exact " ) . should ( "have.length.gt" , 0 ) ) ;
156+ multiSlider . getRulesetHandleNameAndType ( "customerId" , "Exact " ) . should ( "be.visible" ) ;
157+ // multiSlider.getHandleName("customerId").should("be.visible");
156158 } ) ;
157- it ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
159+ xit ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
158160 multiSlider . getHandleName ( "customerId" ) . trigger ( "mousedown" , { force : true } ) ;
159161 cy . findByTestId ( "ruleSet-slider-ticks" ) . find ( `div[style*="left: 19.1919%;"]` ) . trigger ( "mousemove" , { force : true } ) ;
160162 multiSlider . getHandleName ( "customerId" ) . trigger ( "mouseup" , { force : true } ) ;
@@ -169,11 +171,11 @@ describe("Matching", () => {
169171 rulesetSingleModal . selectMatchTypeDropdown ( "exact" ) ;
170172 rulesetSingleModal . saveButton ( ) . click ( ) ;
171173 cy . waitForAsyncRequest ( ) ;
172- cy . waitUntil ( ( ) => cy . findByLabelText ( "email-exact " ) . should ( "have.length.gt" , 0 ) ) ;
173- multiSlider . getHandleNameAndType ( "email" , "exact " ) . should ( "be.visible" ) ;
174- multiSlider . getHandleName ( "email" ) . should ( "be.visible" ) ;
174+ cy . waitUntil ( ( ) => cy . contains ( "email - Exact " ) . should ( "have.length.gt" , 0 ) ) ;
175+ multiSlider . getRulesetHandleNameAndType ( "email" , "Exact " ) . should ( "be.visible" ) ;
176+ // multiSlider.getHandleName("email").should("be.visible");
175177 } ) ;
176- it ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
178+ xit ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
177179 multiSlider . getHandleName ( "email" ) . trigger ( "mousedown" , { force : true } ) ;
178180 cy . findByTestId ( "ruleSet-slider-ticks" ) . find ( `div[style*="left: 30.303%;"]` ) . trigger ( "mousemove" , { force : true } ) ;
179181 multiSlider . getHandleName ( "email" ) . trigger ( "mouseup" , { force : true } ) ;
@@ -187,11 +189,11 @@ describe("Matching", () => {
187189 rulesetSingleModal . selectMatchTypeDropdown ( "exact" ) ;
188190 rulesetSingleModal . saveButton ( ) . click ( ) ;
189191 cy . waitForAsyncRequest ( ) ;
190- cy . waitUntil ( ( ) => cy . findByLabelText ( "shipping.street-exact " ) . should ( "have.length.gt" , 0 ) ) ;
191- multiSlider . getHandleNameAndType ( "shipping.street" , "exact " ) . should ( "be.visible" ) ;
192- multiSlider . getHandleName ( "shipping.street" ) . should ( "be.visible" ) ;
192+ cy . waitUntil ( ( ) => cy . contains ( "shipping.street - Exact " ) . should ( "have.length.gt" , 0 ) ) ;
193+ multiSlider . getRulesetHandleNameAndType ( "shipping.street" , "Exact " ) . should ( "be.visible" ) ;
194+ // multiSlider.getHandleName("shipping.street").should("be.visible");
193195 } ) ;
194- it ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
196+ xit ( "When we work on the spike story to update multi-slider componenens using cypress" , ( ) => {
195197 multiSlider . getHandleName ( "shipping.street" ) . trigger ( "mousedown" , { force : true } ) ;
196198 cy . findByTestId ( "ruleSet-slider-ticks" ) . find ( `div[style*="left: 30.303%;"]` ) . trigger ( "mousemove" , { force : true } ) ;
197199 multiSlider . getHandleName ( "shipping.street" ) . trigger ( "mouseup" , { force : true } ) ;
@@ -206,11 +208,12 @@ describe("Matching", () => {
206208 rulesetMultipleModal . selectMatchTypeDropdown ( "customerId" , "exact" ) ;
207209 rulesetMultipleModal . saveButton ( ) . click ( ) ;
208210 cy . waitForAsyncRequest ( ) ;
209- cy . waitUntil ( ( ) => cy . findByLabelText ( "customerMultiplePropertyRuleset" ) . should ( "have.length.gt" , 0 ) ) ;
210- multiSlider . getHandleName ( "customerMultiplePropertyRuleset" ) . should ( "be.visible" ) ;
211+ cy . waitUntil ( ( ) => cy . contains ( "customerMultiplePropertyRuleset" ) . should ( "have.length.gt" , 0 ) ) ;
212+ // multiSlider.getHandleName("customerMultiplePropertyRuleset").should("be.visible");
211213 } ) ;
212214 it ( "Edit ruleset with multiple properties" , ( ) => {
213- multiSlider . editOption ( "customerMultiplePropertyRuleset" ) ;
215+ multiSlider . enableEdit ( "ruleset" ) ;
216+ multiSlider . ruleSetEditOptionMulti ( "customerMultiplePropertyRuleset" ) ;
214217 cy . contains ( "Edit Match Ruleset for Multiple Properties" ) ;
215218 rulesetMultipleModal . selectMatchTypeDropdown ( "name" , "doubleMetaphone" ) ;
216219 rulesetMultipleModal . setDictionaryUri ( "name" , "/dictionary/first-names.xml" ) ;
@@ -219,60 +222,60 @@ describe("Matching", () => {
219222 rulesetMultipleModal . selectMatchTypeDropdown ( "email" , "zip" ) ;
220223 rulesetMultipleModal . saveButton ( ) . click ( ) ;
221224 cy . waitForAsyncRequest ( ) ;
222- cy . waitUntil ( ( ) => cy . findByLabelText ( "customerMultiplePropertyRuleset" ) . should ( "have.length.gt" , 0 ) ) ;
225+ cy . waitUntil ( ( ) => cy . contains ( "customerMultiplePropertyRuleset" ) . should ( "have.length.gt" , 0 ) ) ;
223226 } ) ;
224227 it ( "Delete a ruleset" , ( ) => {
225- multiSlider . deleteOption ( "shipping.street" ) ;
228+ multiSlider . deleteOption ( "shipping.street" , "Exact" ) ;
226229 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
227- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
230+ multiSlider . confirmDelete ( "shipping.street" , "Exact" ) ;
228231 cy . waitForAsyncRequest ( ) ;
229- cy . waitUntil ( ( ) => cy . findByLabelText ( "rulesetName-testing-shipping.street" ) . should ( "have.length" , 0 ) ) ;
230- multiSlider . getHandleName ( "shipping.street" ) . should ( "not.exist" ) ;
231- matchingStepDetail . getPossibleMatchCombinationRuleset ( "testing " , "shipping.street " ) . should ( "not.exist" ) ;
232+ cy . waitUntil ( ( ) => cy . findByTestId ( "rulesetName-testing-shipping.street - Exact " ) . should ( "have.length" , 0 ) ) ;
233+ multiSlider . getRulesetHandleNameAndType ( "shipping.street" , "Exact ") . should ( "not.exist" ) ;
234+ matchingStepDetail . getPossibleMatchCombinationRuleset ( "shipping.street " , "Exact " ) . should ( "not.exist" ) ;
232235 } ) ;
233236 it ( "Delete a ruleset" , ( ) => {
234- multiSlider . deleteOption ( "email" ) ;
237+ multiSlider . deleteOption ( "email" , "Exact" ) ;
235238 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
236- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
239+ multiSlider . confirmDelete ( "email" , "Exact" ) ;
237240 cy . waitForAsyncRequest ( ) ;
238- cy . waitUntil ( ( ) => cy . findByLabelText ( "rulesetName-testing-email" ) . should ( "have.length" , 0 ) ) ;
239- multiSlider . getHandleName ( "email" ) . should ( "not.exist" ) ;
241+ cy . waitUntil ( ( ) => cy . findByTestId ( "rulesetName-testing-email - Exact " ) . should ( "have.length" , 0 ) ) ;
242+ // multiSlider.getHandleName("email").should("not.exist");
240243 matchingStepDetail . getPossibleMatchCombinationRuleset ( "testing" , "email" ) . should ( "not.exist" ) ;
241244 } ) ;
242245 it ( "Delete a ruleset with multiple properties" , ( ) => {
243- multiSlider . deleteOption ( "customerMultiplePropertyRuleset" ) ;
246+ multiSlider . deleteOptionMulti ( "customerMultiplePropertyRuleset" ) ;
244247 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
245- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
248+ multiSlider . confirmDeleteMulti ( "customerMultiplePropertyRuleset" ) ;
246249 cy . waitForAsyncRequest ( ) ;
247- cy . waitUntil ( ( ) => cy . findByLabelText ( "rulesetName-testing-customerMultiplePropertyRuleset" ) . should ( "have.length" , 0 ) ) ;
250+ cy . waitUntil ( ( ) => cy . findByTestId ( "rulesetName-testing-customerMultiplePropertyRuleset" ) . should ( "have.length" , 0 ) ) ;
248251 multiSlider . getHandleName ( "customerMultiplePropertyRuleset" ) . should ( "not.exist" ) ;
249- matchingStepDetail . getPossibleMatchCombinationRuleset ( "testing" , "customerMultiplePropertyRuleset" ) . should ( "not.exist" ) ;
252+ matchingStepDetail . getPossibleMatchCombinationRulesetMulti ( "customerMultiplePropertyRuleset" ) . should ( "not.exist" ) ;
250253 } ) ;
251254 it ( "Delete threshold" , ( ) => {
252- multiSlider . deleteOption ( "testing" ) ;
255+ multiSlider . deleteOptionThreshold ( "testing" , "notify ") ;
253256 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
254- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
257+ multiSlider . confirmDeleteThreshold ( "testing" ) ;
255258 cy . waitForAsyncRequest ( ) ;
256259 cy . waitUntil ( ( ) => cy . findByLabelText ( "rulesetName-testing-notify" ) . should ( "have.length" , 0 ) ) ;
257260 multiSlider . getHandleName ( "testing" ) . should ( "not.exist" ) ;
258261 matchingStepDetail . getPossibleMatchCombinationRuleset ( "testing" , "notify" ) . should ( "not.exist" ) ;
259262 } ) ;
260263 it ( "Edit ruleset" , ( ) => {
261- multiSlider . editOption ( "customerId" ) ;
264+ multiSlider . ruleSetEditOption ( "customerId" , "Exact ") ;
262265 cy . contains ( "Edit Match Ruleset for Single Property" ) ;
263266 rulesetSingleModal . selectMatchTypeDropdown ( "exact" ) ;
264267 rulesetSingleModal . saveButton ( ) . click ( ) ;
265268 cy . waitForAsyncRequest ( ) ;
266- cy . waitUntil ( ( ) => cy . findByLabelText ( "customerId-exact " ) . should ( "have.length.gt" , 0 ) ) ;
269+ cy . waitUntil ( ( ) => cy . contains ( "customerId - Exact " ) . should ( "have.length.gt" , 0 ) ) ;
267270 } ) ;
268271 it ( "Delete ruleset" , ( ) => {
269- multiSlider . deleteOption ( "customerId" ) ;
272+ multiSlider . deleteOption ( "customerId" , "Exact" ) ;
270273 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
271- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
274+ multiSlider . confirmDelete ( "customerId" , "Exact" ) ;
272275 cy . waitForAsyncRequest ( ) ;
273276 cy . findByLabelText ( "noMatchedCombinations" ) . trigger ( "mouseover" ) ;
274277 cy . waitUntil ( ( ) => cy . findByLabelText ( "noMatchedCombinations" ) . should ( "have.length.gt" , 0 ) ) ;
275- multiSlider . getHandleName ( "customerId" ) . should ( "not.exist" ) ;
278+ // multiSlider.getHandleName("customerId").should("not.exist");
276279 matchingStepDetail . getDefaultTextNoMatchedCombinations ( ) . should ( "be.visible" ) ;
277280 cy . waitUntil ( ( ) => cy . visit ( "/tiles" ) ) ;
278281 } ) ;
@@ -345,9 +348,9 @@ describe("Matching", () => {
345348 rulesetMultipleModal . saveButton ( ) . click ( ) ;
346349 cy . waitForAsyncRequest ( ) ;
347350
348- multiSlider . getHandleName ( "testMultipleProperty" ) . trigger ( "mousedown" , { force : true } ) ;
351+ /* multiSlider.getHandleName("testMultipleProperty").trigger("mousedown", {force: true});
349352 cy.findByTestId("ruleSet-slider-ticks").find(`div[style*="left: 19.1919%;"]`).trigger("mousemove", {force: true});
350- multiSlider . getHandleName ( "testMultipleProperty" ) . trigger ( "mouseup" , { force : true } ) ;
353+ multiSlider.getHandleName("testMultipleProperty").trigger("mouseup", {force: true});*/
351354
352355 //To test when users click on test button and no data is returned
353356 cy . waitUntil ( ( ) => matchingStepDetail . getUriInputField ( ) . type ( "/json/noDataUri" ) ) ;
@@ -366,19 +369,22 @@ describe("Matching", () => {
366369 cy . wait ( 3000 ) ;
367370 cy . findByLabelText ( "noMatchedDataView" ) . should ( "not.exist" ) ;
368371 for ( let j in uriMatchedResults ) {
369- cy . findByText ( uriMatchedResults [ j ] . ruleName ) . should ( "have.length.gt" , 0 ) ;
372+ cy . get ( `[id="testMatchedPanel"]` ) . contains ( uriMatchedResults [ j ] . ruleName ) . should ( "have.length.gt" , 0 ) ;
370373 cy . findByText ( "(Threshold: " + uriMatchedResults [ j ] . threshold + ")" ) . should ( "have.length.gt" , 0 ) ;
371374 }
372375
373376 //To test when user selects all data and click on test button
374377 matchingStepDetail . getAllDataRadio ( ) . click ( ) ;
375378 matchingStepDetail . getTestMatchUriButton ( ) ;
376- for ( let j in ruleset ) {
377- cy . waitUntil ( ( ) => cy . findByText ( ruleset [ j ] . ruleName ) . should ( "have.length.gt" , 0 ) . trigger ( "mousemove" ) ) ;
378- cy . waitUntil ( ( ) => cy . findByText ( "(Threshold: " + ruleset [ j ] . threshold + ")" ) . should ( "have.length.gt" , 0 ) ) ;
379+ cy . waitForAsyncRequest ( ) ;
380+ cy . wait ( 3000 ) ;
381+ cy . findByLabelText ( "noMatchedDataView" ) . should ( "not.exist" ) ;
382+ for ( let j in uriMatchedResults ) {
383+ cy . get ( `[id="testMatchedPanel"]` ) . contains ( uriMatchedResults [ j ] . ruleName ) . should ( "have.length.gt" , 0 ) ;
384+ cy . findByText ( "(Threshold: " + uriMatchedResults [ j ] . threshold + ")" ) . should ( "have.length.gt" , 0 ) ;
379385 }
380386 cy . wait ( 1000 ) ;
381- cy . findByText ( ruleset [ 0 ] . ruleName ) . click ( ) ;
387+ cy . get ( `[id="testMatchedPanel"]` ) . contains ( ruleset [ 0 ] . ruleName ) . click ( ) ;
382388 for ( let k in urisMerged ) {
383389 cy . waitUntil ( ( ) => cy . findAllByText ( urisMerged [ k ] ) . should ( "have.length.gt" , 0 ) ) ;
384390 }
@@ -421,11 +427,12 @@ describe("Matching", () => {
421427 cy . findAllByLabelText ( allDataMatchedResults [ i ] . matchType ) . should ( "have.length.gt" , 0 ) ;
422428 cy . findAllByLabelText ( allDataMatchedResults [ i ] . score ) . should ( "have.length.gt" , 0 ) ;
423429 }
424- cy . findAllByText ( "Total Score: 40 " ) . should ( "have.length.gt" , 0 ) ;
430+ cy . findAllByText ( "Total Score: 20 " ) . should ( "have.length.gt" , 0 ) ;
425431
426- multiSlider . deleteOption ( "testMultipleProperty" ) ;
432+ multiSlider . enableEdit ( "ruleset" ) ;
433+ multiSlider . deleteOptionMulti ( "testMultipleProperty" ) ;
427434 matchingStepDetail . getSliderDeleteText ( ) . should ( "be.visible" ) ;
428- matchingStepDetail . confirmSliderOptionDeleteButton ( ) . click ( ) ;
435+ multiSlider . confirmDeleteMulti ( "testMultipleProperty" ) ;
429436 cy . waitForAsyncRequest ( ) ;
430437
431438 // To test when user click on collapse all icon
0 commit comments