From d34015f1ef234c4e6c1d2f67f844bc7cd87cb8e8 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Wed, 6 Sep 2023 21:09:13 +0200 Subject: [PATCH] Fixing missing faces, also adding E2E tests to test them #704, fixes #713 --- .../app/ui/faces/face/face.component.html | 4 +-- test/cypress/e2e/faces.cy.ts | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 test/cypress/e2e/faces.cy.ts diff --git a/src/frontend/app/ui/faces/face/face.component.html b/src/frontend/app/ui/faces/face/face.component.html index 01d12677..a07be6ab 100644 --- a/src/frontend/app/ui/faces/face/face.component.html +++ b/src/frontend/app/ui/faces/face/face.component.html @@ -7,10 +7,10 @@ [style.height.px]="size">
- diff --git a/test/cypress/e2e/faces.cy.ts b/test/cypress/e2e/faces.cy.ts new file mode 100644 index 00000000..1b2e5c93 --- /dev/null +++ b/test/cypress/e2e/faces.cy.ts @@ -0,0 +1,28 @@ +describe('Faces', () => { + beforeEach(() => { + 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.intercept({ + method: 'Get', + url: '/pgapi/person', + }).as('getPerson'); + cy.get('.col-sm-12 > .btn').click(); + cy.get('nav .nav-item .nav-link').contains('Faces').click(); + }); + it('Show faces', () => { + cy.wait('@getPerson', {timeout: 10000}); + // contains a folder + cy.get('app-face a > .info').contains('Alvin the Squirrel').should('exist'); + }); + it('Faces should have photos', () => { + cy.wait('@getPerson', {timeout: 10000}); + // should have a photo + cy.get('app-face .photo-container .photo', {timeout: 10000}).should('exist'); + }); + +});