home.e2e.js 463 Bytes
Newer Older
valleykid's avatar
valleykid committed
1
import puppeteer from 'puppeteer';
afc163's avatar
afc163 committed
2 3 4

describe('Homepage', () => {
  it('it should have logo text', async () => {
valleykid's avatar
valleykid committed
5 6 7 8 9
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('http://localhost:8000');
    await page.waitForSelector('h1');
    const text = await page.evaluate(() => document.body.innerHTML);
afc163's avatar
afc163 committed
10
    expect(text).toContain('<h1>Ant Design Pro</h1>');
valleykid's avatar
valleykid committed
11 12
    await page.close();
    browser.close();
afc163's avatar
afc163 committed
13 14
  });
});