From ab91c8b13c145c1785380fb28a03b181a90beec7 Mon Sep 17 00:00:00 2001 From: Hammad1007 Date: Fri, 22 Dec 2023 11:06:54 +0500 Subject: [PATCH] Update testing code --- dad-jokes/cypress/e2e/test1.spec.cy.js | 32 +++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/dad-jokes/cypress/e2e/test1.spec.cy.js b/dad-jokes/cypress/e2e/test1.spec.cy.js index 322992c..40fbe64 100644 --- a/dad-jokes/cypress/e2e/test1.spec.cy.js +++ b/dad-jokes/cypress/e2e/test1.spec.cy.js @@ -1,5 +1,31 @@ -describe('template spec', () => { - it('passes', () => { - cy.visit('https://example.cypress.io') +describe('Project: Dad Jokes', () => { + beforeEach(() => { + cy.visit('http://127.0.0.1:5500/dad-jokes/index.html') + }) + + context('General Tests', () => { + it('Opens the home page', () => { + + }) + + it('Screen is visible', () => { + cy.get('body').should('be.visible') + }) + + it('Background color', () => { + cy.get('body').should('have.css', 'background-color', 'rgb(104, 109, 224)') + }) + }) + + context('Body', () => { + context('Title Text', () => { + it('Title text is visible', () => { + cy.get('body').get('.container h3').should('be.visible') + }) + + it('Title text is correct', () => { + cy.get('body').get('.container h3').should('have.text', "Don't Laugh Challenge") + }) + }) }) }) \ No newline at end of file