fix: refs #8621 intermittent test
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-03-17 12:03:26 +01:00
parent 458a994a19
commit 7e74ab58da
3 changed files with 24 additions and 52 deletions

View File

@ -28,7 +28,6 @@ const userParams = {
shipped: null,
};
const columns = computed(() => [
{
align: 'left',
@ -175,6 +174,7 @@ function downloadPdfs() {
:data-key
url="Cmrs/filter"
:columns="columns"
:order="['shipped DESC', 'cmrFk ASC']"
:user-params="userParams"
default-mode="table"
v-model:selected="selectedRows"

View File

@ -19,7 +19,7 @@ describe('Cmr list', () => {
};
const data = {
ticket: '2',
ticket: '1',
client: 'Bruce Wayne',
};
@ -52,76 +52,40 @@ describe('Cmr list', () => {
describe('Ticket pop-ups', () => {
it('Should redirect to the ticket summary from the ticket descriptor pop-up', () => {
cy.get(selectors.ticket).click();
cy.get(selectors.descriptorId)
.invoke('text')
.then((text) => {
expect(text).to.include(data.ticket);
});
cy.containContent(selectors.descriptorId, data.ticket);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.url().should('include', '/ticket/1/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
it('Should redirect to the ticket summary from summary pop-up from the ticket descriptor pop-up', () => {
cy.get(selectors.ticket).click();
cy.get(selectors.descriptorId)
.invoke('text')
.then((text) => {
expect(text).to.include(data.ticket);
});
cy.containContent(selectors.descriptorId, data.ticket);
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.containContent(selectors.summaryTitle, data.client);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.url().should('include', '/ticket/1/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
});
describe('Client pop-ups', () => {
it('Should redirect to the client summary from the client descriptor pop-up', () => {
cy.get(selectors.client).click();
cy.get(selectors.descriptorTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.containContent(selectors.descriptorTitle, data.client);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.url().should('include', '/customer/1101/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
it('Should redirect to the client summary from summary pop-up from the client descriptor pop-up', () => {
cy.get(selectors.client).click();
cy.get(selectors.descriptorTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.containContent(selectors.descriptorTitle, data.client);
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.containContent(selectors.summaryTitle, data.client);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryTitle)
.invoke('text')
.then((text) => {
expect(text).to.include(data.client);
});
cy.url().should('include', '/customer/1101/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
});
});

View File

@ -322,6 +322,14 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
Cypress.Commands.add('containContent', (selector, expectedValue) => {
cy.get(selector)
.invoke('text')
.then((text) => {
expect(text).to.include(expectedValue);
});
});
Cypress.Commands.add('openActionDescriptor', (opt) => {
cy.openActionsDescriptor();
const listItem = '[role="menu"] .q-list .q-item';