"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectorTemplatePage = void 0;
const test_1 = require("@playwright/test");
class ConnectorTemplatePage {
    page;
    publishToOrgButton;
    publishButton;
    constructor(page) {
        this.page = page;
        this.publishButton = page.getByRole('button', {
            name: 'Publish',
            exact: true,
        });
        this.publishToOrgButton = page.locator('[data-test="publish-to-org"]');
    }
    async clickPublishToOrgButton() {
        await this.publishToOrgButton.click({ timeout: 90000 });
    }
    async clickPublishButton() {
        await this.publishButton.click({ timeout: 90000 });
    }
    async publishConnector() {
        try {
            await (0, test_1.expect)(this.publishToOrgButton).toBeVisible({ timeout: 15000 });
        }
        catch (error) {
            return;
        }
        await this.clickPublishToOrgButton();
        await this.clickPublishButton();
    }
}
exports.ConnectorTemplatePage = ConnectorTemplatePage;
