"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterPage = void 0;
const test_1 = require("@playwright/test");
class ClusterPage {
    page;
    clustersList;
    defaultClusterName = process.env.CLUSTER_NAME || 'integration';
    cluster;
    constructor(page) {
        this.page = page;
        this.clustersList = page
            .getByRole('row')
            .filter({ hasNotText: 'Generation' }); //Filter out header row
        this.cluster = this.clustersList.getByText(this.defaultClusterName).first();
    }
    async clickClusterLink() {
        await (0, test_1.expect)(this.cluster).toBeVisible({ timeout: 60000 });
        await this.cluster.click({ timeout: 30000 });
        await (0, test_1.expect)(this.page.getByText('Cluster details').first()).toBeVisible({
            timeout: 10000,
        });
    }
    async assertCustomTagsAreVisible(tags) {
        await this.page.waitForLoadState('networkidle');
        for (const tag of tags) {
            await (0, test_1.expect)(this.clustersList.getByText(tag, { exact: true })).toBeVisible({
                timeout: 60000,
            });
        }
    }
}
exports.ClusterPage = ClusterPage;
