import type { Page } from "@playwright/test";

export class RoleListPage {
  private page: Page;
  constructor(page: Page) {
    this.page = page;
  }

  async goto() {
    await this.page.goto("/user-management/role");
  }

  get heading() {
    return this.page.getByRole("heading", { name: /roles/i });
  }

  get createButton() {
    return this.page.getByRole("link", { name: /create/i });
  }

  get table() {
    return this.page.getByRole("table");
  }

  getRow(name: string) {
    return this.page.getByRole("row").filter({ hasText: name });
  }
}
