-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_web3.js
More file actions
18 lines (14 loc) · 568 Bytes
/
Copy pathtest_web3.js
File metadata and controls
18 lines (14 loc) · 568 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('http://localhost:8000', { waitUntil: 'networkidle0' });
// check if web3 elements exist
const elementsExist = await page.evaluate(() => {
return !!document.querySelector('#web3-demo') &&
!!document.querySelector('#connect-wallet-btn') &&
!!document.querySelector('#sign-message-btn');
});
console.log('Web3 elements exist:', elementsExist);
await browser.close();
})();