#8448 - devToTest #1254
|
@ -14,14 +14,14 @@ describe('InvoiceOut list', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/list`);
|
cy.visit(`/#/invoice-out/list`);
|
||||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
cy.typeSearchbar('{enter}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search and filter an invoice and enter to the summary', () => {
|
it('should search and filter an invoice and enter to the summary', () => {
|
||||||
cy.dataCy('vnSearchBar').find('input').type('1{enter}');
|
cy.typeSearchbar('1{enter}');
|
||||||
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
|
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
|
||||||
cy.get('.header > a.q-btn > .q-btn__content').click();
|
cy.get('.header > a.q-btn > .q-btn__content').click();
|
||||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
cy.typeSearchbar('{enter}');
|
||||||
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
|
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceOut negative bases', () => {
|
describe('InvoiceOut negative bases', () => {
|
||||||
const notification = '.q-notification__message';
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
@ -13,6 +11,6 @@ describe('InvoiceOut negative bases', () => {
|
||||||
':nth-child(7) > .full-width > :nth-child(1) > .column > div.q-px-xs > .q-field > .q-field__inner > .q-field__control'
|
':nth-child(7) > .full-width > :nth-child(1) > .column > div.q-px-xs > .q-field > .q-field__inner > .q-field__control'
|
||||||
).type('23{enter}');
|
).type('23{enter}');
|
||||||
cy.get('#subToolbar > .q-btn').click();
|
cy.get('#subToolbar > .q-btn').click();
|
||||||
cy.get(notification).should('contains.text', 'CSV downloaded successfully');
|
cy.checkNotification('CSV downloaded successfully');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('InvoiceOut summary', () => {
|
describe('InvoiceOut summary', () => {
|
||||||
const notification = '.q-notification__message';
|
|
||||||
const transferInvoice = {
|
const transferInvoice = {
|
||||||
Client: { val: 'employee', type: 'select' },
|
Client: { val: 'employee', type: 'select' },
|
||||||
Type: { val: 'Error in customer data', type: 'select' },
|
Type: { val: 'Error in customer data', type: 'select' },
|
||||||
|
@ -10,45 +9,39 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/list`);
|
cy.visit(`/#/invoice-out/list`);
|
||||||
cy.get('#searchbar input').type('{enter}');
|
cy.typeSearchbar('{enter}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should generate the invoice PDF', () => {
|
it('should generate the invoice PDF', () => {
|
||||||
cy.get('#searchbar input').type('T1111111{enter}');
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(6)').click();
|
cy.get('.q-menu > .q-list > :nth-child(6)').click();
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.get(notification).should(
|
cy.checkNotification('The invoice PDF document has been regenerated');
|
||||||
'contains.text',
|
|
||||||
'The invoice PDF document has been regenerated'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should refund the invoice ', () => {
|
it('should refund the invoice ', () => {
|
||||||
cy.get('#searchbar input').type('T1111111{enter}');
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
||||||
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||||
cy.get(notification).should(
|
cy.checkNotification('The following refund ticket have been created 1000000');
|
||||||
'contains.text',
|
|
||||||
'The following refund ticket have been created 1000000'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete an invoice ', () => {
|
it('should delete an invoice ', () => {
|
||||||
cy.get('#searchbar input').type('T2222222{enter}');
|
cy.typeSearchbar('T2222222{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.get(notification).should('contains.text', 'InvoiceOut deleted');
|
cy.checkNotification('InvoiceOut deleted');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should transfer the invoice ', () => {
|
it('should transfer the invoice ', () => {
|
||||||
cy.get('#searchbar input').type('T1111111{enter}');
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
||||||
cy.fillInForm(transferInvoice);
|
cy.fillInForm(transferInvoice);
|
||||||
cy.get('.q-mt-lg > .q-btn').click();
|
cy.get('.q-mt-lg > .q-btn').click();
|
||||||
cy.get(notification).should('contains.text', 'Transferred invoice');
|
cy.checkNotification('Transferred invoice');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,18 +16,18 @@ describe('VnSearchBar', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stay on the list page if there are several results or none', () => {
|
it('should stay on the list page if there are several results or none', () => {
|
||||||
cy.writeSearchbar('salesA{enter}');
|
cy.typeSearchbar('salesA{enter}');
|
||||||
checkTableLength(2);
|
checkTableLength(2);
|
||||||
|
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
|
|
||||||
cy.writeSearchbar('0{enter}');
|
cy.typeSearchbar('0{enter}');
|
||||||
checkTableLength(0);
|
checkTableLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchAndCheck = (searchTerm, expectedText) => {
|
const searchAndCheck = (searchTerm, expectedText) => {
|
||||||
cy.clearSearchbar();
|
cy.clearSearchbar();
|
||||||
cy.writeSearchbar(`${searchTerm}{enter}`);
|
cy.typeSearchbar(`${searchTerm}{enter}`);
|
||||||
cy.get(idGap).should('have.text', expectedText);
|
cy.get(idGap).should('have.text', expectedText);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ Cypress.Commands.add('clearSearchbar', (element) => {
|
||||||
).clear();
|
).clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('writeSearchbar', (value) => {
|
Cypress.Commands.add('typeSearchbar', (value) => {
|
||||||
cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(
|
cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue