mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
27 lines
642 B
TypeScript
27 lines
642 B
TypeScript
/// <reference types="cypress" />
|
|
|
|
Cypress.Commands.add('login', (email, password) => {
|
|
cy.session(
|
|
[email, password],
|
|
() => {
|
|
cy.visit('/login');
|
|
cy.contains('Use your Overseerr account').click();
|
|
|
|
cy.get('[data-testid=email]').type(email);
|
|
cy.get('[data-testid=password]').type(password);
|
|
|
|
cy.intercept('/api/v1/auth/local').as('localLogin');
|
|
cy.get('[data-testid=local-signin-button]').click();
|
|
|
|
cy.wait('@localLogin');
|
|
|
|
cy.url().should('contain', '/');
|
|
},
|
|
{
|
|
validate() {
|
|
cy.request('/api/v1/auth/me').its('status').should('eq', 200);
|
|
},
|
|
}
|
|
);
|
|
});
|