All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 34s
Build & Deploy / 🧪 QA (push) Successful in 1m10s
Build & Deploy / 🏗️ Build (push) Successful in 2m13s
Build & Deploy / 🚀 Deploy (push) Successful in 27s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 45s
Build & Deploy / 🔔 Notify (push) Successful in 2s
25 lines
851 B
JavaScript
25 lines
851 B
JavaScript
const puppeteer = require('puppeteer');
|
|
(async () => {
|
|
const targetUrl = 'https://test.e-tib.com';
|
|
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
|
|
|
const browser = await puppeteer.launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
await page.goto(targetUrl, { waitUntil: 'networkidle0' });
|
|
const isGatekeeper = await page.$('input[name="password"]');
|
|
if (isGatekeeper) {
|
|
await page.type('input[name="password"]', gatekeeperPassword);
|
|
await Promise.all([
|
|
page.click('button[type="submit"]'),
|
|
page.waitForNavigation({ waitUntil: 'networkidle0' }).catch(() => {})
|
|
]);
|
|
const html = await page.content();
|
|
const fs = require('fs');
|
|
fs.writeFileSync('login-result.html', html);
|
|
} else {
|
|
console.log("No gatekeeper found!");
|
|
}
|
|
await browser.close();
|
|
})();
|