diff --git a/__tests__/main.js b/__tests__/main.js index 9ba064d313cf46263af811a30d229eed2be4f14f..c5d2cd994e6384d3738436a1cce0d1125281d799 100644 --- a/__tests__/main.js +++ b/__tests__/main.js @@ -23,3 +23,29 @@ describe('Open local HTTP server', () => { await expect(page).toMatchElement('a[href="./jest.json"]'); }); }); + +describe('Open example', () => { + beforeAll(async () => { + await page.goto('https://example.org'); + }); + it('has the correct page title', async () => { + const title = await page.title(); + expect(title).toBe('Example Domain'); + }); + it('has the main text', async () => { + await expect(page).toMatchElement('a[href="https://www.iana.org/domains/example"]'); + }); +}); + +describe('Open local HTTP server', () => { + beforeAll(async () => { + await page.goto('http://127.0.0.1:4488'); + }); + it('has the correct page title', async () => { + const title = await page.title(); + expect(title).toBe('Index of /'); + }); + it('has the correct link', async () => { + await expect(page).toMatchElement('a[href="./jest.json"]'); + }); +});