2019-03-10 12:14:13 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-14 08:24:09 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-03-10 12:14:13 +00:00
|
|
|
|
2019-03-14 07:44:47 +00:00
|
|
|
describe('Item descriptor path', () => {
|
2020-01-14 08:24:09 +00:00
|
|
|
let browser;
|
2020-01-09 12:07:16 +00:00
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
2020-01-14 08:24:09 +00:00
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
2020-01-09 12:07:16 +00:00
|
|
|
await page.loginAndModule('buyer', 'item');
|
|
|
|
await page.accessToSearchResult('1');
|
|
|
|
await page.accessToSection('item.card.basicData');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
2020-01-16 12:40:51 +00:00
|
|
|
await browser.close();
|
2019-03-10 12:14:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should set the item to inactive', async() => {
|
2020-01-09 12:07:16 +00:00
|
|
|
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
|
|
|
|
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-03-10 12:14:13 +00:00
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2019-03-10 12:14:13 +00:00
|
|
|
});
|
|
|
|
|
2020-12-04 12:40:58 +00:00
|
|
|
it('should reload the section and check the inactive icon is visible', async() => {
|
2020-01-09 12:07:16 +00:00
|
|
|
await page.reloadSection('item.card.basicData');
|
2020-12-04 12:40:58 +00:00
|
|
|
const visibleIcon = await page.isVisible(selectors.itemDescriptor.inactiveIcon);
|
2019-03-10 12:14:13 +00:00
|
|
|
|
2020-12-04 12:40:58 +00:00
|
|
|
expect(visibleIcon).toBeTruthy();
|
2019-03-10 12:14:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should set the item back to active', async() => {
|
2020-01-09 12:07:16 +00:00
|
|
|
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
|
|
|
|
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
|
2020-04-08 09:24:40 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2019-03-10 12:14:13 +00:00
|
|
|
|
2020-11-10 11:06:21 +00:00
|
|
|
expect(message.text).toContain('Data saved!');
|
2019-03-10 12:14:13 +00:00
|
|
|
});
|
|
|
|
});
|