Skip to content

Commit 80206e9

Browse files
committed
add new test
1 parent cf20cd6 commit 80206e9

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppeteer-real-browser",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"description": "This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.",
55
"main": "lib/cjs/index.js",
66
"module": "lib/esm/index.mjs",

test/cjs/test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const realBrowserOption = {
2929
// await browser.close()
3030
// })
3131

32-
3332
test('DrissionPage Detector', async () => {
3433
const { page, browser } = await connect(realBrowserOption)
3534
await page.goto("https://drissionpage.pages.dev/");
@@ -98,3 +97,14 @@ test('Recaptcha V3 Score (hard)', async () => {
9897
// if (Number(score) >= 0.7) console.log('Recaptcha V3 Score: ' + score);
9998
assert.strictEqual(Number(score) >= 0.7, true, "Recaptcha V3 Score (hard) should be >=0.7. Score Result: " + score)
10099
})
100+
101+
test('Fingerprint JS Bot Detector', async () => {
102+
const { page, browser } = await connect(realBrowserOption)
103+
await page.goto("https://fingerprint.com/products/bot-detection/");
104+
await new Promise(r => setTimeout(r, 5000));
105+
const detect = await page.evaluate(() => {
106+
return document.querySelector('.HeroSection-module--botSubTitle--2711e').textContent.includes("not") ? true : false
107+
})
108+
await browser.close()
109+
assert.strictEqual(detect, true, "Fingerprint JS Bot Detector test failed!")
110+
})

test/esm/test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,15 @@ test('Recaptcha V3 Score (hard)', async () => {
9898
await browser.close()
9999
// if (Number(score) >= 0.7) console.log('Recaptcha V3 Score: ' + score);
100100
assert.strictEqual(Number(score) >= 0.7, true, "Recaptcha V3 Score (hard) should be >=0.7. Score Result: " + score)
101+
})
102+
103+
test('Fingerprint JS Bot Detector', async () => {
104+
const { page, browser } = await connect(realBrowserOption)
105+
await page.goto("https://fingerprint.com/products/bot-detection/");
106+
await new Promise(r => setTimeout(r, 5000));
107+
const detect = await page.evaluate(() => {
108+
return document.querySelector('.HeroSection-module--botSubTitle--2711e').textContent.includes("not") ? true : false
109+
})
110+
await browser.close()
111+
assert.strictEqual(detect, true, "Fingerprint JS Bot Detector test failed!")
101112
})

0 commit comments

Comments
 (0)