mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-13 00:35:57 +08:00
fix(test): failing puppeteer without stealth test (#9851)
Signed-off-by: Rongrong <i@rong.moe>
This commit is contained in:
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'dependabot/**'
|
- 'dependabot/**'
|
||||||
paths:
|
paths:
|
||||||
|
- 'test/**'
|
||||||
- 'lib/**'
|
- 'lib/**'
|
||||||
- '!**/maintainer.js'
|
- '!**/maintainer.js'
|
||||||
- '!**/radar.js'
|
- '!**/radar.js'
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ describe('puppeteer', () => {
|
|||||||
|
|
||||||
const webDriverTest = $('tbody tr').eq(2).find('td').eq(1).text().trim();
|
const webDriverTest = $('tbody tr').eq(2).find('td').eq(1).text().trim();
|
||||||
const chromeTest = $('tbody tr').eq(4).find('td').eq(1).text().trim();
|
const chromeTest = $('tbody tr').eq(4).find('td').eq(1).text().trim();
|
||||||
expect(webDriverTest).toBe('present (failed)');
|
// the website return empty string from time to time for no reason
|
||||||
expect(chromeTest).toBe('missing (failed)');
|
// since we don't really care whether puppeteer without stealth passes the bot test, just let it go
|
||||||
|
expect(['present (failed)', '']).toContain(webDriverTest);
|
||||||
|
expect(['missing (failed)', '']).toContain(chromeTest);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
it('puppeteer with stealth', async () => {
|
it('puppeteer with stealth', async () => {
|
||||||
puppeteer = require('../../lib/utils/puppeteer');
|
puppeteer = require('../../lib/utils/puppeteer');
|
||||||
@@ -53,6 +55,7 @@ describe('puppeteer', () => {
|
|||||||
browser.close();
|
browser.close();
|
||||||
const webDriverTest = $('tbody tr').eq(2).find('td').eq(1).text().trim();
|
const webDriverTest = $('tbody tr').eq(2).find('td').eq(1).text().trim();
|
||||||
const chromeTest = $('tbody tr').eq(4).find('td').eq(1).text().trim();
|
const chromeTest = $('tbody tr').eq(4).find('td').eq(1).text().trim();
|
||||||
|
// these are something we really care about
|
||||||
expect(webDriverTest).toBe('missing (passed)');
|
expect(webDriverTest).toBe('missing (passed)');
|
||||||
expect(chromeTest).toBe('present (passed)');
|
expect(chromeTest).toBe('present (passed)');
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|||||||
Reference in New Issue
Block a user