76 lines
3.2 KiB
JavaScript
76 lines
3.2 KiB
JavaScript
/// <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();
|
|
});
|
|
});
|