"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaskProcessesPage = void 0;
const test_1 = require("@playwright/test");
class TaskProcessesPage {
    page;
    popupContinueButton;
    popup;
    processes;
    constructor(page) {
        this.page = page;
        this.popupContinueButton = page.getByRole('button', { name: 'Continue' });
        this.popup = page.getByLabel('Start your process on demand');
        this.processes = page.locator('[data-testid="process-tile"]');
    }
    async clickpopupContinueButton() {
        try {
            await this.popupContinueButton.click({ timeout: 60000 });
        }
        catch (error) {
            console.log('Popup not present');
        }
    }
    async startProcess(name) {
        await this.processes
            .filter({ hasText: name })
            .nth(0)
            .getByRole('button', { name: 'Start process' })
            .click({ timeout: 60000 });
        await (0, test_1.expect)(this.page.getByText('Waiting for tasks...')).not.toBeVisible({
            timeout: 60000,
        });
    }
}
exports.TaskProcessesPage = TaskProcessesPage;
