Update bot.js

This commit is contained in:
2026-07-01 08:21:51 +00:00
parent 7061970eff
commit bfbba49239
+21 -2
View File
@@ -135,9 +135,28 @@ async function addAccount(browser, account, index, total, config) {
await page.getByRole('link', { name: /Antigravity/ }).click(); await page.getByRole('link', { name: /Antigravity/ }).click();
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
// Click Add button // Click Add button (icon text may vary depending on UI version)
await page.getByRole('button', { name: 'add Add', exact: true }).click();
await sleep(1000); await sleep(1000);
let addClicked = false;
// Try exact match first
const addExact = page.getByRole('button', { name: 'add Add', exact: true });
if (await addExact.isVisible({ timeout: 3000 }).catch(() => false)) {
console.log(' [>] Add Connection → "add Add" (exact)');
await addExact.click();
addClicked = true;
}
// Fallback: try other variants
if (!addClicked) {
addClicked = await clickAny(page, [
'Add Connection',
'add Add Connection',
/Add\s*Connection/i,
'add Add',
], 'Add Connection', 10000);
}
if (!addClicked) throw new Error('Could not find Add Connection button');
// Click "I Understand, Continue" - triggers Google OAuth popup // Click "I Understand, Continue" - triggers Google OAuth popup
const popupPromise = page.waitForEvent('popup', { timeout: 15000 }); const popupPromise = page.waitForEvent('popup', { timeout: 15000 });