salix/e2e/paths/08-route/02_basic_data.spec.js

43 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

import getBrowser from '../../helpers/puppeteer';
2019-03-25 09:07:10 +00:00
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');
});
2019-03-25 09:07:10 +00:00
afterAll(async() => {
await browser.close();
2019-03-25 09:07:10 +00:00
});
2023-05-05 06:12:38 +00:00
it('should edit the route basic data and confirm the route was edited', async() => {
2023-01-16 14:18:24 +00:00
const nextMonth = Date.vnNew();
nextMonth.setMonth(nextMonth.getMonth() + 1);
2023-05-05 06:12:38 +00:00
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');
2023-05-05 06:12:38 +00:00
const formValues = await page.fetchForm(form, Object.keys(values));
2019-03-25 09:07:10 +00:00
2023-05-05 06:12:38 +00:00
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual(values);
2019-03-25 09:07:10 +00:00
});
});