@@ -5,7 +5,6 @@ import detailPage from "../../support/pages/detail";
55import entitiesSidebar from "../../support/pages/entitiesSidebar" ;
66import { BaseEntityTypes } from "../../support/types/base-entity-types" ;
77import { Application } from "../../support/application.config" ;
8- import { toolbar } from "../../support/components/common" ;
98import "cypress-wait-until" ;
109// import detailPageNonEntity from "../../support/pages/detail-nonEntity";
1110import LoginPage from "../../support/pages/login" ;
@@ -20,25 +19,24 @@ describe("json scenario for table on browse documents page", () => {
2019 cy . contains ( Application . title ) ;
2120 cy . loginAsDeveloper ( ) . withRequest ( ) ;
2221 LoginPage . postLogin ( ) ;
23- cy . waitForAsyncRequest ( ) ;
22+ //Saving Local Storage to preserve session
23+ cy . saveLocalStorage ( ) ;
2424 } ) ;
2525 beforeEach ( ( ) => {
26- cy . loginAsDeveloper ( ) . withRequest ( ) ;
27- cy . waitForAsyncRequest ( ) ;
28- cy . waitUntil ( ( ) => toolbar . getExploreToolbarIcon ( ) ) . click ( ) ;
29- browsePage . getTableView ( ) . click ( ) ;
30- browsePage . waitForSpinnerToDisappear ( ) ;
31- browsePage . waitForHCTableToLoad ( ) ;
32- } ) ;
33- afterEach ( ( ) => {
34- cy . resetTestUser ( ) ;
35- cy . waitForAsyncRequest ( ) ;
26+ //Restoring Local Storage to Preserve Session
27+ cy . restoreLocalStorage ( ) ;
3628 } ) ;
3729 after ( ( ) => {
3830 cy . resetTestUser ( ) ;
3931 cy . waitForAsyncRequest ( ) ;
4032 } ) ;
4133 it ( "select \"all entities\" and verify table default columns" , ( ) => {
34+ cy . visit ( "/tiles/explore" ) ;
35+ cy . wait ( 5000 ) ;
36+ browsePage . getTableView ( ) . click ( ) ;
37+ browsePage . waitForSpinnerToDisappear ( ) ;
38+ browsePage . waitForHCTableToLoad ( ) ;
39+
4240 entitiesSidebar . getBaseEntityOption ( "All Entities" ) . should ( "be.visible" ) ;
4341 browsePage . getTotalDocuments ( ) . should ( "be.greaterThan" , 25 ) ;
4442 browsePage . getColumnTitle ( 2 ) . should ( "contain" , "Identifier" ) ;
@@ -83,7 +81,6 @@ describe("json scenario for table on browse documents page", () => {
8381 } ) ;
8482
8583 it ( "verify instance view of the document without pk" , ( ) => {
86- entitiesSidebar . showMoreEntities ( ) . click ( { force : true } ) ;
8784 entitiesSidebar . openBaseEntityFacets ( BaseEntityTypes . PERSON ) ;
8885 browsePage . getFacetItemCheckbox ( "fname" , "Alice" ) . click ( ) ;
8986 browsePage . getGreySelectedFacets ( "Alice" ) . should ( "exist" ) ;
@@ -117,6 +114,7 @@ describe("json scenario for table on browse documents page", () => {
117114 entitiesSidebar . selectBaseEntityOption ( "All Entities" ) ;
118115 entitiesSidebar . getBaseEntityOption ( "All Entities" ) . should ( "be.visible" ) ;
119116 entitiesSidebar . getApplyFacetsButton ( ) . click ( ) ;
117+ cy . wait ( 1000 ) ;
120118 browsePage . waitForSpinnerToDisappear ( ) ;
121119 browsePage . getTotalDocuments ( ) . should ( "be.equal" , 1 ) ;
122120 browsePage . getTableViewInstanceIcon ( ) . click ( ) ;
@@ -130,13 +128,15 @@ describe("json scenario for table on browse documents page", () => {
130128 } ) ;
131129
132130 it ( "verify source view of the document" , ( ) => {
131+ cy . visit ( "/tiles/explore" ) ;
132+ cy . wait ( 5000 ) ;
133133 entitiesSidebar . openBaseEntityDropdown ( ) ;
134134 entitiesSidebar . selectBaseEntityOption ( "Customer" ) ;
135- entitiesSidebar . getBaseEntityOption ( "Customer" ) . should ( "be.visible" ) ;
135+ entitiesSidebar . getBaseEntityOption ( "Customer" ) . scrollIntoView ( ) . should ( "be.visible" ) ;
136136 browsePage . waitForSpinnerToDisappear ( ) ;
137137 browsePage . getFinalDatabaseButton ( ) ;
138- browsePage . getClearAllFacetsButton ( ) . click ( ) ;
139- entitiesSidebar . getMainPanelSearchInput ( ) . type ( "Adams Cole" ) ;
138+ browsePage . getClearAllFacetsButton ( ) . click ( { force : true } ) ;
139+ entitiesSidebar . getMainPanelSearchInput ( ) . scrollIntoView ( ) . type ( "Adams Cole" ) ;
140140 entitiesSidebar . getApplyFacetsButton ( ) . click ( ) ;
141141 browsePage . waitForSpinnerToDisappear ( ) ;
142142 entitiesSidebar . openBaseEntityFacets ( BaseEntityTypes . CUSTOMER ) ;
@@ -149,6 +149,7 @@ describe("json scenario for table on browse documents page", () => {
149149 browsePage . getFacetItemCheckbox ( "collection" , "mapCustomersJSON" ) . click ( { force : true } ) ;
150150 browsePage . getGreySelectedFacets ( "mapCustomersJSON" ) . should ( "exist" ) ;
151151 browsePage . getFacetApplyButton ( ) . click ( ) ;
152+ browsePage . getTableView ( ) . click ( ) ;
152153 browsePage . getTotalDocuments ( ) . should ( "be.equal" , 2 ) ;
153154
154155 //Refresh the browser page at Browse table view.
@@ -299,6 +300,7 @@ describe("json scenario for table on browse documents page", () => {
299300 } ) ;
300301
301302 it ( "apply multiple facets, deselect them, apply changes, apply multiple, clear them, verify no facets checked" , ( ) => {
303+ entitiesSidebar . backToMainSidebar ( ) ;
302304 entitiesSidebar . openBaseEntityDropdown ( ) ;
303305 entitiesSidebar . selectBaseEntityOption ( "Customer" ) ;
304306 entitiesSidebar . getBaseEntityOption ( "Customer" ) . should ( "be.visible" ) ;
@@ -337,6 +339,7 @@ describe("json scenario for table on browse documents page", () => {
337339
338340
339341 it ( "Verify facets can be selected, applied and cleared using clear text" , ( ) => {
342+ entitiesSidebar . backToMainSidebar ( ) ;
340343 entitiesSidebar . openBaseEntityDropdown ( ) ;
341344 entitiesSidebar . selectBaseEntityOption ( "Person" ) ;
342345 entitiesSidebar . getBaseEntityOption ( "Person" ) . should ( "be.visible" ) ;
@@ -355,6 +358,7 @@ describe("json scenario for table on browse documents page", () => {
355358 } ) ;
356359
357360 it ( "Apply facets, unchecking them should not recheck original facets" , ( ) => {
361+ entitiesSidebar . backToMainSidebar ( ) ;
358362 entitiesSidebar . openBaseEntityDropdown ( ) ;
359363 entitiesSidebar . selectBaseEntityOption ( "Customer" ) ;
360364 entitiesSidebar . getBaseEntityOption ( "Customer" ) . should ( "be.visible" ) ;
0 commit comments