e2e path for global invoicing
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e4cae57c0b
commit
1274fef983
|
@ -917,13 +917,17 @@ export default {
|
||||||
searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
|
searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
|
||||||
createInvoice: 'vn-invoice-out-index > div > vn-vertical > vn-button > button vn-icon[icon="add"]',
|
createInvoice: 'vn-invoice-out-index > div > vn-vertical > vn-button > button vn-icon[icon="add"]',
|
||||||
createManualInvoice: 'vn-item[name="manualInvoice"]',
|
createManualInvoice: 'vn-item[name="manualInvoice"]',
|
||||||
|
createGlobalInvoice: 'vn-item[name="globalInvoice"]',
|
||||||
manualInvoiceForm: '.vn-invoice-out-manual',
|
manualInvoiceForm: '.vn-invoice-out-manual',
|
||||||
manualInvoiceTicket: 'vn-autocomplete[ng-model="$ctrl.invoice.ticketFk"]',
|
manualInvoiceTicket: 'vn-autocomplete[ng-model="$ctrl.invoice.ticketFk"]',
|
||||||
manualInvoiceClient: 'vn-autocomplete[ng-model="$ctrl.invoice.clientFk"]',
|
manualInvoiceClient: 'vn-autocomplete[ng-model="$ctrl.invoice.clientFk"]',
|
||||||
manualInvoiceSerial: 'vn-autocomplete[ng-model="$ctrl.invoice.serial"]',
|
manualInvoiceSerial: 'vn-autocomplete[ng-model="$ctrl.invoice.serial"]',
|
||||||
manualInvoiceTaxArea: 'vn-autocomplete[ng-model="$ctrl.invoice.taxArea"]',
|
manualInvoiceTaxArea: 'vn-autocomplete[ng-model="$ctrl.invoice.taxArea"]',
|
||||||
saveManualInvoice: 'button[response="accept"]'
|
saveInvoice: 'button[response="accept"]',
|
||||||
|
globalInvoiceForm: '.vn-invoice-out-global-invoicing',
|
||||||
|
globalInvoiceDate: '[ng-model="$ctrl.invoice.invoiceDate"]',
|
||||||
|
globalInvoiceFromClient: '[ng-model="$ctrl.invoice.fromClientId"]',
|
||||||
|
globalInvoiceToClient: '[ng-model="$ctrl.invoice.toClientId"]',
|
||||||
},
|
},
|
||||||
invoiceOutDescriptor: {
|
invoiceOutDescriptor: {
|
||||||
moreMenu: 'vn-invoice-out-descriptor vn-icon-button[icon=more_vert]',
|
moreMenu: 'vn-invoice-out-descriptor vn-icon-button[icon=more_vert]',
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe('InvoiceOut manual invoice path', () => {
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTicket, '7');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTicket, '7');
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
|
||||||
await page.waitToClick(selectors.invoiceOutIndex.saveManualInvoice);
|
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
|
||||||
const message = await page.waitForSnackbar();
|
const message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('Data saved!');
|
expect(message.text).toContain('Data saved!');
|
||||||
|
@ -53,7 +53,7 @@ describe('InvoiceOut manual invoice path', () => {
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceClient, 'Charles Xavier');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceClient, 'Charles Xavier');
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
|
||||||
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
|
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
|
||||||
await page.waitToClick(selectors.invoiceOutIndex.saveManualInvoice);
|
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
|
||||||
const message = await page.waitForSnackbar();
|
const message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('Data saved!');
|
expect(message.text).toContain('Data saved!');
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import getBrowser from '../../helpers/puppeteer';
|
||||||
|
|
||||||
|
describe('InvoiceOut global invoice path', () => {
|
||||||
|
let browser;
|
||||||
|
let page;
|
||||||
|
|
||||||
|
beforeAll(async() => {
|
||||||
|
browser = await getBrowser();
|
||||||
|
page = browser.page;
|
||||||
|
await page.loginAndModule('administrative', 'invoiceOut');
|
||||||
|
await page.waitToClick('[icon="search"]');
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async() => {
|
||||||
|
await browser.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
let invoicesBefore;
|
||||||
|
|
||||||
|
it('should count the amount of invoices listed before globla invoces are made', async() => {
|
||||||
|
invoicesBefore = await page.countElement(selectors.invoiceOutIndex.searchResult);
|
||||||
|
|
||||||
|
expect(invoicesBefore).toBeGreaterThanOrEqual(4);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open the global invoice form', async() => {
|
||||||
|
await page.waitToClick(selectors.invoiceOutIndex.createInvoice);
|
||||||
|
await page.waitToClick(selectors.invoiceOutIndex.createGlobalInvoice);
|
||||||
|
await page.waitForSelector(selectors.invoiceOutIndex.globalInvoiceForm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create a global invoice for charles xavier today', async() => {
|
||||||
|
await page.pickDate(selectors.invoiceOutIndex.globalInvoiceDate);
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceFromClient, 'Petter Parker');
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
await page.autocompleteSearch(selectors.invoiceOutIndex.globalInvoiceToClient, 'Petter Parker');
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
|
||||||
|
const message = await page.waitForSnackbar();
|
||||||
|
|
||||||
|
expect(message.text).toContain('Data saved!');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should count the amount of invoices listed after globla invocing', async() => {
|
||||||
|
await page.waitToClick('[icon="search"]');
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
const currentInvoices = await page.countElement(selectors.invoiceOutIndex.searchResult);
|
||||||
|
|
||||||
|
expect(currentInvoices).toBeGreaterThan(invoicesBefore);
|
||||||
|
});
|
||||||
|
});
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue