salix/e2e/paths/12-entry/04_create.spec.js

35 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2020-09-03 15:30:24 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2020-09-07 08:30:36 +00:00
describe('Entry create path', () => {
2020-09-03 15:30:24 +00:00
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');
});
2020-10-02 06:57:51 +00:00
it('should fill the form to create a valid entry then redirect to basic Data', async() => {
2023-05-05 06:12:38 +00:00
await page.autocompleteSearch(selectors.entryIndex.newEntrySupplier, 'The farmer');
await page.autocompleteSearch(selectors.entryIndex.newEntryTravel, 'Warehouse');
2020-09-03 15:30:24 +00:00
await page.autocompleteSearch(selectors.entryIndex.newEntryCompany, 'ORN');
2020-10-02 06:57:51 +00:00
await page.waitToClick(selectors.entryIndex.saveNewEntry);
2020-10-19 18:49:38 +00:00
await page.waitForNavigation({
waitUntil: 'load',
});
2020-09-07 08:30:36 +00:00
await page.waitForState('entry.card.basicData');
2020-09-03 15:30:24 +00:00
});
});