"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OptimizeHomePage = void 0;
class OptimizeHomePage {
    page;
    collectionsLink;
    dashboardLink;
    modalCloseButton;
    optimizeBanner;
    constructor(page) {
        this.page = page;
        this.collectionsLink = page
            .getByRole('banner')
            .getByRole('link', { name: 'Collections' });
        this.dashboardLink = page.getByRole('link', { name: 'Dashboard' });
        this.modalCloseButton = page.locator('button').filter({ hasText: /^Close$/ });
        this.optimizeBanner = page.getByRole('link', {
            name: 'Camunda logo Optimize',
        });
    }
    async clickCollectionsLink() {
        if (await this.modalCloseButton.isVisible({ timeout: 60000 })) {
            this.modalCloseButton.click();
        }
        await this.collectionsLink.click({ timeout: 60000 });
    }
    async clickDashboardLink() {
        if (await this.modalCloseButton.isVisible({ timeout: 60000 })) {
            await this.modalCloseButton.click({ timeout: 30000 });
        }
        await this.dashboardLink.click({ timeout: 30000 });
    }
}
exports.OptimizeHomePage = OptimizeHomePage;
