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

Add example with comparing text of two elements using "should(cb)" #1300

Closed
bahmutov opened this issue Jan 11, 2019 · 0 comments · Fixed by #1309
Closed

Add example with comparing text of two elements using "should(cb)" #1300

bahmutov opened this issue Jan 11, 2019 · 0 comments · Fixed by #1309

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Jan 11, 2019

Users are struggling when comparing two text elements on the page and try write complicated things like this one

const ticketClass = () => cy.get(ele).first().invoke('text').then(($text) => {
            const newEle = () => $text.charAt(0).toUpperCase() + $text.slice(1)
            cy.get(ele2).first().invoke('text').should('have.text', newEle)
        })

Need to add a good example to should(cb): https://docs.cypress.io/api/commands/should.html#Function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants