3

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!

Ido Bleicher
  • 709
  • 1
  • 9
  • 19
  • Hey Guys, 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. – Ido Bleicher Feb 16 '22 at 14:16

1 Answers1

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.

Ido Bleicher
  • 709
  • 1
  • 9
  • 19
  • Thanks to your research I am no longer concerned with my instance of this error, it occurs ONLY for advertisement images and I trust (presume or hope really) something in the corporate network is blocking the ads. It does not cause test failure. Just cosmetic. – ScottWelker Sep 02 '22 at 21:47