test: add cypress foundation (#2903) [skip ci]

This commit is contained in:
Ryan Cohen
2022-08-15 08:34:38 +09:00
committed by GitHub
parent db898db9f2
commit 22ec058431
27 changed files with 848 additions and 17 deletions

View File

@@ -0,0 +1,26 @@
/// <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);
},
}
);
});