'Cypress XHR requests get aborted when running headless, in cypress based image container

Cypress XHR requests get aborted when running headless, in a cypress-based image container. Browser: Electron

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'
    );
  });

Attaching Picture:

enter image description here

Thanks for helping!



Solution 1:[1]

I had an issue with WAF (AWS Cloud). in my cloud front, there was a rule to block XHR requests to the backend. which causes this issue. after whitelisting my IP it worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ido Bleicher