"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const SM_8_10_1 = require("../../fixtures/SM-8.10");
const _setup_1 = require("../../test-setup.js");
const test_1 = require("@playwright/test");
SM_8_10_1.test.describe.configure({ mode: 'parallel' });
SM_8_10_1.test.describe('Console User Flow Tests', () => {
    const defaultTags = ['dev', 'custom', 'stage', 'prod', 'test'];
    const customPropertyDescription = 'This is the main integration environment for the Camunda Platform.';
    SM_8_10_1.test.beforeEach(async ({ navigationPage }, testInfo) => {
        await navigationPage.goToConsole((testInfo.workerIndex + 1) * 1000);
    });
    SM_8_10_1.test.afterEach(async ({ page }, testInfo) => {
        await (0, _setup_1.captureScreenshot)(page, testInfo);
        await (0, _setup_1.captureFailureVideo)(page, testInfo);
    });
    (0, SM_8_10_1.test)('Custom Tags', async ({ consoleHomePage, clusterPage }) => {
        await SM_8_10_1.test.step('Navigate to Clusters', async () => {
            await consoleHomePage.clickClusters();
        });
        await SM_8_10_1.test.step('Ensure Custom Tags Appear in Clusters', async () => {
            await clusterPage.assertCustomTagsAreVisible(defaultTags);
        });
        await SM_8_10_1.test.step('Ensure Custom Tags Appear in Cluster Details', async () => {
            await clusterPage.clickClusterLink();
            await clusterPage.assertCustomTagsAreVisible(defaultTags);
        });
    });
    (0, SM_8_10_1.test)('Custom Properties', async ({ consoleHomePage, clusterPage, clusterDetailsPage, page, }) => {
        await SM_8_10_1.test.step('Navigate to Cluster Details', async () => {
            await consoleHomePage.clickClusters();
            await clusterPage.clickClusterLink();
        });
        await SM_8_10_1.test.step('Ensure Custom Properties Appear in Console and Navigates Links', async () => {
            await (0, test_1.expect)(clusterDetailsPage.customPropertiesHeading).toBeVisible({
                timeout: 60000,
            });
            await (0, test_1.expect)(page.getByText(customPropertyDescription)).toBeVisible({
                timeout: 60000,
            });
            await clusterDetailsPage.assertCustomPropertyIsNavigated('Link 1', 'Camunda', /^https:\/\/(www\.)?camunda\.com\/?$/);
            await clusterDetailsPage.assertCustomPropertyIsNavigated('Link 2', 'Camunda Docs', 'https://docs.camunda.io');
        });
    });
    (0, SM_8_10_1.test)('Default License Key User Flow', async ({ navigationPage, managementIdentityPage, ocIdentityHomePage, modelerHomePage, taskPanelPage, operateHomePage, optimizeHomePage, consoleHomePage, }) => {
        await SM_8_10_1.test.step('Assert Console License Key Tag', async () => {
            await (0, test_1.expect)(consoleHomePage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert Management Identity License Key Tag', async () => {
            await navigationPage.goToManagementIdentity();
            await (0, test_1.expect)(managementIdentityPage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert OC Identity License Key Tag', async () => {
            await navigationPage.goToOCAdmin();
            await (0, test_1.expect)(ocIdentityHomePage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert Web Modeler License Key Tag', async () => {
            await navigationPage.goToModeler();
            await (0, test_1.expect)(modelerHomePage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert Tasklist License Key Tag', async () => {
            await navigationPage.goToTasklist();
            await (0, test_1.expect)(taskPanelPage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert Operate License Key Tag', async () => {
            await navigationPage.goToOperate();
            await (0, test_1.expect)(operateHomePage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
        await SM_8_10_1.test.step('Assert Optimize License Key Tag', async () => {
            await navigationPage.goToOptimize();
            await (0, test_1.expect)(optimizeHomePage.licenseKeyTagNonProduction).toBeVisible({
                timeout: 60000,
            });
        });
    });
});
