mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 04:53:10 +00:00
style(OPS30): prettier — formatação do login retry no fixture
This commit is contained in:
parent
48088d8162
commit
39e6e9405c
1 changed files with 2 additions and 5 deletions
|
|
@ -633,8 +633,7 @@ export const campaignFixture: CampaignE2EFixtureValue = async ({}, runFixture) =
|
||||||
// crisp wait error, not a generic test timeout. A second failure
|
// crisp wait error, not a generic test timeout. A second failure
|
||||||
// surfaces — wrong credentials fail both attempts.
|
// surfaces — wrong credentials fail both attempts.
|
||||||
const dashboardURL = `${baseURL}/campanha`
|
const dashboardURL = `${baseURL}/campanha`
|
||||||
const onDashboard = (url: string) =>
|
const onDashboard = (url: string) => url === dashboardURL || url === `${dashboardURL}/`
|
||||||
url === dashboardURL || url === `${dashboardURL}/`
|
|
||||||
const submitLogin = async () => {
|
const submitLogin = async () => {
|
||||||
await page.getByLabel('E-mail ou celular').fill(identifier)
|
await page.getByLabel('E-mail ou celular').fill(identifier)
|
||||||
await page.getByLabel('Senha').fill(password)
|
await page.getByLabel('Senha').fill(password)
|
||||||
|
|
@ -653,9 +652,7 @@ export const campaignFixture: CampaignE2EFixtureValue = async ({}, runFixture) =
|
||||||
const current = page.url()
|
const current = page.url()
|
||||||
if (onDashboard(current)) return
|
if (onDashboard(current)) return
|
||||||
if (!current.startsWith(`${baseURL}/campanha/login`)) {
|
if (!current.startsWith(`${baseURL}/campanha/login`)) {
|
||||||
throw new Error(
|
throw new Error(`Login retry aborted: page left the login screen (${current}).`)
|
||||||
`Login retry aborted: page left the login screen (${current}).`,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
await submitLogin()
|
await submitLogin()
|
||||||
await page.waitForURL(dashboardURL, { timeout: 30_000 })
|
await page.waitForURL(dashboardURL, { timeout: 30_000 })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue