"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OCIdentityHomePage = void 0;
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
class OCIdentityHomePage {
    page;
    groupsTab;
    adminBanner;
    rolesTab;
    authorizationsTab;
    clusterVariablesTab;
    licenseKeyTagNonProduction;
    licenseKeyTagNonCommercial;
    licenseKeyTagProduction;
    licenseKeyTagCommercial;
    noPermissionsMessage;
    constructor(page) {
        this.page = page;
        this.adminBanner = page.getByRole('link', {
            name: 'Camunda logo Admin',
        });
        this.groupsTab = page
            .getByRole('banner')
            .getByLabel('Admin')
            .locator('a')
            .filter({ hasText: 'Groups' });
        this.rolesTab = page
            .getByRole('banner')
            .getByLabel('Admin')
            .locator('a')
            .filter({ hasText: 'Roles' });
        this.authorizationsTab = page
            .getByRole('banner')
            .getByLabel('Admin')
            .locator('a')
            .filter({ hasText: /^Authorizations$/ });
        this.clusterVariablesTab = page
            .getByRole('banner')
            .getByLabel('Admin')
            .locator('a')
            .filter({ hasText: /Cluster variables/i })
            .or(page
            .getByRole('banner')
            .getByLabel('Admin')
            .locator('a')
            .filter({ hasText: /Variables/i }));
        this.licenseKeyTagNonProduction = page
            .getByText('Non-production license')
            .first();
        this.licenseKeyTagNonCommercial = page.getByText('Non-commercial license');
        this.licenseKeyTagProduction = page.getByText('Production license').first();
        this.licenseKeyTagCommercial = page.getByText('Commercial license');
        this.noPermissionsMessage = page.getByText('You don’t have access to this component');
    }
    async clickAuthorizationsTab() {
        await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.authorizationsTab);
        await this.authorizationsTab.click({ timeout: 30000 });
    }
    async clickRolesTab() {
        await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.rolesTab);
        await this.rolesTab.click({ timeout: 30000 });
    }
    async clickGroupsTab() {
        await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.groupsTab);
        await this.groupsTab.click({ timeout: 30000 });
    }
    async clickClusterVariablesTab() {
        await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.clusterVariablesTab);
        await this.clusterVariablesTab.click({ timeout: 30000 });
    }
}
exports.OCIdentityHomePage = OCIdentityHomePage;
