Skip to content

Commit 2c69a57

Browse files
hgw77andypf
andauthored
fix(playwright): fix changed login path (#891)
* fix(playwright): fix changed login path * chore(playwright): simplify comments * fix(playwright): remove redundant login verification step --------- Co-authored-by: Andreas Pfau <andreas.pfau@sap.com>
1 parent 641c699 commit 2c69a57

3 files changed

Lines changed: 10 additions & 37 deletions

File tree

apps/dashboard/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ IMAGE_METADATA_EXCLUDED_PROPERTIES="name,tags,visibility,protected,min_disk,min_
1313
INSECURE_COOKIES=true
1414

1515
# E2E tests
16-
PLAYWRIGHT_BASE_URL="http://localhost:4500"
16+
PLAYWRIGHT_BASE_URL="http://localhost:4001"
1717
TEST_DOMAIN="default"
1818
TEST_PROJECT="demo"
1919
TEST_MEMBER_USER="admin"

apps/dashboard/e2e/helpers/auth.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function auroraLogin(page: Page, domain: string, username: string, passwor
5757
const errors = setupErrorTracking(page)
5858

5959
// Navigate to login page
60-
await page.goto("/auth/login")
60+
await page.goto("/")
6161

6262
// Fill in credentials
6363
await page.fill("input#domain", domain)
@@ -70,11 +70,5 @@ async function auroraLogin(page: Page, domain: string, username: string, passwor
7070
// Wait for redirect to projects page after successful login
7171
await page.waitForURL("/projects", { timeout: 10000 })
7272

73-
// Verify we're logged in by checking we're not on login page
74-
const currentUrl = page.url()
75-
if (currentUrl.includes("/auth/login")) {
76-
throw new Error("Login failed: Still on login page")
77-
}
78-
7973
return errors
8074
}

apps/dashboard/e2e/smoke/unauthenticated.spec.ts

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import {
1515
* Run with: pnpm test:e2e e2e/smoke/unauthenticated.spec.ts
1616
*/
1717
test.describe("Unauthenticated Routes", () => {
18-
test("landing page loads without errors", async ({ page }) => {
18+
test("login page loads without errors", async ({ page }) => {
1919
// Set up error tracking BEFORE navigation
2020
const errors = setupErrorTracking(page)
2121

22-
// Navigate to landing page
22+
// Navigate to login page
2323
await page.goto("/")
2424

2525
// Wait for page to load
@@ -28,12 +28,11 @@ test.describe("Unauthenticated Routes", () => {
2828
// Verify no JavaScript errors
2929
await expectNoJavaScriptErrors(errors, page)
3030

31-
// Verify key elements are present
32-
await expectElementVisible(page, "h1")
33-
await expect(page.locator("h1")).toContainText("Aurora")
34-
35-
// Verify "Enter the Cloud" button exists
36-
await expectElementVisible(page, 'button:has-text("Enter the Cloud")')
31+
// Verify login form elements are present
32+
await expectElementVisible(page, "input#domain")
33+
await expectElementVisible(page, "input#user")
34+
await expectElementVisible(page, "input#password")
35+
await expectElementVisible(page, 'button:has-text("Sign In")')
3736
})
3837

3938
test("about page loads without errors", async ({ page }) => {
@@ -53,32 +52,12 @@ test.describe("Unauthenticated Routes", () => {
5352
await expect(page.locator("body")).not.toBeEmpty()
5453
})
5554

56-
test("login page loads without errors", async ({ page }) => {
57-
// Set up error tracking BEFORE navigation
58-
const errors = setupErrorTracking(page)
59-
60-
// Navigate to login page
61-
await page.goto("/auth/login")
62-
63-
// Wait for page to load
64-
await expectPageLoaded(page)
65-
66-
// Verify no JavaScript errors
67-
await expectNoJavaScriptErrors(errors, page)
68-
69-
// Verify login form elements are present
70-
await expectElementVisible(page, "input#domain")
71-
await expectElementVisible(page, "input#user")
72-
await expectElementVisible(page, "input#password")
73-
await expectElementVisible(page, 'button:has-text("Sign In")')
74-
})
75-
7655
test("protected route redirects to login", async ({ page }) => {
7756
// Try to access accounts page (protected route)
7857
await page.goto("/accounts")
7958

8059
// Should redirect to login
81-
await page.waitForURL("**/auth/login**", { timeout: 10000 })
60+
await page.waitForURL("**/?redirect=**", { timeout: 10000 })
8261

8362
// Verify we're on login page by checking form elements
8463
await expectElementVisible(page, "input#domain")

0 commit comments

Comments
 (0)