diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 873e7c0b5..0e36fbcb6 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -799,5 +799,10 @@ export default { inflation: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.inflation"]', volumetric: 'vn-zone-basic-data vn-check[ng-model="$ctrl.zone.isVolumetric"]', saveButton: 'vn-zone-basic-data vn-submit > button', + }, + entrySummary: { + header: 'vn-entry-summary > vn-card > h5', + reference: 'vn-entry-summary vn-label-value[label="Reference"]', + confirmed: 'vn-entry-summary vn-check[label="Confirmed"]', } }; diff --git a/e2e/paths/12-entry/01_summary.spec.js b/e2e/paths/12-entry/01_summary.spec.js new file mode 100644 index 000000000..39b12b840 --- /dev/null +++ b/e2e/paths/12-entry/01_summary.spec.js @@ -0,0 +1,43 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Entry summary path', () => { + let browser; + let page; + + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('buyer', 'entry'); + await page.waitToClick('vn-entry-index vn-tbody > a:nth-child(2)'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should reach the second entry summary section', async() => { + let url = await page.expectURL('#!/entry/2/summary'); + + expect(url).toBe(true); + }); + + it(`should display details from the entry on the header`, async() => { + await page.waitForTextInElement(selectors.entrySummary.header, 'The king'); + const result = await page.waitToGetProperty(selectors.entrySummary.header, 'innerText'); + + expect(result).toContain('The king'); + }); + + it('should display some entry details like the reference', async() => { + const result = await page.waitToGetProperty(selectors.entrySummary.reference, 'innerText'); + + expect(result).toContain('Movement 2'); + }); + + it('should display other entry details like the confirmed', async() => { + const result = await page.checkboxState(selectors.entrySummary.confirmed, 'innerText'); + + expect(result).toContain('unchecked'); + }); +});