salix/e2e/paths/12-entry/03_latestBuys.spec.js

45 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-08-28 17:52:54 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Entry lastest buys 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 access the latest buys seccion and search not seeing the edit buys button yet', async() => {
await page.waitToClick(selectors.entryLatestBuys.latestBuysSectionButton);
await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false});
});
it('should select all lines but one and then check the edit buys button appears', async() => {
await page.waitToClick(selectors.entryLatestBuys.allBuysCheckBox);
await page.waitToClick(selectors.entryLatestBuys.secondBuyCheckBox);
await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: true});
});
it('should open the edit dialog', async() => {
await page.waitToClick(selectors.entryLatestBuys.editBuysButton);
await page.waitForSelector(selectors.entryLatestBuys.fieldAutocomplete, {visible: true});
});
it('should search for the "Description" and type a new one for the items in each selected buy', async() => {
2020-08-28 17:52:54 +00:00
await page.autocompleteSearch(selectors.entryLatestBuys.fieldAutocomplete, 'Description');
await page.write(selectors.entryLatestBuys.newValueInput, 'Crafted item');
await page.waitToClick(selectors.entryLatestBuys.acceptEditBuysDialog);
});
it('should navigate to the entry.buy section by clicking one of the buys', async() => {
await page.waitToClick(selectors.entryLatestBuys.firstBuy);
2021-03-12 07:45:41 +00:00
await page.waitForState('entry.card.buy.index');
2020-08-28 17:52:54 +00:00
});
});