2023-08-16 13:04:16 +00:00
|
|
|
/// <reference types="cypress" />
|
2023-08-21 13:14:19 +00:00
|
|
|
describe('ClaimDevelopment', () => {
|
|
|
|
const claimId = 1;
|
2023-08-23 13:09:03 +00:00
|
|
|
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
|
|
|
|
const thirdRow = 'tbody > :nth-child(3)';
|
2023-08-21 13:14:19 +00:00
|
|
|
|
2023-08-16 13:04:16 +00:00
|
|
|
beforeEach(() => {
|
2023-08-21 13:14:19 +00:00
|
|
|
cy.viewport(1920, 1080);
|
2023-08-16 13:04:16 +00:00
|
|
|
cy.login('developer');
|
2023-08-21 13:14:19 +00:00
|
|
|
cy.visit(`/#/claim/${claimId}/development`);
|
2024-02-27 10:31:46 +00:00
|
|
|
cy.waitForElement('tbody');
|
2023-08-16 13:04:16 +00:00
|
|
|
});
|
|
|
|
|
2023-08-21 13:14:19 +00:00
|
|
|
it('should reset line', () => {
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.selectOption(firstLineReason, 'Novato');
|
|
|
|
cy.resetCard();
|
2024-02-21 13:00:52 +00:00
|
|
|
cy.getValue(firstLineReason).should('equal', 'Prisas');
|
2023-08-16 13:04:16 +00:00
|
|
|
});
|
|
|
|
|
2023-08-21 13:14:19 +00:00
|
|
|
it('should edit line', () => {
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.selectOption(firstLineReason, 'Novato');
|
2023-08-16 13:04:16 +00:00
|
|
|
|
2023-10-13 07:04:14 +00:00
|
|
|
cy.saveCard();
|
2023-10-11 13:59:41 +00:00
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/claim/${claimId}/development`);
|
2023-10-13 07:04:14 +00:00
|
|
|
|
2024-02-21 13:00:52 +00:00
|
|
|
cy.getValue(firstLineReason).should('equal', 'Novato');
|
2023-08-16 13:04:16 +00:00
|
|
|
|
2023-08-21 13:14:19 +00:00
|
|
|
//Restart data
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.selectOption(firstLineReason, 'Prisas');
|
|
|
|
cy.saveCard();
|
2023-08-16 13:04:16 +00:00
|
|
|
});
|
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
it('should add and remove new line', () => {
|
|
|
|
cy.addCard();
|
|
|
|
cy.get(thirdRow).should('exist');
|
2023-08-16 13:04:16 +00:00
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
const rowData = [false, 'Novato', 'Roces', 'Compradores', 'employeeNick', 'Tour'];
|
|
|
|
cy.fillRow(thirdRow, rowData);
|
2023-10-13 07:04:14 +00:00
|
|
|
|
|
|
|
cy.saveCard();
|
2023-10-11 13:59:41 +00:00
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/claim/${claimId}/development`);
|
2023-10-13 07:04:14 +00:00
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.validateRow(thirdRow, rowData);
|
2023-08-21 13:14:19 +00:00
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.reload();
|
|
|
|
cy.validateRow(thirdRow, rowData);
|
2023-08-21 13:14:19 +00:00
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
//remove row
|
|
|
|
cy.fillRow(thirdRow, [true]);
|
|
|
|
cy.removeCard();
|
|
|
|
cy.clickConfirm();
|
|
|
|
cy.get(thirdRow).should('not.exist');
|
2023-08-21 13:14:19 +00:00
|
|
|
|
2023-08-23 13:09:03 +00:00
|
|
|
cy.reload();
|
|
|
|
cy.get(thirdRow).should('not.exist');
|
|
|
|
});
|
2023-08-16 13:04:16 +00:00
|
|
|
});
|