home.e2e.js 520 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 () => {
jim's avatar
fix ci  
jim committed
5
    const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
valleykid's avatar
valleykid committed
6
    const page = await browser.newPage();
jim's avatar
fix ci  
jim committed
7
    await page.goto('http://localhost:8000', { waitUntil: 'networkidle2' });
valleykid's avatar
valleykid committed
8 9
    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
  });
});