test: fix cypress login in development (#42899)
This commit is contained in:
committed by
GitHub
parent
90d5783870
commit
e98257749f
@ -36,7 +36,12 @@
|
||||
Cypress.Commands.add('login', () => {
|
||||
cy.visit('/');
|
||||
cy.contains("Get started (it's free)").click();
|
||||
cy.url().should('eq', Cypress.config().baseUrl + '/learn/');
|
||||
cy.location().should(loc => {
|
||||
// I'm not 100% sure why logins get redirected to /learn/ via 301 in
|
||||
// development, but not in production, but they do. Hence to make it easier
|
||||
// work on tests, we'll just allow for both.
|
||||
expect(loc.pathname).to.match(/^\/learn\/?$/);
|
||||
});
|
||||
cy.contains('Welcome back');
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user