Код: Выделить всё
// Cypress login session setup for a2i backoffice
const login = () => {
cy.session('a2i-login', () => {
cy.visit('https://backoffice.a2i.gov.bd');
cy.url().should('include', 'https://login-npf-v2.softbd.xyz/realms/npf-global/protocol/openid-connect/auth');
// Login credentials
cy.get('input[name="username"]').type('moysports.qa@gmail.com');
cy.get('input[name="password"]').type('Npf@12345');
cy.get('button[type="submit"]').click();
// OTP verification
cy.get('input[name="code"]').type('123456');
cy.get('.pf-v5-c-button').click();
});
};
beforeEach(() => {
login();
cy.visit('https://backoffice.a2i.gov.bd/contents');
});
< /code>
[b] terminal -< /strong> < /p>
npf.a2i.gov.bd"before each" hook for "
2. Choose ministry cluster": AssertionError: Timed out retrying after 4000ms: expected '' to include 'https://login-npf-v2.softbd.xyz/realms/npf-global/protocol/openid-connect/auth'
This error occurred while creating the session. Because the session setup failed, we failed the test.
Because this error occurred during a before each hook, we are skipping the remaining tests in the current suite: npf.a2i.gov.bd
. Обычно, не генерируя отчеты HTML, он работает должным образом и запускает тестовые случаи, а также показывает результат на терминале . Однако, когда я пытаюсь генерировать html с использованием cypress-mochawesome-reporter , URL-адрес аутентификации показывает ошибку. Почему? Каковы причины?
Подробнее здесь: https://stackoverflow.com/questions/796 ... -url-displ