-
+
#{{ getValueFromPath(subtitle) ?? entity.id }}
-
-
- {{ t('globals.copyId') }}
-
-
+
+
+ {{ t('globals.copyId') }}
+
+
diff --git a/test/cypress/integration/ticket/ticketFilter.spec.js b/test/cypress/integration/ticket/ticketFilter.spec.js
index 10973c5c5..3520e7373 100644
--- a/test/cypress/integration/ticket/ticketFilter.spec.js
+++ b/test/cypress/integration/ticket/ticketFilter.spec.js
@@ -9,43 +9,8 @@ describe('TicketFilter', () => {
it('use search button', function () {
cy.waitForElement('.q-page');
- cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
+ cy.get('[data-cy="Customer ID_input"]').type('1105');
cy.searchBtnFilterPanel();
- cy.waitRequest('@ticketFilter', ({ request }) => {
- const { query } = request;
- expect(query).to.have.property('from');
- expect(query).to.have.property('to');
- });
- cy.on('uncaught:exception', () => {
- return false;
- });
- cy.get('.q-field__control-container > [data-cy="From_date"]')
- .type(`${today()} `)
- .type('{enter}');
- cy.get('.q-notification').should(
- 'contain',
- `The date range must have both 'from' and 'to'`,
- );
-
- cy.get('.q-field__control-container > [data-cy="To_date"]').type(
- `${today()}{enter}`,
- );
- cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
- cy.searchBtnFilterPanel();
- cy.wait('@ticketFilter').then(({ request }) => {
- const { query } = request;
- expect(query).to.have.property('from');
- expect(query).to.have.property('to');
- });
- cy.location('href').should('contain', '#/ticket/999999');
+ cy.location('href').should('contain', '#/ticket/15/summary');
});
});
-function today(date) {
- // return new Date().toISOString().split('T')[0];
-
- return new Intl.DateTimeFormat('es-ES', {
- day: '2-digit',
- month: '2-digit',
- year: 'numeric',
- }).format(date ?? new Date());
-}
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index 3b5ddef79..2d185f2e6 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -12,12 +12,12 @@ describe('TicketList', () => {
const searchResults = (search) => {
if (search) cy.typeSearchbar().type(search);
cy.dataCy('vn-searchbar').find('input').type('{enter}');
- cy.dataCy('ticketListTable').should('exist');
+ // cy.dataCy('ticketListTable').should('exist');
cy.get(firstRow).should('exist');
};
it('should search results', () => {
- cy.dataCy('ticketListTable').should('not.exist');
+ // cy.dataCy('ticketListTable').should('not.exist');
cy.get('.q-field__control').should('exist');
searchResults();
});
@@ -41,21 +41,11 @@ describe('TicketList', () => {
it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
- cy.wait('@ticketSearchbar').then(({ request }) => {
- const { query } = request;
- expect(query).to.have.property('from');
- expect(query).to.have.property('to');
- expect(query).to.not.have.property('clientFk');
- });
+
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
cy.dataCy('Customer ID_input').clear('1');
cy.dataCy('Customer ID_input').type('1101{enter}');
- cy.wait('@ticketFilter').then(({ request }) => {
- const { query } = request;
- expect(query).to.not.have.property('from');
- expect(query).to.not.have.property('to');
- expect(query).to.have.property('clientFk');
- });
+
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
cy.dataCy('Address_select').click();
diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js
index 63562bd26..6dd7a63e7 100644
--- a/test/cypress/integration/ticket/ticketSale.spec.js
+++ b/test/cypress/integration/ticket/ticketSale.spec.js
@@ -6,6 +6,7 @@ describe('TicketSale', () => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/31/sale');
+ cy.domContentLoad();
});
const firstRow = 'tbody > :nth-child(1)';
@@ -112,7 +113,6 @@ describe('TicketSale', () => {
cy.dataCy('ticketSaleTransferBtn').click();
cy.dataCy('ticketTransferPopup').should('exist');
cy.dataCy('ticketTransferNewTicketBtn').click();
- //check the new ticket has been created succesfully
cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
});
@@ -138,7 +138,7 @@ describe('TicketSale', () => {
it('update price', () => {
const price = Number((Math.random() * 99 + 1).toFixed(2));
cy.waitForElement(firstRow);
- cy.get(':nth-child(10) > .q-btn').click();
+ cy.get('[data-col-field="price"]').find('.q-btn').click();
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
cy.dataCy('ticketEditManaProxy').should('exist');
cy.waitForElement('[data-cy="Price_input"]');
@@ -147,15 +147,14 @@ describe('TicketSale', () => {
cy.dataCy('saveManaBtn').click();
handleVnConfirm();
- cy.get(':nth-child(10) > .q-btn > .q-btn__content').should(
- 'have.text',
- `€${price}`,
- );
+ cy.get('[data-col-field="price"]')
+ .find('.q-btn > .q-btn__content')
+ .should('have.text', `€${price}`);
});
- it('update dicount', () => {
+ it('update discount', () => {
const discount = Math.floor(Math.random() * 100) + 1;
selectFirstRow();
- cy.get(':nth-child(11) > .q-btn').click();
+ cy.get('[data-col-field="discount"]').find('.q-btn').click();
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
cy.dataCy('ticketEditManaProxy').should('exist');
cy.waitForElement('[data-cy="Disc_input"]');
@@ -164,26 +163,24 @@ describe('TicketSale', () => {
cy.dataCy('saveManaBtn').click();
handleVnConfirm();
- cy.get(':nth-child(11) > .q-btn > .q-btn__content').should(
- 'have.text',
- `${discount}.00%`,
- );
+ cy.get('[data-col-field="discount"]')
+ .find('.q-btn > .q-btn__content')
+ .should('have.text', `${discount}.00%`);
});
it('change concept', () => {
- const quantity = Math.floor(Math.random() * 100) + 1;
+ const concept = Math.floor(Math.random() * 100) + 1;
cy.waitForElement(firstRow);
- cy.get(':nth-child(8) > .row').click();
- cy.get(
- '.q-menu > [data-v-ca3f07a4=""] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="undefined_input"]',
- )
- .type(quantity)
+ cy.get('[data-col-field="item"]').click();
+ cy.get('.q-menu')
+ .find('[data-cy="undefined_input"]')
+ .type(concept)
.type('{enter}');
handleVnConfirm();
- cy.get(':nth-child(8) >.row').should('contain.text', `${quantity}`);
+ cy.get('[data-col-field="item"]').should('contain.text', `${concept}`);
});
- it('changequantity ', () => {
+ it('change quantity ', () => {
const quantity = Math.floor(Math.random() * 100) + 1;
cy.waitForElement(firstRow);
cy.dataCy('ticketSaleQuantityInput').clear();
@@ -200,7 +197,7 @@ describe('TicketSale', () => {
});
function handleVnConfirm() {
- cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
+ cy.get('[data-cy="VnConfirm_confirm"]').click();
cy.waitForElement('.q-notification__message');
cy.get('.q-notification__message').should('be.visible');