import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; describe('Entry descriptor path', () => { let browser; let page; beforeAll(async() => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('buyer', 'entry'); await page.accessToSearchResult('2'); }); afterAll(async() => { await browser.close(); }); it('should reach the second entry summary section', async() => { await page.waitForState('entry.card.summary'); }); it('should show some entry information', async() => { const result = await page.waitToGetProperty(selectors.entryDescriptor.agency, 'innerText'); expect(result).toContain('inhouse pickup'); }); it('should click the travels button to be redirected to the travels index filtered by the current agency', async() => { await page.waitToClick(selectors.entryDescriptor.travelsQuicklink); await page.expectURL('/travel/index'); await page.expectURL('agencyFk'); }); it('should go back to the entry summary', async() => { await page.waitToClick(selectors.globalItems.homeButton); await page.selectModule('entry'); await page.accessToSearchResult('2'); await page.waitForState('entry.card.summary'); }); it('should click the entries button to be redirected to the entries index filtered by the current supplier', async() => { await page.waitToClick(selectors.entryDescriptor.entriesQuicklink); await page.expectURL('/entry/index'); await page.expectURL('supplierFk'); await page.expectURL('to'); await page.expectURL('from'); }); });