salix/e2e/paths/04-item/10_item_log.spec.js

46 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2019-03-20 07:23:12 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2019-03-20 07:23:12 +00:00
2019-03-20 10:47:00 +00:00
describe('Item log path', () => {
let browser;
2020-01-09 12:07:16 +00:00
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2020-01-09 12:07:16 +00:00
await page.loginAndModule('developer', 'item');
});
afterAll(async() => {
await browser.close();
2019-03-20 07:23:12 +00:00
});
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
await page.doSearch('Knowledge artifact');
const nResults = await page.countElement(selectors.itemsIndex.searchResult);
2019-03-20 07:23:12 +00:00
2023-06-12 17:51:16 +00:00
expect(nResults).toEqual(1);
2019-03-20 07:23:12 +00:00
});
it('should access to the create item view by clicking the create floating button', async() => {
2020-01-09 12:07:16 +00:00
await page.waitToClick(selectors.itemsIndex.createItemButton);
await page.waitForState('item.create');
2019-03-20 07:23:12 +00:00
});
it('should create the Knowledge artifact item', async() => {
2020-01-09 12:07:16 +00:00
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
2020-02-03 14:55:11 +00:00
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
2020-01-09 12:07:16 +00:00
await page.waitToClick(selectors.itemCreateView.createButton);
2020-04-08 09:24:40 +00:00
const message = await page.waitForSnackbar();
2019-03-20 07:23:12 +00:00
2020-11-10 11:06:21 +00:00
expect(message.text).toContain('Data saved!');
2019-03-20 07:23:12 +00:00
});
it('should return to the items index by clicking the return to items button', async() => {
2020-01-09 12:07:16 +00:00
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.waitForSelector(selectors.itemsIndex.createItemButton);
await page.waitForState('item.index');
2019-03-20 07:23:12 +00:00
});
});