Browse Source

Fix #logo does not exist for bugs

陈帅 7 năm trước cách đây
mục cha
commit
49b674b6cf
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      src/e2e/home.e2e.js

+ 3 - 3
src/e2e/home.e2e.js

@@ -10,9 +10,9 @@ describe('Homepage', () => {
     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(BASE_URL, { waitUntil: 'networkidle2' });
     await page.goto(BASE_URL, { waitUntil: 'networkidle2' });
-    await page.waitForSelector('#logo h1');
-    const text = await page.evaluate(() => document.body.innerHTML);
-    expect(text).toContain('<h1>Ant Design Pro</h1>');
+    const text = await page.evaluate(() => document.getElementsByTagName('h1')[0].innerText);
+    expect(text).toContain('Ant Design Pro');
+
     await page.close();
     await page.close();
     browser.close();
     browser.close();
   });
   });