import getBrowser from '../../helpers/puppeteer'; describe('Route basic Data path', () => { let browser; let page; beforeAll(async() => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('delivery', 'route'); await page.accessToSearchResult('1'); await page.accessToSection('route.card.basicData'); }); afterAll(async() => { await browser.close(); }); it('should edit the route basic data and confirm the route was edited', async() => { const nextMonth = Date.vnNew(); nextMonth.setMonth(nextMonth.getMonth() + 1); nextMonth.setUTCHours(0, 0, 0, 0); const form = 'vn-route-basic-data form'; const values = { worker: 'adminBossNick', vehicle: '1111-IMK', created: nextMonth, kmStart: 1, kmEnd: 2, started: '08:00', finished: '12:30', }; const message = await page.sendForm(form, values); await page.reloadSection('route.card.basicData'); const formValues = await page.fetchForm(form, Object.keys(values)); expect(message.isSuccess).toBeTrue(); expect(formValues).toEqual(values); }); });