51 lines
1.7 KiB
JavaScript
Executable File
51 lines
1.7 KiB
JavaScript
Executable File
/// <reference types="cypress" />
|
|
describe.skip('ClaimPhoto', () => {
|
|
const carrouselClose =
|
|
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
|
|
beforeEach(() => {
|
|
const claimId = 1;
|
|
cy.login('developer');
|
|
cy.visit(`/#/claim/${claimId}/photos`);
|
|
});
|
|
|
|
it('should add new file', () => {
|
|
cy.get('label > .q-btn').click();
|
|
cy.get('label > .q-btn input').selectFile('test/cypress/fixtures/image.jpg', {
|
|
force: true,
|
|
});
|
|
cy.checkNotification('Data saved');
|
|
});
|
|
|
|
it('should add new file with drag and drop', () => {
|
|
cy.get('.container').should('be.visible').and('exist');
|
|
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
|
|
action: 'drag-drop',
|
|
});
|
|
cy.checkNotification('Data saved');
|
|
});
|
|
|
|
it('should open first image dialog change to second and close', () => {
|
|
cy.dataCy('file-1').click();
|
|
cy.get(carrouselClose).click();
|
|
|
|
cy.dataCy('file-1').click();
|
|
cy.get('.q-carousel__control > button').as('nextButton').click();
|
|
cy.get('.q-carousel__slide > .q-ma-none').should('be.visible');
|
|
cy.get(carrouselClose).click();
|
|
});
|
|
|
|
it('should remove third and fourth file', () => {
|
|
cy.dataCy('delete-button-4').click();
|
|
cy.get(
|
|
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
|
).click();
|
|
cy.checkNotification('Data deleted');
|
|
|
|
cy.dataCy('delete-button-3').click();
|
|
cy.get(
|
|
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
|
|
).click();
|
|
cy.checkNotification('Data deleted');
|
|
});
|
|
});
|