2024-03-15 15:30:12 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
describe('Ticket descriptor', () => {
|
2024-05-13 15:07:59 +00:00
|
|
|
const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
|
2024-03-28 08:46:18 +00:00
|
|
|
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`);
|
2024-07-04 15:42:06 +00:00
|
|
|
cy.waitForElement('.q-page', 7000);
|
2024-03-15 15:30:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should clone the ticket without warehouse', () => {
|
|
|
|
cy.openLeftMenu();
|
|
|
|
cy.openActionsDescriptor();
|
|
|
|
cy.get(toCloneOpt).click();
|
|
|
|
cy.clickConfirm();
|
|
|
|
cy.get(warehouseValue).contains('-');
|
|
|
|
cy.get(summaryHeader)
|
|
|
|
.invoke('text')
|
|
|
|
.then((text) => {
|
|
|
|
const [, owner] = text.split('-');
|
|
|
|
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|