"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OCIdentityHomePage = void 0;
const test_1 = require("@playwright/test");
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
class OCIdentityHomePage {
    page;
    groupsTab;
    adminBanner;
    mappingRulesTab;
    tenantsTab;
    rolesTab;
    authorizationsTab;
    clusterVariablesTab;
    licenseKeyTagNonProduction;
    licenseKeyTagNonCommercial;
    licenseKeyTagProduction;
    licenseKeyTagCommercial;
    constructor(page) {
        this.page = page;
        this.adminBanner = page
            .locator('a')
            .filter({ hasText: /^Camunda logo\s*Admin$/ })
            .first();
        this.groupsTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: /^Groups$/ });
        this.mappingRulesTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: /^Mapping rules$/ })
            .first();
        this.tenantsTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: /^Tenants$/ });
        this.rolesTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: 'Roles' });
        this.authorizationsTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: /^Authorizations$/ });
        this.clusterVariablesTab = page
            .getByRole('banner')
            .locator('a')
            .filter({ hasText: /Cluster 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');
    }
    async clickMappingRulesTab() {
        await (0, test_1.expect)(this.mappingRulesTab).toBeVisible({ timeout: 30000 });
        await this.mappingRulesTab.click();
    }
    async clickTenantsTab() {
        await (0, test_1.expect)(this.tenantsTab).toBeVisible({ timeout: 30000 });
        await this.tenantsTab.click();
    }
    async clickAuthorizationsTab() {
        await (0, test_1.expect)(this.authorizationsTab).toBeVisible({ timeout: 30000 });
        await this.authorizationsTab.click();
    }
    async clickRolesTab() {
        await (0, test_1.expect)(this.rolesTab).toBeVisible({ timeout: 30000 });
        await this.rolesTab.click();
    }
    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;
