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

71 lines
1.9 KiB
JavaScript
Raw Normal View History

/// <reference types="cypress" />
describe('ClaimDevelopment', () => {
const claimId = 1;
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
const thirdRow = 'tbody > :nth-child(3)';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
2024-09-12 15:49:59 +00:00
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
cy.waitForElement('tbody');
});
it('should reset line', () => {
cy.selectOption(firstLineReason, 'Novato');
cy.resetCard();
2024-02-21 13:00:52 +00:00
cy.getValue(firstLineReason).should('equal', 'Prisas');
});
it('should edit line', () => {
cy.selectOption(firstLineReason, 'Novato');
2023-10-13 07:04:14 +00:00
cy.saveCard();
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');
//Restart data
cy.selectOption(firstLineReason, 'Prisas');
cy.saveCard();
});
it('should add and remove new line', () => {
2024-09-12 15:49:59 +00:00
cy.wait(['@workers', '@workers']);
cy.addCard();
2024-09-12 15:49:59 +00:00
2024-09-23 09:15:11 +00:00
cy.waitForElement(thirdRow);
2024-09-12 15:49:59 +00:00
const rowData = [
false,
'Novato',
'Roces',
'Compradores',
'administrativeNick',
'Tour',
];
cy.fillRow(thirdRow, rowData);
2023-10-13 07:04:14 +00:00
cy.saveCard();
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
2023-10-13 07:04:14 +00:00
cy.validateRow(thirdRow, rowData);
cy.reload();
cy.validateRow(thirdRow, rowData);
//remove row
cy.fillRow(thirdRow, [true]);
cy.removeCard();
cy.clickConfirm();
cy.get(thirdRow).should('not.exist');
cy.reload();
cy.get(thirdRow).should('not.exist');
});
});