Commit 4d5eec59 authored by nanahira's avatar nanahira

fix

parent 0c57c404
Pipeline #23682 failed with stages
...@@ -854,7 +854,9 @@ async function getOpenAIAuth({ ...@@ -854,7 +854,9 @@ async function getOpenAIAuth({
if (email && password) { if (email && password) {
await waitForConditionOrAtCapacity( await waitForConditionOrAtCapacity(
page, page,
() => page.waitForSelector("#__next .btn-primary", { timeout: timeoutMs }) () => page.waitForSelector("#__next button:first-child", {
timeout: timeoutMs
})
); );
await delay(500); await delay(500);
do { do {
...@@ -863,7 +865,7 @@ async function getOpenAIAuth({ ...@@ -863,7 +865,7 @@ async function getOpenAIAuth({
waitUntil: "networkidle2", waitUntil: "networkidle2",
timeout: timeoutMs timeout: timeoutMs
}), }),
page.click("#__next .btn-primary") page.click("#__next button:first-child")
]); ]);
await delay(500); await delay(500);
} while (page.url().endsWith("/auth/login")); } while (page.url().endsWith("/auth/login"));
...@@ -882,7 +884,7 @@ async function getOpenAIAuth({ ...@@ -882,7 +884,7 @@ async function getOpenAIAuth({
]); ]);
await page.waitForSelector('input[type="password"]', { visible: true }); await page.waitForSelector('input[type="password"]', { visible: true });
await page.type('input[type="password"]', password); await page.type('input[type="password"]', password);
await delay(50); await delay(200);
submitP = () => page.keyboard.press("Enter"); submitP = () => page.keyboard.press("Enter");
} else if (isMicrosoftLogin) { } else if (isMicrosoftLogin) {
await page.click('button[data-provider="windowslive"]'); await page.click('button[data-provider="windowslive"]');
...@@ -895,7 +897,7 @@ async function getOpenAIAuth({ ...@@ -895,7 +897,7 @@ async function getOpenAIAuth({
await delay(1500); await delay(1500);
await page.waitForSelector('input[type="password"]', { visible: true }); await page.waitForSelector('input[type="password"]', { visible: true });
await page.type('input[type="password"]', password); await page.type('input[type="password"]', password);
await delay(50); await delay(200);
submitP = () => page.keyboard.press("Enter"); submitP = () => page.keyboard.press("Enter");
await Promise.all([ await Promise.all([
page.waitForNavigation(), page.waitForNavigation(),
...@@ -928,16 +930,21 @@ async function getOpenAIAuth({ ...@@ -928,16 +930,21 @@ async function getOpenAIAuth({
} }
await delay(2e3); await delay(2e3);
const frame = page.mainFrame(); const frame = page.mainFrame();
const submit = await page.waitForSelector('button[type="submit"]', { const submit = await page.waitForSelector(
timeout: timeoutMs 'button[type="submit"][data-action-button-primary="true"]',
}); {
await frame.focus('button[type="submit"]'); timeout: timeoutMs
}
);
await frame.focus(
'button[type="submit"][data-action-button-primary="true"]'
);
await submit.focus(); await submit.focus();
await submit.click(); await submit.click();
await page.waitForSelector("#password", { timeout: timeoutMs }); await page.waitForSelector("#password", { timeout: timeoutMs });
await page.type("#password", password); await page.type("#password", password);
await delay(200); await delay(200);
submitP = () => page.click('button[type="submit"]'); submitP = () => page.click('button[type="submit"][data-action-button-primary="true"]');
} }
await Promise.all([ await Promise.all([
waitForConditionOrAtCapacity( waitForConditionOrAtCapacity(
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment