salix-front/test/cypress/integration/ticket/ticketDescriptor.spec.js

28 lines
891 B
JavaScript
Raw Normal View History

2024-03-15 15:30:12 +00:00
/// <reference types="cypress" />
describe('Ticket descriptor', () => {
const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
2024-03-15 15:30:12 +00:00
const summaryHeader = '.summaryHeader > div';
beforeEach(() => {
const ticketId = 1;
cy.login('developer');
cy.visit(`/#/ticket/${ticketId}/summary`);
});
it('should clone the ticket without warehouse', () => {
cy.openLeftMenu();
cy.openActionsDescriptor();
cy.get(toCloneOpt).click();
cy.clickConfirm();
2024-08-27 08:27:51 +00:00
cy.get(warehouseValue).contains('Warehouse One');
2024-03-15 15:30:12 +00:00
cy.get(summaryHeader)
.invoke('text')
.then((text) => {
const [, owner] = text.split('-');
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
});
});
});