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

cy.log in cy.fixture(..).then breaks promise-like compatibility #8084

Closed
MathRobin opened this issue Jul 24, 2020 · 3 comments · Fixed by #9372
Closed

cy.log in cy.fixture(..).then breaks promise-like compatibility #8084

MathRobin opened this issue Jul 24, 2020 · 3 comments · Fixed by #9372
Labels
topic: fixtures Fixture loading and usage

Comments

@MathRobin
Copy link

Current behavior:

I just tried to put a cy.log into cy.fixture.then like this:

it.only('test', () => {
    cy
      .fixture('login')
      .then(async (data) => {
        cy.log('count', Object.keys(data).length);
        return await Object.keys(data).length;
      })
      .then((test) => {
        cy.log('test', test);
      })
  })

Result:

Capture du 2020-07-24 16-24-42

We get 'count' with a value, but next then, we don't have the value anymore

If I comment / remove cy.log line, i get

Capture du 2020-07-24 16-25-11

Which is the desired behaviour.

Desired behavior:

We should get the same value as count in test in second then.

Versions

Cypress 4.10.0
Ubuntu 18.10
Chrome 84

@bahmutov bahmutov added the topic: fixtures Fixture loading and usage label Sep 15, 2020
@cypress-bot cypress-bot bot added the stage: work in progress There is an open PR for this issue [WIP] label Nov 30, 2020
@cypress-bot cypress-bot bot added stage: pending release There is a closed PR for this issue and removed stage: work in progress There is an open PR for this issue [WIP] labels Dec 17, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 17, 2020

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

@MathRobin
Copy link
Author

Many thanks to you @sainthkh and @Bkucera for having solved my problem^^

❤️

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 21, 2020

Released in 6.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.2.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: pending release There is a closed PR for this issue label Dec 21, 2020
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: fixtures Fixture loading and usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants