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

34 lines
1.1 KiB
JavaScript
Raw 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');
});
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);
});
2020-09-07 08:30:36 +00:00
it('should be redirected to entry basic data', async() => {
await page.waitForState('entry.card.basicData');
2020-09-03 15:30:24 +00:00
});
});