Is this a Feature or Bug?
Feature
Current behavior:
If I want to use should assert, very often I need to look up the documentation https://docs.cypress.io/guides/references/assertions.html to check what's the assert is, what's the string should be. Which consumes additional time when writing asserts. Also some asserts doesn't seems to be clear, like checking text content against regexp.
It's hard to get autocompletion and arguments suggestion from the editor if assert is a string.
Desired behavior:
Would be great to have assert constructs which would help editors/IDE's with autocompletion, especially if TypeScript type definitions could be used.
Current work around which I'm wondering to use for our team, which is not ideal but it works could be:
const be = {
visible: ['be.visible']
}
const do = {
have: {
attr: () => (name, value) => ['have.attr', name, value]
}
}
cy
.get('.someElement')
.should(...be.visible)
.and(...do.have.attr('content', 'abc'))
Editor will do autocompletion in that case, which speeds up the process of writing asserts.
Would be great to have some solution to it, built-in Cypress, but it would probably require different approach how asserts are made.
Just a proposition. So far, writing asserts is the biggest pain point in Cypress in our team as it too often requires docs look up.
1.0.3Is this a Feature or Bug?
Feature
Current behavior:
If I want to use
shouldassert, very often I need to look up the documentation https://docs.cypress.io/guides/references/assertions.html to check what's the assert is, what's the string should be. Which consumes additional time when writing asserts. Also some asserts doesn't seems to be clear, like checking text content against regexp.It's hard to get autocompletion and arguments suggestion from the editor if assert is a string.
Desired behavior:
Would be great to have assert constructs which would help editors/IDE's with autocompletion, especially if TypeScript type definitions could be used.
Current work around which I'm wondering to use for our team, which is not ideal but it works could be:
Editor will do autocompletion in that case, which speeds up the process of writing asserts.
Would be great to have some solution to it, built-in Cypress, but it would probably require different approach how asserts are made.
Just a proposition. So far, writing asserts is the biggest pain point in Cypress in our team as it too often requires docs look up.