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

".and" chainer returns undefined after upgrade to 3.4.0 #4833

Closed
kyleburnett opened this issue Jul 26, 2019 · 3 comments · Fixed by #4834
Closed

".and" chainer returns undefined after upgrade to 3.4.0 #4833

kyleburnett opened this issue Jul 26, 2019 · 3 comments · Fixed by #4834
Labels
type: regression A bug that didn't appear until a specific Cy version release

Comments

@kyleburnett
Copy link

kyleburnett commented Jul 26, 2019

Current behavior:

After upgrading from Cypress 3.3.2 to 3.4.0, we now receive CypressError when attempting to use chai-jquery's ".and" chainer. It reports the following.

CypressError: Timed out retrying: Cannot read property 'have' of undefined

Here is what my test case looks like (from the and-chainer-undefined branch of the https://github.com/proknow/cypress-test-tiny repo).

describe('page', () => {
    it('should', () => {
        cy.visit('https://docs.cypress.io');
        cy.get('nav#main-nav').should(($nav) => {
            var node = $nav[0];
            var guides = node.querySelector('ul li:first-child a');
            var $guides = Cypress.$(guides);

            // Both of these assertions work in Cypress v3.3.2 and fail in Cypress v3.4.0
            expect(guides).to.be.visible.and.have.class('active');
            expect($guides).to.be.visible.and.have.class('active');
        });
    });
})

Desired behavior:

I would like the behavior of the ".and" chainer to function as it did in version 3.3.2 of Cypress.

Steps to reproduce: (app code and test code)

Please clone the and-chainer-undefined branch of https://github.com/proknow/cypress-test-tiny. To reproduce:

  1. Run npm install.
  2. Run npx cypress open and run the spec.js integration script.

To see the behavior in 3.3.2:

  1. Change package.json to use 3.3.2 for Cypress.
  2. Run npm install.
  3. Run npx cypress open and run the spec.js integration script.

Versions

Cypress: 3.4.0
OS: macOS 10.14.5 (18F132)
Browser: Chrome 75.0.3770.142

@jennifer-shehane
Copy link
Member

I have confirmed that this test was passing in v3.3.2 and is failing in 3.4.0 of Cypress.

have is also listed as a supported chainable getter in our docs: https://on.cypress.io/assertions#BDD-Assertions

Looks like a regression to me.

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Jul 26, 2019
@jennifer-shehane jennifer-shehane added the type: regression A bug that didn't appear until a specific Cy version release label Jul 26, 2019
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress stage: needs review The PR code is done & tested, needs review labels Jul 26, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jul 29, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 29, 2019

The code for this is done in cypress-io/cypress#4834, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 29, 2019

Released in 3.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A bug that didn't appear until a specific Cy version release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants