Commit 0c57c404 authored by nanahira's avatar nanahira

changes

parent 8a82498b
Pipeline #23681 canceled with stages
......@@ -120,7 +120,9 @@ export async function getOpenAIAuth({
// login as well (optional)
if (email && password) {
await waitForConditionOrAtCapacity(page, () =>
page.waitForSelector('#__next .btn-primary', { timeout: timeoutMs })
page.waitForSelector('#__next button:first-child', {
timeout: timeoutMs
})
)
await delay(500)
......@@ -131,7 +133,7 @@ export async function getOpenAIAuth({
waitUntil: 'networkidle2',
timeout: timeoutMs
}),
page.click('#__next .btn-primary')
page.click('#__next button:first-child')
])
await delay(500)
} while (page.url().endsWith('/auth/login'))
......@@ -153,7 +155,7 @@ export async function getOpenAIAuth({
])
await page.waitForSelector('input[type="password"]', { visible: true })
await page.type('input[type="password"]', password)
await delay(50)
await delay(200)
submitP = () => page.keyboard.press('Enter')
} else if (isMicrosoftLogin) {
await page.click('button[data-provider="windowslive"]')
......@@ -166,7 +168,7 @@ export async function getOpenAIAuth({
await delay(1500)
await page.waitForSelector('input[type="password"]', { visible: true })
await page.type('input[type="password"]', password)
await delay(50)
await delay(200)
submitP = () => page.keyboard.press('Enter')
await Promise.all([
page.waitForNavigation(),
......@@ -204,16 +206,22 @@ export async function getOpenAIAuth({
await delay(2000)
const frame = page.mainFrame()
const submit = await page.waitForSelector('button[type="submit"]', {
const submit = await page.waitForSelector(
'button[type="submit"][data-action-button-primary="true"]',
{
timeout: timeoutMs
})
await frame.focus('button[type="submit"]')
}
)
await frame.focus(
'button[type="submit"][data-action-button-primary="true"]'
)
await submit.focus()
await submit.click()
await page.waitForSelector('#password', { timeout: timeoutMs })
await page.type('#password', password)
await delay(200)
submitP = () => page.click('button[type="submit"]')
submitP = () =>
page.click('button[type="submit"][data-action-button-primary="true"]')
}
await Promise.all([
......
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