Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

main.js

Blame
  • main.js 753 B
    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"]');
      });
    });