Skip to content
Closed
15 changes: 12 additions & 3 deletions packages/e2e/cypress/integration/common/geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ When('I search for {string}', (searchTerm: string) => {
cy.intercept(/.*places.*/).as('searchResults');
cy.findByRole('textbox', {
name: /search/i,
}).type(searchTerm);
timeout: 30000,
})
.should('be.visible')
.type(searchTerm);
cy.wait('@searchResults');
});

Expand All @@ -15,7 +18,10 @@ When('I select the first search result', () => {
When('I clear the search results', () => {
cy.findByRole('textbox', {
name: /search/i,
}).trigger('mouseenter');
timeout: 30000,
})
.should('be.visible')
.trigger('mouseenter');
/**
* Adding 'force' as the clear button is hidden until we hover on textbox,
* and the click action seems to happen before the hover thus failing the check for the clear button element.
Expand All @@ -38,5 +44,8 @@ Then('I see no search results', () => {
Then('the search input is empty', () => {
cy.findByRole('textbox', {
name: /search/i,
}).should('have.value', '');
timeout: 30000,
})
.should('be.visible')
.should('have.value', '');
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Given('my default search results is {int}', (searchResults: number) => {
When('I press the enter key', () => {
cy.findByRole('textbox', {
name: /search/i,
}).type('{enter}');
timeout: 30000,
})
.should('be.visible')
.type('{enter}');
});

Then('I see markers equal to my default search results', () => {
Expand Down
Loading