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

Alias is undefined after first test #2766

Closed
lourenci opened this issue Nov 12, 2018 · 1 comment
Closed

Alias is undefined after first test #2766

lourenci opened this issue Nov 12, 2018 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@lourenci
Copy link

Current behavior:

When defined inside a before hook, the alias becomes undefined after first spec.

image

Desired behavior:

The alias should be available inside others its in that context.

Steps to reproduce:

describe('test', function () {
  before(function () {
    cy.wrap({ id: 1 }).as('licensee')
  })

  it('first it', function () {
    console.log('first it', this.licensee)
  })

  it('second it', function () {
    // this.licensee is undefined
    console.log('second it', this.licensee)
  })
})

Versions

Cypress 3.1.1
Chrome 70

@jennifer-shehane
Copy link
Member

Duplicate of #665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants