@@ -41,31 +41,38 @@ describe("search", () => {
41
41
it ( "should add and remove multiple filters with no issues" , ( ) => {
42
42
setSearchFiltersFeatureFlag ( true ) ;
43
43
cy . login ( ) ;
44
+ cy . hideOnboardingTour ( ) ;
44
45
cy . visit ( "/" ) ;
45
46
cy . get ( "input[data-testid=search-input]" ) . type ( "*{enter}" ) ;
47
+ cy . hideOnboardingTour ( ) ;
46
48
47
- // click tag filter dropdown inside of "More Filters"
48
- //cy.get("[data-testid=more-filters-dropdown").click({ force: true });
49
- cy . get ( "[data-testid=filter-dropdown-Tag" ) . click ( { force : true } ) ;
49
+ // Sometimes the tag filter is in the more section and sometimes it is at the top level - this checks for both
50
+ cy . get ( "body" ) . then ( ( $body ) => {
51
+ if ( $body . find ( "[data-testid=filter-dropdown-Tag]" ) . length > 0 ) {
52
+ // Tag filter is visible at top level
53
+ cy . get ( "[data-testid=filter-dropdown-Tag]" ) . click ( { force : true } ) ;
54
+ } else {
55
+ // Tag filter is inside More Filters
56
+ cy . get ( "[data-testid=more-filters-dropdown]" ) . click ( { force : true } ) ;
57
+ cy . get ( "[data-testid=more-filter-Tag]" ) . click ( { force : true } ) ;
58
+ }
59
+ } ) ;
50
60
51
61
// click and search for tag, save that tag
52
- //
53
62
cy . get ( "[data-testid=search-bar" ) . eq ( 1 ) . type ( "cypress" ) ;
54
63
cy . get ( "[data-testid=filter-option-Cypress" ) . click ( { force : true } ) ;
55
64
cy . get ( "[data-testid=update-filters" ) . click ( { force : true } ) ;
56
65
cy . url ( ) . should (
57
66
"include" ,
58
67
"filter_tags___false___EQUAL___0=urn%3Ali%3Atag%3ACypress" ,
59
68
) ;
60
- // cy.get("[data-testid=update-filters").should("not.exist");
69
+ // Assert that the button is not visible
70
+ cy . get ( "[data-testid=update-filters" ) . should ( "not.be.visible" ) ;
61
71
62
72
// select datasets filter
63
73
cy . get ( "[data-testid=filter-dropdown-Type" ) . click ( { force : true } ) ;
64
74
cy . get ( "[data-testid=filter-option-Datasets" ) . click ( { force : true } ) ;
65
- cy . get (
66
- ':nth-child(4) > :nth-child(1) > .ant-dropdown > [data-testid="filter-dropdown"] > [data-testid="update-filters"] > span' ,
67
- ) . click ( { force : true } ) ;
68
- // cy.get("[data-testid=update-filters").click({ force: true });
75
+ cy . get ( "[data-testid=update-filters" ) . eq ( 1 ) . click ( { force : true } ) ;
69
76
cy . url ( ) . should (
70
77
"include" ,
71
78
"filter__entityType%E2%90%9EtypeNames___false___EQUAL___1=DATASET" ,
0 commit comments