salix-front/test/cypress/integration/claim/claimPhoto.spec.js

57 lines
2.1 KiB
JavaScript
Raw Normal View History

2023-02-22 13:55:29 +00:00
/// <reference types="cypress" />
describe('ClaimPhoto', () => {
beforeEach(() => {
const claimId = 1;
2023-02-24 11:51:29 +00:00
cy.login('developer');
cy.visit(`/#/claim/${claimId}/photos`);
2023-02-22 13:55:29 +00:00
});
2023-02-23 14:20:07 +00:00
it('should add new file', () => {
cy.get('label > .q-btn').click();
cy.get('label > .q-btn input').selectFile('test/cypress/fixtures/image.jpg', {
2023-02-22 13:55:29 +00:00
force: true,
});
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should add new file with drag and drop', () => {
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
action: 'drag-drop',
});
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
2024-04-23 07:38:03 +00:00
it.skip('should open first image dialog change to second and close', () => {
/* skiped fix on https://redmine.verdnatura.es/issues/7113 */
2023-02-22 13:55:29 +00:00
cy.get(
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
).click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'be.visible'
);
cy.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click();
cy.get(
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
).click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'not.be.visible'
);
});
2023-02-24 11:51:29 +00:00
it('should remove third and fourth file', () => {
cy.get(
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
).click();
2023-04-27 08:40:00 +00:00
cy.get('.q-btn--unelevated > .q-btn__content > .block').click();
2023-02-24 11:51:29 +00:00
cy.get('.q-notification__message').should('have.text', 'Data deleted');
2023-02-22 13:55:29 +00:00
cy.get(
2023-02-24 11:51:29 +00:00
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
2023-02-22 13:55:29 +00:00
).click();
2023-04-27 08:40:00 +00:00
cy.get('.q-btn--unelevated > .q-btn__content > .block').click();
2023-02-22 13:55:29 +00:00
cy.get('.q-notification__message').should('have.text', 'Data deleted');
});
});