Update the test code

pull/171/head
Hammad1007 2 years ago
parent ab91c8b13c
commit 63ac493bb0

@ -27,5 +27,34 @@ describe('Project: Dad Jokes', () => {
cy.get('body').get('.container h3').should('have.text', "Don't Laugh Challenge")
})
})
context('Get Another Joke button', () => {
it('Get Another Joke button is visible', () => {
cy.get('.btn').should('be.visible')
})
it('Color of the button is correct', () => {
cy.get('.btn').should('have.css', 'background-color', 'rgb(159, 104, 224)')
})
it('The button has the correct text displayed', () => {
cy.get('.btn').should('have.text', 'Get Another Joke')
})
it('The button is clickable', () => {
cy.get('.btn').should('be.visible').click()
})
})
context('Joke', () => {
it('Joke is visible', () => {
cy.get('.container .joke#joke').should('be.visible')
})
it('Gets a new joke when the button is clicked', () => {
cy.get('.btn').should('be.visible').click()
cy.get('.container .joke#joke').should('be.visible')
})
})
})
})
Loading…
Cancel
Save