From 25b5825ce18a091788fdc128aaf348ed6d42aad4 Mon Sep 17 00:00:00 2001 From: Hammad1007 Date: Fri, 15 Dec 2023 14:53:13 +0500 Subject: [PATCH] Update the tests --- .../cypress/e2e/test1.spec.cy.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/3d-boxes-background/cypress/e2e/test1.spec.cy.js b/3d-boxes-background/cypress/e2e/test1.spec.cy.js index faefef7..8fc611b 100644 --- a/3d-boxes-background/cypress/e2e/test1.spec.cy.js +++ b/3d-boxes-background/cypress/e2e/test1.spec.cy.js @@ -16,5 +16,43 @@ describe('Project 2: 3d-Boxes-Background', () => { cy.get('body').should('be.visible') }) + it('Magic Button is visible', () => { + cy.get('.magic').should('be.visible') + }) + + it('Magic Button is clickable', () => { + cy.get('.magic').should('be.visible').click() + }) + + it('Small Boxes are visible on the screen', () => { + cy.get('.boxes').should('be.visible') + }) + + it('Magic button when clicked, the boxes merge into one box', () => { + cy.get('.magic').should('be.visible').click() + cy.get('.box').should('be.visible') + }) + context('Magic Button toggle', () => { + before(() => { + cy.visit('http://127.0.0.1:5500/3d-boxes-background/') + cy.get('.magic').should('be.visible').click() + cy.get('.box').should('be.visible') + + }) + + it('If Magic button is toggled, then the box changes to small boxes', () => { + cy.get('.magic').should('be.visible').click() + cy.get('.boxes').should('be.visible') + }) + + it('The GIF in the image is working or not', () => { + cy.get('.magic').should('be.visible').click() + cy.get('.box').should('be.visible') + cy.get('image').should('have.data', 'background-image', 'https://media.giphy.com/media/EZqwsBSPlvSda/giphy.gif') + }) + }) + + + }) \ No newline at end of file