"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsoleOrganizationPage = void 0;
class ConsoleOrganizationPage {
    page;
    usersTab;
    optionsButton;
    editUserMenuItem;
    operationsEngineerCheckbox;
    developerCheckbox;
    analystCheckbox;
    confirmButton;
    constructor(page) {
        this.page = page;
        this.usersTab = page.getByRole('tab', { name: 'Users' });
        this.optionsButton = page.getByRole('button', { name: 'Options' });
        this.editUserMenuItem = page.getByRole('menuitem', { name: 'Edit User' });
        this.operationsEngineerCheckbox = page
            .getByRole('group')
            .locator('label')
            .filter({ hasText: 'Operations Engineer' });
        this.developerCheckbox = page
            .getByRole('group')
            .locator('label')
            .filter({ hasText: 'Developer' });
        this.analystCheckbox = page
            .getByRole('group')
            .locator('label')
            .filter({ hasText: 'Analyst' });
        this.confirmButton = page.getByRole('button', { name: 'Confirm' });
    }
    async clickUsersTab() {
        await this.usersTab.click();
    }
    async clickOptionsButton() {
        await this.optionsButton.click();
    }
    async clickEditUserMenuItem() {
        await this.editUserMenuItem.click();
    }
    async clickOperationsEngineerCheckbox() {
        await this.operationsEngineerCheckbox.click();
    }
    async checkDeveloperCheckbox() {
        if (!(await this.developerCheckbox.isChecked())) {
            await this.developerCheckbox.click();
        }
    }
    async uncheckDeveloperCheckbox() {
        if (await this.developerCheckbox.isChecked()) {
            await this.developerCheckbox.click();
        }
    }
    async checkAnalystCheckbox() {
        if (!(await this.analystCheckbox.isChecked())) {
            await this.analystCheckbox.click();
        }
    }
    async uncheckAnalystCheckbox() {
        if (await this.analystCheckbox.isChecked()) {
            await this.analystCheckbox.click();
        }
    }
    async clickConfirmButton() {
        await this.confirmButton.click();
    }
}
exports.ConsoleOrganizationPage = ConsoleOrganizationPage;
