When I run my test against that HTML code
foo
bar
Cypress doesn't look beyond the first "div".
Here is my test :
context('Home', () => {
beforeEach(() => {
cy.visit('
http://example.org')
})
it('Find a div', () => {
cy.get('div').should('have.attr', 'tester', 'matching')
})
})
Si I get the following error :
CypressError: Timed out retrying: expected '[
, 1 more... ]' to have attribute 'tester' with the value 'matching', but the value was 'notmatching'
So when I put the line :
cy.get('div').should('have.attr', 'tester', 'notmatching')
It works.
What am I doing wrong ?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)