test(smoke): apply Gatekeeper Test Resilience standard
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 35s
Build & Deploy / 🧪 QA (push) Successful in 1m8s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 35s
Build & Deploy / 🧪 QA (push) Successful in 1m8s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
This commit is contained in:
@@ -9,22 +9,35 @@ async function run() {
|
|||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
headless: true,
|
headless: true,
|
||||||
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || undefined,
|
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || undefined,
|
||||||
args: ['--no-sandbox', '--disable-setuid-sandbox'],
|
args: [
|
||||||
|
'--no-sandbox',
|
||||||
|
'--disable-setuid-sandbox',
|
||||||
|
'--disable-dev-shm-usage',
|
||||||
|
'--disable-gpu',
|
||||||
|
'--ignore-certificate-errors',
|
||||||
|
'--disable-web-security',
|
||||||
|
'--disable-features=IsolateOrigins,site-per-process',
|
||||||
|
],
|
||||||
});
|
});
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. Login via Gatekeeper
|
// 1. Login via Gatekeeper
|
||||||
console.log('🔑 Authenticating...');
|
console.log('🔑 Authenticating...');
|
||||||
await page.goto(targetUrl, { waitUntil: 'networkidle2' });
|
await page.goto(targetUrl, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
||||||
|
|
||||||
|
console.log(` Waiting for potential Gatekeeper redirect...`);
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||||
|
|
||||||
const isGatekeeper = await page.$('input[name="password"]');
|
const isGatekeeper = await page.$('input[name="password"]');
|
||||||
if (isGatekeeper) {
|
if (isGatekeeper) {
|
||||||
await page.type('input[name="password"]', gatekeeperPassword);
|
await page.type('input[name="password"]', gatekeeperPassword);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForNavigation({ waitUntil: 'networkidle2' }),
|
page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
|
||||||
page.click('button[type="submit"]'),
|
page.click('button[type="submit"]'),
|
||||||
]);
|
]);
|
||||||
|
console.log(` Waiting for Login -> Home redirect...`);
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Check Key Pages & Assets
|
// 2. Check Key Pages & Assets
|
||||||
|
|||||||
Reference in New Issue
Block a user