Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Ziaei committed Mar 27, 2024
1 parent 7ef3ada commit 3edb265
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/e2e/instagram-auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ const authFile = 'mnt/auth.json'

setup('authenticate instagram', async ({ page }) => {
await page.goto('https://www.instagram.com/')
// await page
// .getByRole('button', { name: 'Decline optional cookies' })
// .click()
// .catch(() => {})
try {
await expect(page.getByText('Allow the use of cookies from')).toBeVisible()
await page.getByRole('button', { name: 'Decline optional cookies' }).click()
} catch {
/** no need to handle */
}
await page
.getByLabel('Phone number, username, or')
.fill(process.env.IG_USERNAME)
await page.getByLabel('Password').fill(process.env.IG_PASSWORD)
await page.getByRole('button', { name: 'Log in', exact: true }).click()
await page.getByRole('button', { name: 'Save info' }).click()
try {
await expect(page.getByText('Save your login info?')).toBeVisible()
await page.getByRole('button', { name: 'Save info' }).click()
} catch {
/** no need to handle */
}
try {
await expect(page.getByText('Turn on Notifications')).toBeVisible({
timeout: 10_000,
})
await page.getByRole('button', { name: 'Not Now' }).click()
console.log('sendDirectToThread: Turned off notifications')
} catch {
/** no need to handle */
}
Expand Down

0 comments on commit 3edb265

Please sign in to comment.