N
N
newUser20212021-07-10 10:41:36
JavaScript
newUser2021, 2021-07-10 10:41:36

How to test url on e2e in cypress for specific browser?

Good afternoon.
The site checks that if a user logs in with ios and uses the Firefox browser, then you need to redirect him to a specific URL.
Question: how to test this functionality on e2e using cypress? Can tests change the browser during launch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor L, 2021-07-10
@Fzero0

It seems like cypress should support passing the user agent in the header for cy.visit

it('Проверка редиректа', () => {
  cy.visit(portalURL + '/page/', {
    headers: {
      'user-agent': 'Mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions>',
    }
  });

});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question