2023-09-07 03:09:13 +08:00
|
|
|
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');
|
2023-09-07 03:50:33 +08:00
|
|
|
cy.intercept({
|
|
|
|
method: 'Get',
|
|
|
|
url: '/pgapi/gallery/content/',
|
|
|
|
}).as('getContent');
|
2023-09-07 03:09:13 +08:00
|
|
|
cy.intercept({
|
|
|
|
method: 'Get',
|
|
|
|
url: '/pgapi/person',
|
|
|
|
}).as('getPerson');
|
|
|
|
cy.get('.col-sm-12 > .btn').click();
|
2023-09-07 03:50:33 +08:00
|
|
|
// make sure that the dir is parsed before navigating to faces
|
|
|
|
cy.wait('@getContent');
|
2023-09-07 03:24:25 +08:00
|
|
|
cy.get('nav .nav-item .nav-link').contains('Faces').click({force: true});
|
2023-09-07 03:09:13 +08:00
|
|
|
});
|
|
|
|
it('Show faces', () => {
|
|
|
|
cy.wait('@getPerson', {timeout: 10000});
|
|
|
|
// contains a folder
|
2023-09-07 03:38:00 +08:00
|
|
|
cy.get('app-face a > .info', {timeout: 10000}).contains('Alvin the Squirrel').should('exist');
|
2023-09-07 03:09:13 +08:00
|
|
|
});
|
|
|
|
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');
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|