Skip to content

armgit / lyftr

Public Imported from GitHub
0

Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.

fix: auth setup waitForURL fails in CI on localhost:80

Cawlumm23e6a8b66d35
diff --git a/web/e2e/auth.setup.ts b/web/e2e/auth.setup.ts
index 62e0e81..e668ed5 100644
--- a/web/e2e/auth.setup.ts
+++ b/web/e2e/auth.setup.ts
@@ -11,7 +11,7 @@ setup('authenticate', async ({ page }) => {
await page.getByPlaceholder('[email protected]').fill(TEST_EMAIL)
await page.locator('input[type="password"]').fill(TEST_PASSWORD)
await page.getByRole('button', { name: /sign in|log in/i }).click()
- await page.waitForURL('/')
+ await page.waitForURL(url => new URL(url).pathname === '/')
await expect(page.locator('h1, h2').first()).toBeVisible()
await page.context().storageState({ path: authFile })
})
diff --git a/web/playwright.config.ts b/web/playwright.config.ts
index e814c0b..4458202 100644
--- a/web/playwright.config.ts
+++ b/web/playwright.config.ts
@@ -9,9 +9,9 @@ function dockerBaseURL(): string {
const env = readFileSync(resolve(__dirname, '../.env'), 'utf8')
const match = env.match(/^PORT=(\d+)/m)
const port = match?.[1] ?? '80'
- return `http://localhost:${port}`
+ return port === '80' ? 'http://localhost' : `http://localhost:${port}`
} catch {
- return 'http://localhost:80'
+ return 'http://localhost'
}
}