"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperateHomePage = void 0;
const test_1 = require("@playwright/test");
class OperateHomePage {
    page;
    operateBanner;
    processesTab;
    informationDialog;
    editVariableButton;
    variableValueInput;
    saveVariableButton;
    editVariableSpinner;
    constructor(page) {
        this.page = page;
        this.operateBanner = page.getByRole('link', { name: 'Camunda logo Operate' });
        this.processesTab = page.getByRole('link', { name: 'Processes' });
        this.informationDialog = page.getByRole('button', {
            name: 'Close this dialog',
        });
        this.editVariableButton = page.getByTestId('edit-variable-button');
        this.variableValueInput = page.getByTestId('edit-variable-value');
        this.saveVariableButton = page.getByLabel('Save variable');
        this.editVariableSpinner = page
            .getByTestId('variable-operation-spinner')
            .locator('circle')
            .nth(1);
    }
    async operateBannerIsVisible() {
        await (0, test_1.expect)(this.operateBanner).toBeVisible();
    }
    async clickProcessesTab() {
        await this.processesTab.click();
    }
    async clickEditVariableButton(variableName) {
        const editVariableButton = 'Edit variable ' + variableName;
        await this.page.getByLabel(editVariableButton).click();
    }
    async clickVariableValueInput() {
        await this.variableValueInput.click();
    }
    async clearVariableValueInput() {
        await this.variableValueInput.clear();
    }
    async fillVariableValueInput(value) {
        await this.variableValueInput.fill(value);
    }
    async clickSaveVariableButton() {
        await this.saveVariableButton.click();
    }
}
exports.OperateHomePage = OperateHomePage;
