home.e2e.js 451 B

123456789101112131415
  1. const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
  2. describe('Homepage', () => {
  3. beforeAll(async () => {
  4. jest.setTimeout(1000000);
  5. });
  6. it('it should have logo text', async () => {
  7. await page.goto(BASE_URL);
  8. await page.waitForSelector('h1', {
  9. timeout: 5000,
  10. });
  11. const text = await page.evaluate(() => document.getElementsByTagName('h1')[0].innerText);
  12. expect(text).toContain('平台后台');
  13. });
  14. });