mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Alias not resolving - unresolved alias [ Cypress Support Pro ] #91

Closed catbreathx closed 2 years ago

catbreathx commented 2 years ago

Hi -

In this specific scenario, Webstorm is giving a warning of an unresolved alias:

 it('can click and navigate to external game page', () => {
    cy.visit('/');

    cy.window().then((window) => {
      cy.stub(window, 'open', url => {
        expect(url).to.contain(CHEAPSHARK_REDIRECTION_URL)
      }).as("gameNewWindow")
    })

    cy.get(elements.dataRows).should(  'have.length.at.least', 5);

    cy.get(`${elements.dataRows}:first-child()`).click();
    cy.get('@gameNewWindow').should("be.called")
  })

The line is question is cy.get('@gameNewWindow').should("be.called").

image

It's previously been defined on the cy.stub statement. Removing the cy.window().then command doesn't resolve the issue, either.

The test executes and passes as expected.

Thanks.

mbolotov commented 2 years ago

fixed in 3.2 version

frm-037 commented 1 year ago

I use Cypress Support Pro Version 3.6 and have the same issue.

mbolotov commented 1 year ago

@frm-037 please provide the code snippet