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 then redirect to basic Data', 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); await page.waitForNavigation({ waitUntil: 'load', }); await page.waitForState('entry.card.basicData'); }); });