salix/e2e/paths/09-invoice-out/03_manualInvoice.spec.js

54 lines
2.3 KiB
JavaScript
Raw Normal View History

2021-08-09 16:24:53 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('InvoiceOut manual invoice path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('administrative', 'invoiceOut');
});
afterAll(async() => {
await browser.close();
});
2023-05-05 06:12:38 +00:00
it('should create an invoice from a ticket', async() => {
2021-08-09 16:24:53 +00:00
await page.waitToClick(selectors.invoiceOutIndex.createInvoice);
await page.waitForSelector(selectors.invoiceOutIndex.manualInvoiceForm);
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTicket, '15');
2021-08-09 16:24:53 +00:00
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
2021-08-11 11:34:32 +00:00
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
2021-08-09 16:24:53 +00:00
const message = await page.waitForSnackbar();
await page.waitForState('invoiceOut.card.summary');
2023-05-05 06:12:38 +00:00
expect(message.text).toContain('Data saved!');
2021-08-09 16:24:53 +00:00
});
2023-05-05 06:12:38 +00:00
it(`should create another invoice from a client`, async() => {
2021-08-09 16:24:53 +00:00
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
await page.waitForSelector(selectors.invoiceOutIndex.topbarSearch);
await page.waitForState('invoiceOut.index');
await page.waitToClick(selectors.invoiceOutIndex.createInvoice);
await page.waitForSelector(selectors.invoiceOutIndex.manualInvoiceForm);
2024-04-26 07:30:20 +00:00
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceClient, 'Petter Parker');
2021-08-09 16:24:53 +00:00
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceSerial, 'Global nacional');
await page.autocompleteSearch(selectors.invoiceOutIndex.manualInvoiceTaxArea, 'national');
2021-08-11 11:34:32 +00:00
await page.waitToClick(selectors.invoiceOutIndex.saveInvoice);
2021-08-09 16:24:53 +00:00
const message = await page.waitForSnackbar();
await page.waitForState('invoiceOut.card.summary');
2023-05-05 06:12:38 +00:00
expect(message.text).toContain('Data saved!');
2021-08-09 16:24:53 +00:00
});
});