frontPanel/cypress/support/commands.ts
Nastya 25deb4a0f4
Some checks failed
Deploy / CreateImage (push) Failing after 11m59s
Deploy / DeployService (push) Has been cancelled
есть id тарифа для прода
2025-06-18 00:23:50 +03:00

28 lines
971 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <reference types="cypress" />
declare global {
namespace Cypress {
interface Chainable {
login(): Chainable<void>
}
}
}
Cypress.Commands.add('login', () => {
// Пробуем перейти на страницу входа
cy.visit('/signin', {
timeout: 10000, // Увеличиваем таймаут до 10 секунд
failOnStatusCode: false // Не падаем при ошибках статуса
});
// Проверяем, что мы на странице входа
cy.url().should('include', '/signin');
// Вводим данные для входа
cy.get('#email', { timeout: 10000 }).should('be.visible').type('test@test.ru');
cy.get('#password', { timeout: 10000 }).should('be.visible').type('testtest');
cy.get('button[type="submit"]', { timeout: 10000 }).should('be.visible').click();
// Ждем успешного входа
cy.url().should('not.include', '/signin', { timeout: 10000 });
});