"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HomePage = void 0;
class HomePage {
    page;
    dashboardTab;
    clusterTab;
    organizationTab;
    organizationViewTitle;
    welcomeMessage;
    informationDialog;
    camundaAppsButton;
    camundaComponentsButton;
    constructor(page) {
        this.page = page;
        this.dashboardTab = page.getByRole('link', { name: 'Dashboard' });
        this.clusterTab = page.getByRole('link', { name: 'Clusters' });
        this.organizationTab = page.getByRole('link', { name: 'Organization' });
        this.organizationViewTitle = page.getByText('Organization Management');
        this.welcomeMessage = page.getByText('Welcome, demo').first();
        this.informationDialog = page.getByRole('button', {
            name: 'Close this dialog',
        });
        this.camundaComponentsButton = page.getByLabel('Camunda components');
        this.camundaAppsButton = page.getByLabel('Camunda apps');
    }
    async clickClusters() {
        await this.clusterTab.click({ timeout: 90000 });
    }
    async clickDashboard() {
        await this.dashboardTab.click({ timeout: 90000 });
    }
    async clickOrganization() {
        await this.organizationTab.click({ timeout: 90000 });
    }
    async closeInformationDialog() {
        const isLocalTest = process.env.LOCAL_TEST;
        if (isLocalTest) {
            await this.informationDialog.click();
        }
    }
    async clickCamundaComponents() {
        await this.camundaComponentsButton.click({ timeout: 90000 });
    }
    async clickCamundaApps() {
        await this.camundaAppsButton.click({ timeout: 90000 });
    }
}
exports.HomePage = HomePage;
