在基于 cypress 的映像容器中无头运行时,Cypress XHR 请求会中止。浏览器:电子
describe('Test Sign-In and search', () => {
before(() => {
cy.clearLocalStorageSnapshot();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
it('Test Sign In Process', () => {
cy.visit(Cypress.config().baseUrl);
cy.get('[data-test="signInHeader"]', { timeout: 10000 }).should(
'be.visible'
);
cy.get('[data-test="emailInput"]').type(Cypress.env('USER_EMAIL'));
cy.get('[data-test="passwordInput"]').type(Cypress.env('USER_PASSWORD'));
cy.get('[data-test="signInBtn"]').click(); // Preform Sign-in
cy.get('[data-test="newAnalysisHeader"]', { timeout: 25000 }).should(
'be.visible'
);
});
附图片:
感谢您的帮助!