test: refs #8862 add Cypress isolation tests for various ticket and zone components #1698

Open
benjaminedc wants to merge 18 commits from 8862-testIsolationFalse into dev
26 changed files with 35 additions and 30 deletions

View File

@ -1,6 +1,9 @@
import { defineConfig } from 'cypress';
let urlHost, reporter, reporterOptions, timeouts;
let urlHost;
let reporter;
let reporterOptions;
let timeouts;
if (process.env.CI) {
urlHost = 'front';
@ -60,5 +63,6 @@ export default defineConfig({
...timeouts,
includeShadowDom: true,
waitForAnimations: true,
testIsolation: false,
},
});

View File

@ -1,4 +1,4 @@
describe('Account descriptor', () => {
describe('Account descriptor', { testIsolation: true }, () => {
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
const url = '/#/account/1/summary';

View File

@ -9,9 +9,9 @@ describe('Client consignee', () => {
cy.get('.q-card').should('be.visible');
});
it('check as equalizated', function () {
it('check as equalizated', () => {
cy.get('.q-card__section > .address-card').then(($el) => {
let addressCards_before = $el.length;
const addressCards_before = $el.length;
cy.get('.q-page-sticky > div > .q-btn').click();
const addressName = 'test';

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('Client fiscal data', () => {
describe('Client fiscal data', { testIsolation: true }, () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" />
import moment from 'moment';
describe('InvoiceInBasicData', () => {
describe('InvoiceInBasicData', { testIsolation: true }, () => {
const dialogInputs = '.q-dialog input';
const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`;
const futureDate = moment().add(1, 'days').format('DD-MM-YYYY');

View File

@ -1,4 +1,4 @@
describe('invoiceInCorrective', () => {
describe('invoiceInCorrective', { testIsolation: true }, () => {
beforeEach(() => cy.login('administrative'));
it('should modify the invoice', () => {

View File

@ -1,4 +1,4 @@
describe('InvoiceInDescriptor', () => {
describe('InvoiceInDescriptor', { testIsolation: true }, () => {
beforeEach(() => cy.login('administrative'));
describe('more options', () => {

View File

@ -24,6 +24,7 @@ describe('InvoiceOut list', () => {
});
it('should download all pdfs', () => {
cy.get(columnCheckbox).click();
cy.get(columnCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
});

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('InvoiceOut summary', () => {
describe('InvoiceOut summary', { testIsolation: true }, () => {
const transferInvoice = {
Client: { val: 'employee', type: 'select' },
Type: { val: 'Error in customer data', type: 'select' },

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('ItemBarcodes', () => {
describe('ItemBarcodes', { testIsolation: true }, () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/item/1/barcode`);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('Item summary', () => {
describe('Item summary', { testIsolation: true }, () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/item/1/summary`);

View File

@ -1,4 +1,4 @@
describe('Item tag', () => {
describe('Item tag', { testIsolation: true }, () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/item/1/tags`);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('Login', () => {
describe('Login', { testIsolation: true }, () => {
beforeEach(() => {
cy.visit('/#/login');
cy.get('#switchLanguage').click();

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('OrderCatalog', () => {
describe('OrderCatalog', { testIsolation: true }, () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 720);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('OrderList', () => {
describe('OrderList', { testIsolation: true }, () => {
const clientCreateSelect = '#formModel [data-cy="Client_select"]';
const addressCreateSelect = '#formModel [data-cy="Address_select"]';
const agencyCreateSelect = '#formModel [data-cy="Agency_select"]';
@ -48,7 +48,7 @@ describe('OrderList', () => {
cy.url().should('include', `/order`);
});
it('create order from customer summary', function () {
it('create order from customer summary', () => {
const clientId = 1101;
cy.dataCy('Customer ID_input').type(`${clientId}{enter}`);
cy.get(

View File

@ -1,4 +1,4 @@
describe('Cmr list', () => {
describe('Cmr list', { testIsolation: true }, () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;

View File

@ -1,4 +1,4 @@
describe('Route', () => {
describe('Route', { testIsolation: true }, () => {
const getSelector = (colField) =>
`tr:last-child > [data-col-field="${colField}"] > .no-padding > .link`;

View File

@ -1,7 +1,7 @@
/// <reference types="cypress" />
const firstRow = 'tbody > :nth-child(1)';
describe('TicketSale', () => {
describe('TicketSale', { testIsolation: true }, () => {
describe.skip('Ticket #23', () => {
beforeEach(() => {
cy.login('claimManager');

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('UserPanel', () => {
describe('UserPanel', { testIsolation: true }, () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('VnBreadcrumbs', () => {
describe('VnBreadcrumbs', { testIsolation: true }, () => {
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => {
cy.login('developer');

View File

@ -1,6 +1,6 @@
const { randomNumber, randomString } = require('../../support');
describe('VnLocation', () => {
describe('VnLocation', { testIsolation: true }, () => {
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
const dialogInputs = '.q-dialog label input';
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';
@ -53,15 +53,15 @@ describe('VnLocation', () => {
cy.waitForElement('.q-card');
cy.get(inputLocation).click();
});
it('Show all options', function () {
it('Show all options', () => {
cy.get(locationOptions).should('have.length.at.least', 5);
});
it('input filter location as "al"', function () {
it('input filter location as "al"', () => {
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
cy.get(locationOptions).should('have.length.at.least', 4);
});
it('input filter location as "ecuador"', function () {
it('input filter location as "ecuador"', () => {
cy.get(inputLocation).clear();
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length.at.least', 1);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('VnLog', () => {
describe('VnLog', { testIsolation: true }, () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/claim/${1}/log`);

View File

@ -1,4 +1,4 @@
describe('WorkerCreate', () => {
describe('WorkerCreate', { testIsolation: true }, () => {
const externalRadio = '.q-radio:nth-child(2)';
const developerBossId = 120;
const payMethodCross =

View File

@ -1,4 +1,4 @@
describe('WorkerNotificationsManager', () => {
describe('WorkerNotificationsManager', { testIsolation: true }, () => {
const salesPersonId = 18;
const developerId = 9;

View File

@ -1,4 +1,4 @@
describe('ZoneBasicData', () => {
describe('ZoneBasicData', { testIsolation: true }, () => {
const priceBasicData = '[data-cy="ZoneBasicDataPrice"]';
const saveBtn = '.q-btn-group > .q-btn--standard';

View File

@ -1,4 +1,4 @@
describe('ZoneCreate', () => {
describe('ZoneCreate', { testIsolation: true }, () => {
const data = {
Name: { val: 'Zone pickup D' },
Price: { val: '3' },