0
0
Fork 0

chore: refs #6900 fix e2e tests

This commit is contained in:
Jorge Penadés 2024-08-09 10:47:15 +02:00
parent f1047328c7
commit a9e8621903
3 changed files with 13 additions and 13 deletions

View File

@ -1,8 +1,9 @@
/// <reference types="cypress" />
describe('InvoiceInIntrastat', () => {
const inputBtns = 'label button';
const firstRow = 'tbody > :nth-child(1)';
const thirdRow = 'tbody > :nth-child(3)';
const firstLineCode = 'tbody > :nth-child(1) > :nth-child(2)';
const firstRowCode = `${firstRow} > :nth-child(2)`;
const firstRowAmount = `${firstRow} > :nth-child(3)`;
beforeEach(() => {
cy.login('developer');
@ -10,10 +11,10 @@ describe('InvoiceInIntrastat', () => {
});
it('should edit the first line', () => {
cy.selectOption(firstLineCode, 'Plantas vivas: Esqueje/injerto, Vid');
cy.get(inputBtns).eq(1).click();
cy.selectOption(firstRowCode, 'Plantas vivas: Esqueje/injerto, Vid');
cy.get(firstRowAmount).clear();
cy.saveCard();
cy.get(`${firstLineCode} span`).should(
cy.get(`${firstRowCode} span`).should(
'have.text',
'6021010:Plantas vivas: Esqueje/injerto, Vid'
);

View File

@ -1,23 +1,23 @@
/// <reference types="cypress" />
describe('InvoiceInList', () => {
const firstCard = '.q-card:nth-child(1)';
const firstChipId =
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)';
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
const firstId = `${firstRow} > td:nth-child(1) span`;
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
const summaryHeaders = '.summaryBody .header-link';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-in/list`);
cy.get('#searchbar input').type('{enter}');
});
it('should redirect on clicking a invoice', () => {
cy.get(firstChipId)
cy.get(firstId)
.invoke('text')
.then((content) => {
const id = content.replace(/\D/g, '');
cy.get(firstCard).click();
cy.get(firstRow).click();
cy.url().should('include', `/invoice-in/${id}/summary`);
});
});

View File

@ -4,8 +4,7 @@ describe('InvoiceInVat', () => {
const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
const dialogInputs = '.q-dialog label input';
const dialogBtns = '.q-dialog button';
const acrossInput =
':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon';
const acrossInput = 'tbody tr:nth-child(1) td:nth-child(2) .default-icon';
const randomInt = Math.floor(Math.random() * 100);
beforeEach(() => {