Coder Social home page Coder Social logo

Comments (8)

jennifer-shehane avatar jennifer-shehane commented on July 22, 2024

Yes, this is happening when clicking 'run all tests' and having all specs run tests together.

I am not encountering this error when running the tests that are seeded in the Cypress project itself (added when you create a new project) - which are using the Kitchen-Sink version 1.0.1. This makes me believe that this bug was introduced in one of the commits on this project after May 14, 2018 https://github.com/cypress-io/cypress-example-kitchensink/commits/master

I'm quite confused why our automated tests would not have caught this though.

Can you confirm that you forked the repository and ran it on your own?

Cy Version: 3.0.1
Browser: Chrome 67 / Electron 59
OS: Mac

from cypress-example-kitchensink.

jennifer-shehane avatar jennifer-shehane commented on July 22, 2024

Oh, well, duh, they weren't caught because the specs are run in isolation within CI, not as if you had clicked 'run all tests'

from cypress-example-kitchensink.

jennifer-shehane avatar jennifer-shehane commented on July 22, 2024

I was able to narrow down the bug to these lines of code:

beforeEach(() => {
  cy.visit('http://localhost:8080/commands/files')
})

it('.defaults() - change default config of server', () => {
  Cypress.Server.defaults({
    whitelist (xhr) {
      expect(xhr).to.be.an('object')
    },
  })
})

it('cy.fixture() - load a fixture', () => {
  cy.server()
  cy.route('GET', 'comments/*').as('getComment')
  cy.get('.fixture-btn').click()
  cy.wait('@getComment')
})

from cypress-example-kitchensink.

jennifer-shehane avatar jennifer-shehane commented on July 22, 2024

The assertion below is failing, but failing in a later test - while trying to process the .wait() command.

expect(xhr).to.be.an('object')

screen shot 2018-06-28 at 1 01 20 pm

from cypress-example-kitchensink.

jennifer-shehane avatar jennifer-shehane commented on July 22, 2024

Ok, so we are going to remove the whitelist sections of the Cypress.Server.default({}).

This isn't really a good use case of how the whitelist feature should be used - ideally you would rewrite the function and not add an arbitrary assertion in here. Because of the way error handling is handled in this case, the error is being pushed off and being thrown on the .wait() command. Which is why all of these waits are failing.

There does not appear to be an error in Cypress itself that we should open an issue for.

from cypress-example-kitchensink.

katnem avatar katnem commented on July 22, 2024

@jennifer-shehane to clarify, I haven't forked the repo, I just cloned it and ran the tests from the runner locally (if it makes any difference considering your previous replies).

from cypress-example-kitchensink.

katnem avatar katnem commented on July 22, 2024

Thanks @jennifer-shehane =)

from cypress-example-kitchensink.

cypress avatar cypress commented on July 22, 2024



Test summary

115 0 0 0


Run details

Project cypress-example-kitchensink
Status Passed
Commit ab3954793a
Started Mar 15, 2020 12:10 PM
Ended Mar 15, 2020 12:17 PM
Duration 06:13 💡
OS Windows 10.0.17763
Browser Electron 78

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

from cypress-example-kitchensink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.