bahmutov / cypress-if

Easy conditional if-else logic for your Cypress tests when there is no other way
https://cypress.tips/courses/cypress-plugins
99 stars 12 forks source link

Can we fail the test if the assertion property is invalid? #36

Closed bahmutov closed 2 years ago

bahmutov commented 2 years ago

A test like this one

describe('aliases', () => {
  it('has an existing alias', () => {
    cy.wrap(42).as('answer')
    cy.get('@answer').if('exists').log('alias exists').should('equal', 42)
  })
})

Quietly fails with the error in the DevTools console "Invalid Chai property: exists. Did you mean "exist"?"

Screen Shot 2022-10-03 at 13 46 51

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.8.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: