mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
test(infra): update Homarr E2E spec to navigate directly to /auth/login
Build: 0 jobs, 0 errors (lake build)
This commit is contained in:
parent
3339db58a7
commit
002b88c240
1 changed files with 17 additions and 15 deletions
|
|
@ -49,24 +49,26 @@ test('Verify Homarr configured apps via SSO', async ({ page }) => {
|
|||
}
|
||||
}
|
||||
|
||||
// Land on Homarr. If we see a "Login" link, click it to authenticate to Homarr itself
|
||||
const loginLink = page.locator('a[href="/auth/login"], a:has-text("Login")').first();
|
||||
if (await loginLink.isVisible({ timeout: 5000 }).catch(() => false)) {
|
||||
console.log('Homarr login link visible. Clicking it to authenticate NextAuth...');
|
||||
await loginLink.click();
|
||||
await page.waitForTimeout(6000);
|
||||
|
||||
// If Authentik consent/authorization screen appears after clicking login
|
||||
if (page.url().includes('consent') || page.url().includes('authorize') || page.url().includes('application/o/authorize')) {
|
||||
console.log('Consent/Authorization screen detected after Homarr login. Clicking continue...');
|
||||
const continueBtn = page.locator('button:has-text("Continue"), input[type="submit"], button[type="submit"]').first();
|
||||
if (await continueBtn.isVisible()) {
|
||||
await continueBtn.click();
|
||||
await page.waitForTimeout(6000);
|
||||
}
|
||||
// Force NextAuth OIDC authentication by navigating to the login URL
|
||||
console.log('Navigating directly to /auth/login to trigger OIDC session sync...');
|
||||
await page.goto('https://researchstack.info/auth/login');
|
||||
await page.waitForTimeout(6000);
|
||||
|
||||
// If Authentik consent/authorization screen appears after navigating to login
|
||||
if (page.url().includes('consent') || page.url().includes('authorize') || page.url().includes('application/o/authorize')) {
|
||||
console.log('Consent/Authorization screen detected. Clicking continue...');
|
||||
const continueBtn = page.locator('button:has-text("Continue"), input[type="submit"], button[type="submit"]').first();
|
||||
if (await continueBtn.isVisible({ timeout: 5000 }).catch(() => false)) {
|
||||
await continueBtn.click();
|
||||
await page.waitForTimeout(6000);
|
||||
}
|
||||
}
|
||||
|
||||
// Navigate back to the home board
|
||||
console.log('Navigating back to home board...');
|
||||
await page.goto('https://researchstack.info/');
|
||||
await page.waitForTimeout(6000);
|
||||
|
||||
const title = await page.title();
|
||||
console.log('Final Page Title:', title);
|
||||
console.log('Final URL:', page.url());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue