feat: only Chromium Minimal variant + click Join in chat header (step 6+7)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ValueOn AG 2026-02-17 17:13:09 +01:00
parent e4eee9fb0d
commit 68cf43c5fa

View file

@ -48,31 +48,17 @@ export interface AuthTestResults {
// ============================================================================ // ============================================================================
const _VARIANTS: AuthTestVariant[] = [ const _VARIANTS: AuthTestVariant[] = [
{ // Paused: redirected to light-meetings
id: 'chromiumClean', // { id: 'chromiumClean', name: '1) Chromium Headful Clean', description: '...' },
name: '1) Chromium Headful Clean', // { id: 'chromiumNoAutomation', name: '2) Chromium No-Automation', description: '...' },
description: 'Playwright Chromium headful, enhanced stealth + realistic devices', // { id: 'rebrowserHeadful', name: '3) rebrowser-playwright', description: '...' },
},
{
id: 'chromiumNoAutomation',
name: '2) Chromium No-Automation',
description: 'Chromium headful + --disable-extensions, --no-first-run',
},
{
id: 'rebrowserHeadful',
name: '3) rebrowser-playwright',
description: 'rebrowser-playwright headful, CDP-Leak-Fixes + realistic devices',
},
{ {
id: 'chromiumMinimal', id: 'chromiumMinimal',
name: '4) Chromium Minimal', name: '4) Chromium Minimal',
description: 'Chromium headful, nur --no-sandbox (minimale Stealth)', description: 'Chromium headful, nur --no-sandbox (minimale Stealth) — einzige Variante die auth schafft',
},
{
id: 'chromiumHeadless',
name: '5) Chromium Headless',
description: 'Chromium headless als Baseline-Vergleich',
}, },
// Paused: redirected to light-meetings
// { id: 'chromiumHeadless', name: '5) Chromium Headless', description: '...' },
]; ];
// ============================================================================ // ============================================================================
@ -516,6 +502,99 @@ async function _runVariant(
} }
await _screenshotStep('5 - Nach Join meeting'); await _screenshotStep('5 - Nach Join meeting');
// =====================================================================
// STEP 6: Click "Join" button in Teams chat header to join the call
// =====================================================================
_log('info', 'Step 6: Looking for "Join" button in Teams chat header...');
// Wait for the Teams chat page to fully render
try {
await page.waitForSelector(
'button[data-tid="chat-join-button"], button[data-tid="join-call-button"]',
{ timeout: 30000, state: 'visible' },
);
_log('info', 'Teams chat page loaded, "Join" button found');
} catch {
_log('warn', '"Join" button not found in chat header after 30s — logging all buttons');
try {
const buttons = await page.evaluate(() => {
const btns = document.querySelectorAll('button');
return Array.from(btns).slice(0, 30).map(b => {
const text = (b.textContent || '').trim().substring(0, 80);
const tid = b.getAttribute('data-tid') || '';
return `[BUTTON tid="${tid}"] ${text}`;
});
});
buttons.forEach(b => _log('info', ` ${b}`));
} catch {
// Ignore
}
}
await _screenshotStep('6 - Teams Chat (vor Join-Klick)');
// Click the "Join" button in the chat header
const chatJoinSelectors = [
'button[data-tid="chat-join-button"]',
'button[data-tid="join-call-button"]',
'button:has-text("Join")',
'button:has-text("Beitreten")',
];
let chatJoinClicked = false;
for (const selector of chatJoinSelectors) {
try {
const btn = await page.waitForSelector(selector, { timeout: 5000, state: 'visible' });
if (btn) {
await btn.click();
_log('info', `Clicked chat "Join" button: ${selector}`);
chatJoinClicked = true;
break;
}
} catch {
// Try next
}
}
if (!chatJoinClicked) {
_log('warn', '"Join" button in chat header not found');
}
// Wait for the meeting to load after clicking Join
if (chatJoinClicked) {
_log('info', 'Waiting for meeting view to load...');
await page.waitForTimeout(5000);
// Wait for meeting UI elements (hangup button, video controls, etc.)
try {
await page.waitForSelector(
'button[id="hangup-button"], button[data-tid="hangup-button"], [data-tid="prejoin-join-button"], [data-tid="calling-prejoin"]',
{ timeout: 30000, state: 'visible' },
);
_log('info', 'Meeting UI elements detected');
} catch {
_log('warn', 'Meeting UI elements not found after 30s');
}
await page.waitForTimeout(5000);
}
await _screenshotStep('7 - Nach Join (Meeting-Ansicht)');
// Log all visible buttons on the final page for debugging
try {
const buttons = await page.evaluate(() => {
const btns = document.querySelectorAll('button');
return Array.from(btns).slice(0, 25).map(b => {
const text = (b.textContent || '').trim().substring(0, 80);
const tid = b.getAttribute('data-tid') || '';
return `[BUTTON tid="${tid}"] ${text}`;
});
});
buttons.forEach(b => _log('info', ` Final page button: ${b}`));
} catch {
// Ignore
}
// ===================================================================== // =====================================================================
// FINAL: Log result // FINAL: Log result
// ===================================================================== // =====================================================================