Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Ziaei committed Mar 30, 2024
1 parent 77dabe3 commit 8dc5ea7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion apps/app/src/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './env'
import { router } from './routes'

const { port } = Bun.serve({
port: process.env.PORT || 3000,
port: process.env.PORT,
development: process.env.NODE_ENV !== 'production',
fetch(req) {
return router.match(req)
Expand Down
22 changes: 7 additions & 15 deletions apps/app/tests/e2e/instagram-auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,22 @@ const authFile = 'mnt/auth.json'

setup('authenticate instagram', async ({ page }) => {
await page.goto('https://www.instagram.com/')
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 */
const declineCookies = page.getByRole('button', {
name: 'Decline optional cookies',
})
if (await declineCookies.isVisible()) {
await declineCookies.click()
}
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()
try {
await expect(page.getByText('Save your login info?')).toBeVisible()
if (await page.getByText('Save your login info?').isVisible()) {
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,
})
if (await page.getByText('Turn on Notifications').isVisible()) {
await page.getByRole('button', { name: 'Not Now' }).click()
} catch {
/** no need to handle */
}
await expect(page.getByRole('link', { name: 'Home Home' })).toBeVisible()
await page.context().storageState({ path: authFile })
Expand Down
2 changes: 1 addition & 1 deletion apps/app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"include": ["src/**/*.ts"],
"include": ["**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 8dc5ea7

Please sign in to comment.