diff --git a/ui/tests/base-page.ts b/ui/tests/base-page.ts index a31f84c7ad..c9b73f2b1a 100644 --- a/ui/tests/base-page.ts +++ b/ui/tests/base-page.ts @@ -18,7 +18,7 @@ export abstract class BasePage { // Common locators that most pages share this.title = page.locator("h1, h2, [role='heading']").first(); this.loadingIndicator = page.getByRole("status", { name: "Loading" }); - this.themeToggle = page.getByLabel("Toggle theme"); + this.themeToggle = page.getByRole("button", { name: "Toggle theme" }); } // Common navigation methods diff --git a/ui/tests/home/home-page.ts b/ui/tests/home/home-page.ts index 0ae8312481..e696e02ab5 100644 --- a/ui/tests/home/home-page.ts +++ b/ui/tests/home/home-page.ts @@ -25,7 +25,7 @@ export class HomePage extends BasePage { // Main content elements this.mainContent = page.locator("main"); - this.breadcrumbs = page.getByLabel("Breadcrumbs"); + this.breadcrumbs = page.getByRole("navigation", { name: "Breadcrumbs" }); this.overviewHeading = page.getByRole("heading", { name: "Overview", exact: true }); // Navigation elements diff --git a/ui/tests/sign-in/sign-in-page.ts b/ui/tests/sign-in/sign-in-page.ts index 5c426779b6..a694359422 100644 --- a/ui/tests/sign-in/sign-in-page.ts +++ b/ui/tests/sign-in/sign-in-page.ts @@ -45,8 +45,8 @@ export class SignInPage extends BasePage { this.homePage = new HomePage(page); // Form elements - this.emailInput = page.getByLabel("Email"); - this.passwordInput = page.getByLabel("Password"); + this.emailInput = page.getByRole("textbox", { name: "Email" }); + this.passwordInput = page.getByRole("textbox", { name: "Password" }); this.loginButton = page.getByRole("button", { name: "Log in" }); this.form = page.locator("form"); @@ -67,7 +67,7 @@ export class SignInPage extends BasePage { // SAML specific elements this.samlModeTitle = page.getByRole("heading", { name: "Sign in with SAML SSO" }); - this.samlEmailInput = page.getByLabel("Email"); + this.samlEmailInput = page.getByRole("textbox", { name: "Email" }); } // Navigation methods diff --git a/ui/tests/sign-up/sign-up-page.ts b/ui/tests/sign-up/sign-up-page.ts index 52027279d3..30d8f4d50d 100644 --- a/ui/tests/sign-up/sign-up-page.ts +++ b/ui/tests/sign-up/sign-up-page.ts @@ -32,7 +32,7 @@ export class SignUpPage extends BasePage { // Prefer stable name attributes to avoid label ambiguity in composed inputs this.nameInput = page.locator('input[name="name"]'); this.companyInput = page.locator('input[name="company"]'); - this.emailInput = page.getByLabel("Email"); + this.emailInput = page.getByRole("textbox", { name: "Email" }); this.passwordInput = page.locator('input[name="password"]'); this.confirmPasswordInput = page.locator('input[name="confirmPassword"]'); this.invitationTokenInput = page.locator('input[name="invitationToken"]');