Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xhr request is getting cached #1202

Closed
Br3d89 opened this issue Jan 18, 2018 · 4 comments
Closed

xhr request is getting cached #1202

Br3d89 opened this issue Jan 18, 2018 · 4 comments

Comments

@Br3d89
Copy link

Br3d89 commented Jan 18, 2018

  • Operating System:
    macOS
  • Cypress Version:
    Beta Version 1.4.1
  • Browser Version:
    Chrome 63.0.3239.132

Hello, I have similar to #65 issue behaviour, when running same test few times (cy.wait fails).

Here is my test_spec.js:

describe('test1', function () {
    before(function (){
        cy.server();
        cy.route('POST', 'getData', {testData: 1}).as('testData');
      })
    });

    it('Observe Creation Date', function () {
        cy.visit('/testUri/test');
        cy.wait('@testdata');
      });
 });

Here is my cypress.json:

{
"baseUrl": "http://mytestSite.com",
"viewportHeight": 1080,
"viewportWidth": 1920,
"chromeWebSecurity": false,
}

I even don't see any xhr requests in Cypress commands window :
image

After clearing browser history test runs fine:
image

Also if I run Cypress on localhost environment (baseUrl: http://localhost:8080) which redirects all requests from http://localhost:8080 to http://mytestSite.com, there is no such problem.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Jan 18, 2018
@Br3d89
Copy link
Author

Br3d89 commented Jan 23, 2018

@jennifer-shehane how I can help you to speed up investigation ?

@jennifer-shehane
Copy link
Member

We intend to rework a lot of how we clear things like browser history with this proposal: #686

You can likely hook into Cypress events to handle clearing what you need as a workaround for now. https://on.cypress.io/catalog-of-events#Window-Before-Load

@brian-mann
Copy link
Member

@Br3d89 for us to investigate this issue we must have a reproducible repo. As it stands from looking at your code there's no reason for this not to work. Cypress has likely hundreds of tests around the XHR stubbing behavior so we'd need a way to see it failing.

@brian-mann brian-mann added the stage: needs information Not enough info to reproduce the issue label Feb 10, 2018
@jennifer-shehane jennifer-shehane removed the stage: needs investigating Someone from Cypress needs to look at this label Feb 12, 2018
@jennifer-shehane
Copy link
Member

Closing as stale. Please comment if you are still having this issue and we will consider reopening.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants