From 789c54a23f52cd6b11932d0794d766bdbf3766ed Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Wed, 20 Sep 2023 18:40:53 +0200 Subject: [PATCH] Adding E2E test for auto opening lightbox #587 #725 --- test/cypress/e2e/gallery.cy.ts | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/test/cypress/e2e/gallery.cy.ts b/test/cypress/e2e/gallery.cy.ts index 08f1da48..0f95f9d8 100644 --- a/test/cypress/e2e/gallery.cy.ts +++ b/test/cypress/e2e/gallery.cy.ts @@ -71,4 +71,56 @@ describe('Gallery', () => { cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); }); + it('Gallery should auto open lightbox for IMG_5910.jpg', () => { + cy.visit('/gallery/?p=IMG_5910.jpg'); + + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); + cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + + }); + it('Gallery should auto open lightbox for IMG_1252.jpg', () => { + cy.visit('/gallery/?p=IMG_1252.jpg'); + + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); + cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + + }); }); + +describe('Gallery - dont wait for content load', () => { + it('Gallery should auto open lightbox for IMG_5910.jpg', () => { + cy.visit('/'); + cy.get('.card-body'); + cy.get('.col-sm-12').contains('Login'); + /* ==== Generated with Cypress Studio ==== */ + cy.get('#username').type('admin'); + cy.get('#password').clear(); + cy.get('#password').type('admin'); + cy.get('.col-sm-12 > .btn').click(); + // contains a folder + + cy.visit('/gallery/?p=IMG_5910.jpg'); + + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); + cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + + }); + it('Gallery should auto open lightbox for IMG_1252.jpg', () => { + cy.visit('/'); + cy.get('.card-body'); + cy.get('.col-sm-12').contains('Login'); + /* ==== Generated with Cypress Studio ==== */ + cy.get('#username').type('admin'); + cy.get('#password').clear(); + cy.get('#password').type('admin'); + cy.get('.col-sm-12 > .btn').click(); + // contains a folder + + cy.visit('/gallery/?p=IMG_1252.jpg'); + + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); + cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + + }); +}); +