2024-10-22 11:22:43 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
|
|
|
describe('Ticket expedtion', () => {
|
|
|
|
const tableContent = '.q-table .q-virtual-scroll__content';
|
|
|
|
const stateTd = 'td:nth-child(9)';
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.login('developer');
|
|
|
|
cy.viewport(1920, 1080);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should change the state', () => {
|
|
|
|
cy.visit('#/ticket/1/expedition');
|
2024-10-27 12:43:38 +00:00
|
|
|
cy.intercept('GET', /\/api\/Expeditions\/filter/).as('show');
|
|
|
|
cy.intercept('POST', /\/api\/ExpeditionStates\/addExpeditionState/).as('add');
|
2024-10-22 11:22:43 +00:00
|
|
|
|
2024-10-27 12:43:38 +00:00
|
|
|
cy.wait('@show');
|
2024-10-22 11:22:43 +00:00
|
|
|
cy.selectRows([1, 2]);
|
2024-10-27 12:43:38 +00:00
|
|
|
cy.selectOption('[data-cy="change-state"]', 'Perdida');
|
|
|
|
cy.wait('@add');
|
2024-10-22 11:22:43 +00:00
|
|
|
|
|
|
|
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
|
|
|
|
cy.wrap($el).contains('Perdida');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|