diff --git a/dad-jokes/cypress/e2e/test1.spec.cy.js b/dad-jokes/cypress/e2e/test1.spec.cy.js index 40fbe64..b794ff8 100644 --- a/dad-jokes/cypress/e2e/test1.spec.cy.js +++ b/dad-jokes/cypress/e2e/test1.spec.cy.js @@ -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') + }) + }) }) }) \ No newline at end of file