2

I am having a problem to test AGM. Stores should be shown on the map. I have mocked the store location I want to select like this

cy.visit(url, {
  failOnStatusCode: failOnStatusCode, onBeforeLoad(win: Cypress.AUTWindow) {
    cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake((cb) => {
      return cb({coords: {latitude, longitude}});
    });
  }
})

But the geolocation does not function every time. Sometimes it works, sometimes not. In this state, I can not run the tests in a pipeline.

Audwin Oyong
  • 2,247
  • 3
  • 15
  • 32
FarFarAway
  • 1,017
  • 3
  • 14
  • 35

0 Answers0