2021-04-15 16:00:21 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('InvoiceIn descriptor path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('administrative', 'invoiceIn');
|
|
|
|
await page.accessToSearchResult('10');
|
2021-07-23 12:07:05 +00:00
|
|
|
await page.accessToSection('invoiceIn.card.basicData');
|
2021-04-15 16:00:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
2021-07-23 12:07:05 +00:00
|
|
|
it('should clone the invoiceIn using the descriptor more menu', async() => {
|
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.moreMenu);
|
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.moreMenuCloneInvoiceIn);
|
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.acceptButton);
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('InvoiceIn cloned');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have been redirected to the created invoiceIn summary', async() => {
|
|
|
|
await page.waitForState('invoiceIn.card.summary');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should delete the cloned invoiceIn using the descriptor more menu', async() => {
|
2021-04-15 16:00:21 +00:00
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.moreMenu);
|
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.moreMenuDeleteInvoiceIn);
|
2021-07-23 12:07:05 +00:00
|
|
|
await page.waitToClick(selectors.invoiceInDescriptor.acceptButton);
|
2021-04-15 16:00:21 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('InvoiceIn deleted');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have been relocated to the invoiceOut index', async() => {
|
|
|
|
await page.waitForState('invoiceIn.index');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should search for the deleted invouceOut to find no results`, async() => {
|
|
|
|
await page.doSearch('10');
|
|
|
|
const nResults = await page.countElement(selectors.invoiceOutIndex.searchResult);
|
|
|
|
|
|
|
|
expect(nResults).toEqual(0);
|
|
|
|
});
|
|
|
|
});
|