@@ -4,13 +4,34 @@ import entitiesSidebar from "../../support/pages/entitiesSidebar";
44import { toolbar } from "../../support/components/common" ;
55import monitorPage from "../../support/pages/monitor" ;
66import browsePage from "../../support/pages/browse" ;
7- import runPage from "../../support/pages/run" ;
87import loadPage from "../../support/pages/load" ;
9- import "cypress-wait-until ";
8+ import runPage from "../../support/pages/run ";
109
1110describe ( "Monitor Tile" , ( ) => {
1211 before ( ( ) => {
1312 cy . loginAsDeveloper ( ) . withRequest ( ) ;
13+ cy . createFlowWithApi ( flowName ) ;
14+ cy . addStepToFlowWithApi ( flowName , "loadPersonJSON" , "ingestion" ) ;
15+ cy . addStepToFlowWithApi ( flowName , "mapPersonJSON" , "mapping" ) ;
16+ cy . addStepToFlowWithApi ( flowName , "match-person" , "matching" ) ;
17+ cy . addStepToFlowWithApi ( flowName , "merge-person" , "merging" ) ;
18+ cy . addStepToFlowWithApi ( flowName , "master-person" , "mastering" ) ;
19+ cy . addStepToFlowWithApi ( flowName , "mapCustomersJSON" , "mapping" ) ;
20+ cy . addStepToFlowWithApi ( flowName , "mapClientJSON" , "mapping" ) ;
21+ cy . addStepToFlowWithApi ( flowName , "loadPersonJSON" , "ingestion" ) ;
22+ cy . addStepToFlowWithApi ( flowName , "mapOfficeStep" , "mapping" ) ;
23+ runPage . navigate ( ) ;
24+ cy . intercept ( "GET" , "/api/jobs/**" ) . as ( "runResponse" ) ;
25+ runPage . runFlow ( flowName ) ;
26+ cy . uploadFile ( "patients/first-name-double-metaphone1.json" ) ;
27+ cy . uploadFile ( "patients/first-name-double-metaphone2.json" ) ;
28+ cy . wait ( "@runResponse" ) ;
29+ cy . waitForAsyncRequest ( ) ;
30+ runPage . verifyFlowModalCompleted ( flowName ) ;
31+ runPage . closeFlowStatusModal ( flowName ) ;
32+ } ) ;
33+
34+ beforeEach ( ( ) => {
1435 monitorPage . navigate ( ) ;
1536 } ) ;
1637
@@ -41,44 +62,7 @@ describe("Monitor Tile", () => {
4162 let orginalDateTimeArr : any [ ] = [ ] ;
4263 const flowName = "testMonitor" ;
4364
44- it ( "Can create flow and add steps to flow and reorder flow" , { defaultCommandTimeout : 120000 } , ( ) => {
45- //Verify create flow and add all user-defined steps to flow via Run tile
46- toolbar . getRunToolbarIcon ( ) . should ( "be.visible" ) . click ( ) ;
47- cy . waitForAsyncRequest ( ) ;
48- runPage . createFlowButton ( ) . click ( { force : true } ) ;
49- runPage . newFlowModal ( ) . should ( "be.visible" ) ;
50- runPage . setFlowName ( flowName ) ;
51- loadPage . confirmationOptions ( "Save" ) . click ( ) ;
52- runPage . addStep ( flowName ) ;
53- runPage . addStepToFlow ( "loadPersonJSON" ) ;
54- runPage . addStep ( flowName ) ;
55- runPage . addStepToFlow ( "mapPersonJSON" ) ;
56- runPage . addStep ( flowName ) ;
57- runPage . addStepToFlow ( "match-person" ) ;
58- runPage . addStep ( flowName ) ;
59- runPage . addStepToFlow ( "merge-person" ) ;
60- runPage . addStep ( flowName ) ;
61- runPage . addStepToFlow ( "master-person" ) ;
62- runPage . addStep ( flowName ) ;
63- runPage . addStepToFlow ( "mapCustomersJSON" ) ;
64- runPage . addStep ( flowName ) ;
65- runPage . addStepToFlow ( "mapClientJSON" ) ;
66- runPage . addStep ( flowName ) ;
67- runPage . addStepToFlow ( "mapOfficeStep" ) ;
68- runPage . addStep ( flowName ) ;
69-
70- cy . intercept ( "GET" , "/api/jobs/**" ) . as ( "runResponse" ) ;
71- runPage . runFlow ( flowName ) ;
72- cy . uploadFile ( "patients/first-name-double-metaphone1.json" ) ;
73- cy . uploadFile ( "patients/first-name-double-metaphone2.json" ) ;
74- cy . wait ( "@runResponse" ) ;
75- cy . waitForAsyncRequest ( ) ;
76- runPage . verifyFlowModalCompleted ( flowName ) ;
77- runPage . closeFlowStatusModal ( flowName ) ;
78- } ) ;
79-
8065 it ( "Validate column order for Step Name, Step Type, StatusEntity, Type Start, Date and Time part 1" , ( ) => {
81- monitorPage . navigate ( ) ;
8266 cy . log ( "**expand table and get data column of JobId**" ) ;
8367 monitorPage . getTableRows ( ) . then ( ( $els ) => {
8468 return (
@@ -156,7 +140,6 @@ describe("Monitor Tile", () => {
156140 } ) ;
157141
158142 it ( "Ascending order validations Validate column order for Step Name, Step Type, StatusEntity, Type Start, Date and Time " , ( ) => {
159-
160143 cy . log ( "**order original job id array**" ) ;
161144 firstPageTableCellsJobId . forEach ( element => cy . log ( element ) ) ;
162145
@@ -199,7 +182,7 @@ describe("Monitor Tile", () => {
199182
200183 it ( "Descending order validations for column order for Step Name, Step Type, StatusEntity, Type Start, Date and Time " , ( ) => {
201184 cy . log ( "**check step name order DESC**" ) ;
202- monitorPage . getOrderColumnMonitorTable ( "Step Name" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . dblclick ( { force : true } ) . then ( ( ) => {
185+ monitorPage . getOrderColumnMonitorTable ( "Step Name" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . click ( { force : true } ) . click ( { force : true } ) . then ( ( ) => {
203186 monitorPage . getTableNestedRows ( ) . should ( "be.visible" ) ;
204187 monitorPage . getRowData ( firstPageTableCellsJobId , "stepNameDiv" ) . then ( ( $row ) => {
205188 Cypress . $ . makeArray ( $row )
@@ -212,7 +195,7 @@ describe("Monitor Tile", () => {
212195 } ) ;
213196
214197 cy . log ( "**check step type order DESC**" ) ;
215- monitorPage . getOrderColumnMonitorTable ( "Step Type" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . dblclick ( { force : true } ) . then ( ( ) => {
198+ monitorPage . getOrderColumnMonitorTable ( "Step Type" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . click ( { force : true } ) . click ( { force : true } ) . then ( ( ) => {
216199 monitorPage . getTableNestedRows ( ) . should ( "be.visible" ) ;
217200 monitorPage . getRowData ( firstPageTableCellsJobId , "stepType" ) . then ( ( $row ) => {
218201 Cypress . $ . makeArray ( $row )
@@ -225,7 +208,7 @@ describe("Monitor Tile", () => {
225208 } ) ;
226209
227210 cy . log ( "**check step status order DESC**" ) ;
228- monitorPage . getOrderColumnMonitorTable ( "Status" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . dblclick ( { force : true } ) . then ( ( ) => {
211+ monitorPage . getOrderColumnMonitorTable ( "Status" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . click ( { force : true } ) . click ( { force : true } ) . then ( ( ) => {
229212 monitorPage . getTableNestedRows ( ) . should ( "be.visible" ) ;
230213 monitorPage . getRowData ( firstPageTableCellsJobId , "stepStatus" ) . then ( ( $row ) => {
231214 Cypress . $ . makeArray ( $row )
@@ -240,7 +223,7 @@ describe("Monitor Tile", () => {
240223 } ) ;
241224
242225 cy . log ( "**check Entity Type order DESC**" ) ;
243- monitorPage . getOrderColumnMonitorTable ( "Entity Type" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . dblclick ( { force : true } ) . then ( ( ) => {
226+ monitorPage . getOrderColumnMonitorTable ( "Entity Type" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . click ( { force : true } ) . click ( { force : true } ) . then ( ( ) => {
244227 monitorPage . getTableNestedRows ( ) . should ( "be.visible" ) ;
245228 monitorPage . getRowData ( firstPageTableCellsJobId , "stepEntityType" ) . then ( ( $row ) => {
246229 Cypress . $ . makeArray ( $row )
@@ -253,7 +236,7 @@ describe("Monitor Tile", () => {
253236 } ) ;
254237
255238 cy . log ( "**check step datetime order DESC**" ) ;
256- monitorPage . getOrderColumnMonitorTable ( "Start Date and Time" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . dblclick ( { force : true } ) . then ( ( ) => {
239+ monitorPage . getOrderColumnMonitorTable ( "Start Date and Time" ) . should ( "exist" ) . scrollIntoView ( ) . should ( "be.visible" ) . click ( { force : true } ) . click ( { force : true } ) . then ( ( ) => {
257240 monitorPage . getTableNestedRows ( ) . should ( "be.visible" ) ;
258241 monitorPage . getRowData ( firstPageTableCellsJobId , "stepStartDate" ) . then ( ( $row ) => {
259242 Cypress . $ . makeArray ( $row )
@@ -274,8 +257,8 @@ describe("Monitor Tile", () => {
274257 mappingStepDetail . selectCustomPageSourceTable ( "2" ) ;
275258
276259 cy . log ( "**Go to another page and back**" ) ;
277- toolbar . getLoadToolbarIcon ( ) . click ( ) ;
278- toolbar . getMonitorToolbarIcon ( ) . click ( ) ;
260+ loadPage . navigate ( ) ;
261+ monitorPage . navigate ( ) ;
279262
280263 cy . log ( "**Checking and setting in session new data**" ) ;
281264 mappingStepDetail . verifyContent ( "10 / page" ) ;
@@ -296,8 +279,8 @@ describe("Monitor Tile", () => {
296279 } ) ;
297280
298281 cy . log ( "**Go to another page and back to verify data from session storage**" ) ;
299- toolbar . getLoadToolbarIcon ( ) . click ( ) ;
300- toolbar . getMonitorToolbarIcon ( ) . click ( ) ;
282+ loadPage . navigate ( ) ;
283+ monitorPage . navigate ( ) ;
301284 monitorPage . verifyVisibilityTableHeader ( "Load" , false ) ;
302285 monitorPage . verifyVisibilityTableHeader ( "Flow Name" , false ) ;
303286 monitorPage . getColumnSelectorIcon ( ) . click ( ) ;
@@ -408,6 +391,7 @@ describe("Monitor Tile", () => {
408391 } ) ;
409392
410393 it ( "Verify facets can be selected, applied and cleared using clear text" , ( ) => {
394+ browsePage . clickShowMoreLink ( "step-type" ) ;
411395 monitorPage . clickFacetCheckbox ( "step-type" , "ingestion" ) ;
412396 browsePage . getFacetSearchSelectionCount ( "step-type" ) . should ( "contain" , "1" ) ;
413397 browsePage . getClearFacetSelection ( "step-type" ) . should ( "be.visible" ) . click ( { force : true } ) ;
@@ -416,40 +400,40 @@ describe("Monitor Tile", () => {
416400
417401 it ( "Apply facets, unchecking them should not recheck original facets" , ( ) => {
418402 browsePage . clearAllFacets ( ) ;
419- browsePage . getShowMoreLink ( "step" ) . scrollIntoView ( ) ;
420403 browsePage . clickShowMoreLink ( "step" ) ;
421- browsePage . getShowMoreLink ( "step" ) . scrollIntoView ( ) ;
422- cy . get ( "[data-testid=stepName-search-input]" ) . then ( ( $ele ) => {
423- if ( $ele . length ) {
424- browsePage . clickPopoverSearch ( "stepName" ) ;
425- browsePage . setInputField ( "stepName" , "loadPersonJSON" ) ;
426- browsePage . getPopoverFacetCheckbox ( "loadPersonJSON" ) . should ( "be.visible" ) . click ( { force : true } ) ;
427- browsePage . confirmPopoverFacets ( ) ;
428- } else {
429- monitorPage . clickFacetCheckbox ( "step" , "loadPersonJSON" ) ;
430- }
431- } ) ;
404+
432405 monitorPage . clickFacetCheckbox ( "step" , "mapPersonJSON" ) ;
433- browsePage . getFacetItemCheckbox ( "step" , "loadPersonJSON" ) . should ( "be.checked" ) ;
406+ monitorPage . clickFacetCheckbox ( "step" , "loadPersonJSON" ) ;
407+
434408 browsePage . getFacetItemCheckbox ( "step" , "mapPersonJSON" ) . should ( "be.checked" ) ;
435- browsePage . getGreySelectedFacets ( " loadPersonJSON") . should ( "exist " ) ;
409+ browsePage . getFacetItemCheckbox ( "step" , " loadPersonJSON") . should ( "be.checked " ) ;
436410 browsePage . getGreySelectedFacets ( "mapPersonJSON" ) . should ( "exist" ) ;
437- browsePage . getFacetApplyButton ( ) . click ( ) ;
411+ browsePage . getGreySelectedFacets ( "loadPersonJSON" ) . should ( "exist" ) ;
412+
413+ cy . intercept ( "POST" , "/api/jobs/stepResponses" ) . as ( "stepResponses" ) ;
414+ browsePage . applyFacet ( ) ;
415+ cy . wait ( "@stepResponses" ) ;
416+
438417 browsePage . getFacetItemCheckbox ( "step" , "loadPersonJSON" ) . should ( "be.checked" ) ;
439- cy . get ( "#monitorContent" ) . scrollTo ( "top" , { ensureScrollable : false } ) ;
440- cy . findByTestId ( "step-" + "mapPersonJSON" + "-checkbox" ) . trigger ( "mousemove" , { force : true } ) ;
441418 browsePage . getFacetItemCheckbox ( "step" , "mapPersonJSON" ) . should ( "be.checked" ) ;
419+
442420 browsePage . clickFacetCheckbox ( "status" , "completed" ) ;
443421 browsePage . clickFacetCheckbox ( "step" , "loadPersonJSON" ) ;
444- browsePage . waitForSpinnerToDisappear ( ) ;
445- cy . findByTestId ( "step-" + "mapPersonJSON" + "-checkbox" ) . trigger ( "mousemove" , { force : true } ) ;
422+ cy . wait ( "@stepResponses" ) ;
423+
446424 browsePage . clickFacetCheckbox ( "step" , "mapPersonJSON" ) ;
425+ cy . wait ( "@stepResponses" ) ;
426+
447427 browsePage . clickFacetCheckbox ( "status" , "completed" ) ;
448- cy . findByTestId ( "step-" + "loadPersonJSON" + "-checkbox" ) . trigger ( "mousemove" , { force : true } ) ;
449- browsePage . getFacetItemCheckbox ( "step" , "loadPersonJSON" ) . should ( "not.be.checked" ) ;
450- cy . get ( "#monitorContent" ) . scrollTo ( "top" , { ensureScrollable : false } ) ;
451- browsePage . getFacetItemCheckbox ( "step" , "mapPersonJSON" ) . should ( "not.be.checked" ) ;
428+
429+ cy . log ( "Verify that neither loadPersonJSON nor mapPersonJSON are checked" ) ;
430+ browsePage . clearStepFacetsButton . should ( ( $button ) => {
431+ expect ( $button . attr ( "class" ) ) . to . contain ( "facet_clearInactive" ) ;
432+ } ) ;
433+ browsePage . stepSelectedCount . should ( "not.exist" ) ;
434+
452435 browsePage . getFacetItemCheckbox ( "status" , "completed" ) . should ( "not.be.checked" ) ;
436+ browsePage . statusSelectedCount . should ( "not.exist" ) ;
453437 } ) ;
454438
455439 it ( "Verify select, apply, remove grey and applied startTime facet" , ( ) => {
0 commit comments