test: create test for all sections
This commit is contained in:
parent
81b4e09eba
commit
e455fe4e99
|
@ -1,75 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('Handle Client list', () => {
|
|
||||||
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(7)';
|
|
||||||
const firstId = `${firstRow} > td:nth-child(1) span`;
|
|
||||||
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
|
|
||||||
const summaryHeaders = '.summaryBody .header-link';
|
|
||||||
const dialogInputs = '.q-dialog input';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.viewport(1280, 720);
|
|
||||||
cy.login('developer');
|
|
||||||
cy.visit('/#/customer/list', { timeout: 5000 });
|
|
||||||
});
|
|
||||||
it('Client list create new client', () => {
|
|
||||||
const dialogInputs = '.q-dialog label input';
|
|
||||||
|
|
||||||
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
||||||
const data = {
|
|
||||||
Name: { val: 'Name 1' },
|
|
||||||
'Social name': { val: 'TEST 1' },
|
|
||||||
'Tax number': { val: '20852113Z' },
|
|
||||||
'Web user': { val: 'user_test_1' },
|
|
||||||
Street: { val: 'C/ STREET 1' },
|
|
||||||
Email: { val: 'user.test@1.com' },
|
|
||||||
'Business type': { val: 'Otros', type: 'select' },
|
|
||||||
'Sales person': { val: 'salesboss', type: 'select' },
|
|
||||||
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
|
||||||
};
|
|
||||||
cy.fillInForm(data);
|
|
||||||
// cy.get(dialogInputs).eq(0).type('NAME 1');
|
|
||||||
// cy.get(dialogInputs).eq(1).type('TEST 1');
|
|
||||||
// cy.get(dialogInputs).eq(2).type('20852113Z');
|
|
||||||
// cy.get(dialogInputs).eq(3).type('C/ STREET 1');
|
|
||||||
// cy.get(dialogInputs).eq(8).type('user_test_1');
|
|
||||||
// cy.get(dialogInputs).eq(9).type('user.test@1.com');
|
|
||||||
// cy.selectOption('.q-dialog input', 'Others');
|
|
||||||
// cy.get(
|
|
||||||
// '.q-field--float > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
||||||
// ).click();
|
|
||||||
// cy.selectOption(
|
|
||||||
// '.q-dialog label input > :nth-child(5) > .q-select > .q-field__inner > .q-field__control ',
|
|
||||||
// 'salesBoss'
|
|
||||||
// );
|
|
||||||
// cy.get(
|
|
||||||
// '.q-dialog > .q-card> .grid-create >input>:nth-child(5) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
|
||||||
// ).click();
|
|
||||||
// cy.selectOption(
|
|
||||||
// '.q-dialog > .q-field__inner > .q-field__control > .q-field__control-container >:nth-child(6)',
|
|
||||||
// 'salesBoss'
|
|
||||||
// );
|
|
||||||
// cy.get(dialogInputs).eq(7).type('46000, Valencia(Province one), España');
|
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
||||||
|
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
|
||||||
cy.url().should('include', '/summary');
|
|
||||||
});
|
|
||||||
xit('should redirect on clicking a invoice', () => {
|
|
||||||
cy.get(firstId)
|
|
||||||
.invoke('text')
|
|
||||||
.then((content) => {
|
|
||||||
const id = content.replace(/\D/g, '');
|
|
||||||
cy.get(firstRow).click();
|
|
||||||
cy.url().should('include', `/invoice-in/${id}/summary`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
xit('should open the details', () => {
|
|
||||||
cy.get(firstDetailBtn).click();
|
|
||||||
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
|
||||||
cy.get(summaryHeaders).eq(4).contains('Vat');
|
|
||||||
});
|
|
||||||
xit('Create and go', function () {
|
|
||||||
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client consignee', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/address', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client balance', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/balance', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client basic data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/basic-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client billing data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/billing-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client credits', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/credits', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client fiscal data', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/fiscal-data', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client greuges', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/greuges', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,63 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client list', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/customer/list', {
|
||||||
|
timeout: 5000,
|
||||||
|
onBeforeLoad(win) {
|
||||||
|
cy.stub(win, 'open');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Client list create new client', () => {
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
const data = {
|
||||||
|
Name: { val: 'Name 1' },
|
||||||
|
'Social name': { val: 'TEST 1' },
|
||||||
|
'Tax number': { val: '20852113Z' },
|
||||||
|
'Web user': { val: 'user_test_1' },
|
||||||
|
Street: { val: 'C/ STREET 1' },
|
||||||
|
Email: { val: 'user.test@1.com' },
|
||||||
|
'Business type': { val: 'Otros', type: 'select' },
|
||||||
|
'Sales person': { val: 'salesboss', type: 'select' },
|
||||||
|
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
||||||
|
};
|
||||||
|
cy.fillInForm(data);
|
||||||
|
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
|
||||||
|
cy.checkNotification('created');
|
||||||
|
cy.url().should('include', '/summary');
|
||||||
|
});
|
||||||
|
it('Client list search client', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
|
||||||
|
cy.get('.title > span').should('have.text', search);
|
||||||
|
let id = null;
|
||||||
|
cy.get('.q-item > .q-item__label').then((text) => {
|
||||||
|
id = text.text().trim().split('#')[1];
|
||||||
|
cy.get('.q-item > .q-item__label').should('have.text', ` #${id}`);
|
||||||
|
cy.url().should('include', `/customer/${id}/summary`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Client founded create ticket', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
cy.clickButtonsDescriptor(2);
|
||||||
|
cy.waitForElement('#formModel');
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
cy.checkValueForm(1, search);
|
||||||
|
});
|
||||||
|
it('Client founded create order', () => {
|
||||||
|
const search = 'Jessica Jones';
|
||||||
|
cy.searchByLabel('Name', search);
|
||||||
|
cy.clickButtonsDescriptor(4);
|
||||||
|
cy.waitForElement('#formModel');
|
||||||
|
cy.waitForElement('.q-form');
|
||||||
|
cy.checkValueForm(2, search);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client notes', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/notes', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client recoveries', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/recoveries', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client web-access', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/web-access', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client credit opinion', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/credit-management/credit-opinion', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client consumption', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/consumption', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client contacts', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/contacts', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client mandates', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/mandates', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client samples', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/samples', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client unpaid', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/unpaid', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,13 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client web payments', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/customer/1110/others/web-payments', {
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('Form loaded', () => {
|
||||||
|
cy.get('.q-card').should('be.visible');
|
||||||
|
});
|
||||||
|
});
|
|
@ -241,10 +241,53 @@ Cypress.Commands.add('writeSearchbar', (value) => {
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
|
||||||
cy.get(selector).should('have.text', expectedValue);
|
cy.get(selector).should('have.text', expectedValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||||
|
cy.openActionsDescriptor();
|
||||||
|
const listItem = '[role="menu"] .q-list .q-item';
|
||||||
|
cy.contains(listItem, opt).click();
|
||||||
|
1;
|
||||||
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||||
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
|
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||||
|
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||||
|
.invoke('removeAttr', 'target')
|
||||||
|
.click();
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('openActions', (row) => {
|
||||||
|
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('checkNotification', (type) => {
|
||||||
|
const values = {
|
||||||
|
created: 'Data created',
|
||||||
|
updated: 'Data saved',
|
||||||
|
deleted: 'Data deleted',
|
||||||
|
};
|
||||||
|
cy.get('.q-notification__message').should('have.text', values[type]);
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('checkValueForm', (id, search) => {
|
||||||
|
cy.get(
|
||||||
|
`.grid-create > :nth-child(${id}) > .q-field__inner>.q-field__control> .q-field__control-container>.q-field__native >.q-field__input`
|
||||||
|
).should('have.value', search);
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
||||||
|
cy.get(
|
||||||
|
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container>.q-field__native>.q-field__input`
|
||||||
|
).should('have.value', search);
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('searchByLabel', (label, value) => {
|
||||||
|
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue