question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Current behavior

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

Uploading image.png…

Desired behavior

To not abort the XHR request 😦

Test code to reproduce

Use angular, with angular client add some HTTP requests (angular client based XHR requests).

Cypress Version

9.1.1

Other

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BlueWindscommented, Feb 22, 2022

It would still be helpful if you could put together a reproducible example; perhaps a public github repo demonstrating your problem.

One easy way to do that is with a fork of https://github.com/cypress-io/cypress-test-tiny, and then include the docker command you’re using either in a script or in a comment here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XHR requests get aborted when running headless, in cypress ...
Current behavior​​ Cypress XHR requests get aborted when running headless, in a cypress-based image container. After Signing in some XHR requests ...
Read more >
Cypress XHR requests get aborted when running headless, in ...
I had an issue with WAF (AWS Cloud). in my cloud front, there was a rule to block XHR requests to the backend....
Read more >
cypress-io/cypress - Gitter
But 1) running xhr requests will be aborted by the browser when it unload the page (so you visit a new url). 2)...
Read more >
Changelog - Cypress Documentation
Fixed an issue where snapshots performed in XHR requests could reflect the primary domain ... See Running headless tests without Xvfb for more...
Read more >
Some UI testing problems and the Cypress way - ITNEXT
Testing a front-end application brings some challenges that the “classic” tests have not: you need to orchestrate a real browser.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found