import { Page, Locator } from "@playwright/test" export class ViewRolesPage { readonly page: Page readonly primaryTitle: Locator readonly secondaryTitle: Locator readonly nameColumnTitle: Locator readonly descriptionColumnTitle: Locator constructor(page: Page) { this.page = page; this.primaryTitle = page.getByRole('heading', { name: 'Access control management' }); this.secondaryTitle = page.getByRole('heading', { name: 'Manage roles' }); this.nameColumnTitle = this.page.getByRole('button', { name: 'Name' }) this.descriptionColumnTitle = this.page.getByRole('button', { name: 'Description' }) } async getPrimaryTitle() { try { return await this.primaryTitle.innerText(); } catch (error) { console.error("Failed to get primary title:", error); throw error; } } async getSecondaryTitle() { try { return await this.secondaryTitle.innerText(); } catch (error) { console.error("Failed to get secondary title:", error); throw error; } } }