2021-04-15 16:00:21 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
2021-09-02 10:56:35 +00:00
|
|
|
// #3082 clone is broken due to a strange trigger from production
|
|
|
|
xdescribe('InvoiceIn descriptor path', () => {
|
2021-04-15 16:00:21 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|