|
@@ -1,10 +1,12 @@
|
|
|
import puppeteer from 'puppeteer';
|
|
import puppeteer from 'puppeteer';
|
|
|
|
|
|
|
|
|
|
+const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
|
|
|
|
|
+
|
|
|
describe('Homepage', () => {
|
|
describe('Homepage', () => {
|
|
|
it('it should have logo text', async () => {
|
|
it('it should have logo text', async () => {
|
|
|
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
|
|
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
|
|
|
const page = await browser.newPage();
|
|
const page = await browser.newPage();
|
|
|
- await page.goto('http://localhost:8000', { waitUntil: 'networkidle2' });
|
|
|
|
|
|
|
+ await page.goto(BASE_URL, { waitUntil: 'networkidle2' });
|
|
|
await page.waitForSelector('#logo h1');
|
|
await page.waitForSelector('#logo h1');
|
|
|
const text = await page.evaluate(() => document.body.innerHTML);
|
|
const text = await page.evaluate(() => document.body.innerHTML);
|
|
|
expect(text).toContain('<h1>Ant Design Pro</h1>');
|
|
expect(text).toContain('<h1>Ant Design Pro</h1>');
|