Skip to content

Commit

Permalink
PB-1187: keep the test for geolocation separated because it failed in…
Browse files Browse the repository at this point in the history
… CI.
  • Loading branch information
ismailsunni committed Jan 9, 2025
1 parent bb6173b commit b346eaa
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/cypress/tests-e2e/geolocation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,18 @@ describe('Geolocation cypress', () => {
)

context('Test geolocation when geolocation is failed to be retrieved', () => {
it('shows an error telling the user geolocation is denied or time out', () => {
// Timeout
cy.goToMapView({}, true, { errorCode: GeolocationPositionError.TIMEOUT })
getGeolocationButtonAndClickIt()
testErrorMessage('geoloc_time_out')

cy.reload() // to reset the stub

// Permission denied
it('shows an error telling the user geolocation is denied', () => {
cy.goToMapView({}, true, { errorCode: GeolocationPositionError.PERMISSION_DENIED })
getGeolocationButtonAndClickIt()
testErrorMessage('geoloc_permission_denied')
})
it('shows an error when geolocation is not available / other error', () => {
// Unfortunately, I need to put this position unavailable in a separate it block
// cy.reload doesn't fix the issue, even restore the stub doesn't work

it('shows an alert telling the user geolocation is not able to be retrieved due to time out', () => {
cy.goToMapView({}, true, { errorCode: GeolocationPositionError.TIMEOUT })
getGeolocationButtonAndClickIt()
testErrorMessage('geoloc_time_out')
})
it('shows an alert telling the user geolocation is not available for other reason', () => {
cy.goToMapView({}, true, { errorCode: GeolocationPositionError.POSITION_UNAVAILABLE })
getGeolocationButtonAndClickIt()
testErrorMessage('geoloc_unknown')
Expand Down

0 comments on commit b346eaa

Please sign in to comment.