import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; describe('Entry create path', () => { let browser; let page; beforeAll(async() => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('buyer', 'entry'); }); afterAll(async() => { await browser.close(); }); it('should click the create entry button to open the form', async() => { await page.waitToClick(selectors.entryIndex.createEntryButton); await page.waitForState('entry.create'); }); it('should fill the form to create a valid entry', async() => { await page.autocompleteSearch(selectors.entryIndex.newEntrySupplier, '2'); await page.autocompleteSearch(selectors.entryIndex.newEntryTravel, 'Warehouse Three'); await page.autocompleteSearch(selectors.entryIndex.newEntryCompany, 'ORN'); await page.waitToClick(selectors.entryIndex.saveNewEntry); }); it('should be redirected to entry basic data', async() => { await page.waitForState('entry.card.basicData'); }); });