Skip to content

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

Closed
@MathRobin

Description

@MathRobin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions