Skip to content

Commit

Permalink
Replace data-cy="map" by data-cy="ol-map"
Browse files Browse the repository at this point in the history
This could solve some click issues in cypress
  • Loading branch information
ltshb committed Dec 14, 2023
1 parent cf70713 commit acee10f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/e2e-cypress/integration/mouseposition.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ function checkXY(expectedX, expectedY) {
}

function checkMousePositionStringValue(coordStr) {
cy.get('[data-cy="map"]').click()
cy.get('[data-cy="ol-map"]').click()
cy.waitUntilState((state) => {
return state.map.clickInfo !== null
})
cy.get('[data-cy="mouse-position"]').should('contain.text', coordStr)
}

function checkMousePositionNumberValue(expectedX, expectedY, parser) {
cy.get('[data-cy="map"]').click()
cy.get('[data-cy="ol-map"]').click()
cy.waitUntilState((state) => {
return state.map.clickInfo !== null
})
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('Test mouse position and interactions', () => {

// location popup need a bit of room on the Y axis, otherwise it is half hidden (and Cypress complains)
cy.viewport(320, 1000)
cy.get('[data-cy="map"]').rightclick()
cy.get('[data-cy="ol-map"]').rightclick()

cy.get('[data-cy="location-popup"]').should('be.visible')
cy.log('the LocationPopUp is visible')
Expand All @@ -146,7 +146,7 @@ describe('Test mouse position and interactions', () => {
cy.get('[data-cy="drawing-toolbox-close-button"]').click()
// closing the menu if mobile
cy.clickOnMenuButtonIfMobile()
cy.get('[data-cy="map"]').rightclick()
cy.get('[data-cy="ol-map"]').rightclick()

cy.wait('@convert-to-w3w')
cy.fixture('what3word.fixture').then((fakeW3w) => {
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('Test mouse position and interactions', () => {
)
cy.log('it shows correct MGRS coordinates in the popup')

cy.get('[data-cy="map"]').rightclick()
cy.get('[data-cy="ol-map"]').rightclick()
cy.wait('@shortlink').then((interception) => {
expect(interception.request.body.url).be.a('string')
const query = interception.request.body.url.split('?')[1]
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e-cypress/integration/search/search-results.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ describe('Test the search bar result handling', () => {
cy.get(searchbarSelector).paste('test')
cy.wait(`@search-locations`)
cy.get('[data-cy="search-result-entry-location"]').should('be.visible')
cy.get('[data-cy="map"]').click(viewportWidth * 0.5, viewportHeight * 0.75)
cy.get('[data-cy="ol-map"]').click(viewportWidth * 0.5, viewportHeight * 0.75)
cy.get('[data-cy="search-result-entry-location"]').should('not.be.visible')
cy.activateFullscreen()
cy.get(searchbarSelector).should('not.exist')
Expand All @@ -310,7 +310,7 @@ describe('Test the search bar result handling', () => {
cy.get(searchbarSelector).paste('test')
cy.wait(`@search-locations`)
cy.get('[data-cy="search-result-entry-location"]').should('be.visible')
cy.get('[data-cy="map"]').click(viewportWidth * 0.5, viewportHeight * 0.75)
cy.get('[data-cy="ol-map"]').click(viewportWidth * 0.5, viewportHeight * 0.75)
cy.get('[data-cy="search-result-entry-location"]').should('not.be.visible')
cy.get(searchbarSelector).click()
cy.get('[data-cy="search-result-entry-location"]').should('be.visible')
Expand Down

0 comments on commit acee10f

Please sign in to comment.