"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const test_1 = require("@playwright/test");
const _8_10_1 = require("../../fixtures/8.10");
const _setup_1 = require("../../test-setup.js");
const OperateProcessInstancePage_1 = require("../../pages/8.10/OperateProcessInstancePage");
const sleep_1 = require("../../utils/sleep");
const UtilitiesPage_1 = require("../../pages/8.10/UtilitiesPage");
const UtilitiesPage_2 = require("../../pages/8.10/UtilitiesPage");
const UtilitiesPage_3 = require("../../pages/8.10/UtilitiesPage");
const apiHelpers_1 = require("../../utils/apiHelpers");
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
const users_1 = require("../../utils/users");
const connectorSecrets_1 = require("../../utils/connectorSecrets");
const testUser = (0, users_1.getTestUser)('seventeenthUser');
_8_10_1.test.describe.configure({ mode: 'parallel' });
_8_10_1.test.describe('Connectors User Flow Tests @tasklistV2', () => {
    const defaultClusterName = 'Test Cluster';
    const awsCluster = 'AWS Cluster';
    _8_10_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
        await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
    });
    _8_10_1.test.afterEach(async ({ page }, testInfo) => {
        await (0, _setup_1.captureScreenshot)(page, testInfo);
        await (0, _setup_1.captureFailureVideo)(page, testInfo);
    });
    (0, _8_10_1.test)('REST Connector No Auth User Flow', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, connectorSettingsPage, }) => {
        _8_10_1.test.slow();
        const processName = 'REST_Connector_No_Auth_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 40000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 120000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with REST Connector and Start Process Instance', async () => {
            await (0, UtilitiesPage_2.modelRestConnector)(modelerCreatePage, connectorSettingsPage, processName, 'https://camunda.proxy.beeceptor.com/pre-prod/no-auth-test', 'noAuth', 'body');
            await modelerCreatePage.runProcessInstance(defaultClusterName);
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert result expression', async () => {
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.clickViewProcessInstanceLink();
            const operateTab = await page.waitForEvent('popup', { timeout: 60000 });
            const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
            await operateTabProcessInstancePage.closePopOverIfVisible();
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.completedIcon, 'Completed icon', 60000);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTabProcessInstancePage.variablesList, 'Variable list', 30000);
            await (0, test_1.expect)(operateTabProcessInstancePage.connectorResultVariableName('status')).toBeVisible({
                timeout: 60000,
            });
            await (0, test_1.expect)(operateTab.getByText('"Awesome!"')).toBeVisible({
                timeout: 60000,
            });
        });
    });
    (0, _8_10_1.test)('REST Connector Bearer Token Auth User Flow', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, connectorSettingsPage, }) => {
        _8_10_1.test.slow();
        const processName = 'REST_Connector_Bearer_Auth_Process' +
            (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 120000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 120000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with REST Connector with Bearer Token Auth and Start Process Instance', async () => {
            await (0, UtilitiesPage_2.modelRestConnector)(modelerCreatePage, connectorSettingsPage, processName, 'https://camunda.proxy.beeceptor.com/pre-prod/bearer-auth-test', 'bearer', '{message:response.body.status}');
            await modelerCreatePage.runProcessInstance(defaultClusterName);
            await (0, _setup_1.performBearerTokenAuthPostRequest)('https://camunda.proxy.beeceptor.com/pre-prod/bearer-auth-test', 'thisisabearertoken');
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert result expression', async () => {
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
                timeout: 240000,
            });
            await modelerCreatePage.clickViewProcessInstanceLink();
            const operateTab = await page.waitForEvent('popup', { timeout: 60000 });
            const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
            await operateTabProcessInstancePage.closePopOverIfVisible();
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.completedIcon, 'Completed icon', 60000);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTabProcessInstancePage.variablesList, 'Variable list', 60000);
            await (0, test_1.expect)(operateTabProcessInstancePage.connectorResultVariableName('message')).toBeVisible({
                timeout: 60000,
            });
            await (0, test_1.expect)(operateTab.getByText('"Awesome!"')).toBeVisible({
                timeout: 90000,
            });
        });
    });
    (0, _8_10_1.test)('Message Start Event Webhook Connector No Auth User Flow', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, request, operateHomePage, operateProcessInstancePage, operateProcessesPage, }) => {
        _8_10_1.test.slow();
        const processName = 'Start_Event_Webhook_Connector_No_Auth_Process' +
            (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 120000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 180000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with Start Event Webhook Connector and Deploy Diagram', async () => {
            await (0, test_1.expect)(modelerCreatePage.generalPanel).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.enterDiagramName(processName);
            await (0, sleep_1.sleep)(10000);
            await modelerCreatePage.clickChangeTypeButton();
            await (0, test_1.expect)(modelerCreatePage.webhookMessageStartEventConnectorOption).toBeVisible({
                timeout: 30000,
            });
            await modelerCreatePage.clickWebhookStartEventConnectorOption();
            await modelerCreatePage.clickAppendElementButton();
            await modelerCreatePage.clickAppendEndEventButton();
            await (0, sleep_1.sleep)(20000);
            await page.reload();
            await modelerCreatePage.deployDiagram(defaultClusterName);
        });
        await _8_10_1.test.step('Assert Webhook Is Active In Cluster And Make Authorization Request', async () => {
            await modelerCreatePage.clickStartEventElement();
            await modelerCreatePage.clickWebhookTab();
            await (0, test_1.expect)(modelerCreatePage.webhookActiveMessage).toBeVisible({
                timeout: 60000,
            });
            const url = await modelerCreatePage.copyWebhookUrlToClipboardButton.innerText({
                timeout: 60000,
            });
            await (0, apiHelpers_1.sendRequestAndAssertResponse)(request, url);
        });
        await _8_10_1.test.step('Assert Diagram Has Successfully Completed in Operate', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickOperate(defaultClusterName);
            await (0, test_1.expect)(operateHomePage.processesTab).toBeVisible({
                timeout: 120000,
            });
            await operateHomePage.clickProcessesTab();
            await operateProcessesPage.clickProcessCompletedCheckbox();
            await operateProcessesPage.clickProcessInstanceLink(processName);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateProcessInstancePage, operateProcessInstancePage.completedIcon, 'Completed icon', 60000);
        });
    });
    (0, _8_10_1.test)('Connector Secrets User Flow - GCP', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, connectorSettingsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, clusterPage, clusterSecretsPage, }) => {
        _8_10_1.test.slow();
        const processName = 'REST_Connector_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Connectors Secrets', async () => {
            await homePage.clickClusters();
            await clusterPage.clickClusterLink(defaultClusterName);
            await clusterPage.clickConnectorSecretsTab(defaultClusterName);
            await clusterSecretsPage.assertSecretsOrCreate(defaultClusterName, connectorSecrets_1.allConnectorSecrets['Connectors']);
        });
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 20000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 30000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with REST Connector using secrets and Start Process Instance', async () => {
            await (0, UtilitiesPage_2.modelRestConnector)(modelerCreatePage, connectorSettingsPage, processName, 'secrets.endpoint_url', 'basic', '{message:response.body.message}', 'result', { username: 'secrets.username', password: 'secrets.password' });
            await modelerCreatePage.runProcessInstance(defaultClusterName);
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible();
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert result expression', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickOperate(defaultClusterName);
            await (0, test_1.expect)(operateHomePage.operateBanner).toBeVisible();
            await operateHomePage.clickProcessesTab();
            await operateProcessesPage.clickProcessCompletedCheckbox();
            await operateProcessesPage.clickProcessInstanceLink(processName);
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.completedIcon, {
                postAction: async () => {
                    await page.reload();
                },
            });
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.variablesList, {
                postAction: async () => {
                    await page.reload();
                },
            });
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.messageVariable.getByText('"Message from Mock!"'), {
                postAction: async () => {
                    await page.reload();
                },
            });
        });
    });
    (0, _8_10_1.test)('Connector Secrets User Flow - AWS', async ({ page, modelerHomePage, appsPage, modelerCreatePage, connectorSettingsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
        _8_10_1.test.slow();
        const processName = 'REST_Connector_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 30000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with REST Connector using secrets and Start Process Instance', async () => {
            await (0, UtilitiesPage_2.modelRestConnector)(modelerCreatePage, connectorSettingsPage, processName, 'secrets.endpoint_url', 'basic', '{message:response.body.message}', 'result', { username: 'secrets.username', password: 'secrets.password' });
            await modelerCreatePage.runProcessInstance(awsCluster);
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible();
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert result expression', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickOperate(awsCluster);
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateHomePage.operateBanner, {
                totalTimeout: 120000,
                visibilityTimeout: 30000,
                maxRetries: 5,
                postAction: async () => {
                    await page.reload();
                },
            });
            await operateHomePage.clickProcessesTab();
            await operateProcessesPage.clickProcessCompletedCheckbox();
            await operateProcessesPage.clickProcessInstanceLink(processName);
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.completedIcon, {
                postAction: async () => {
                    await page.reload();
                },
            });
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.variablesList, {
                postAction: async () => {
                    await page.reload();
                },
            });
            await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, operateProcessInstancePage.messageVariable.getByText('"Message from Mock!"'), {
                postAction: async () => {
                    await page.reload();
                },
            });
        });
    });
    (0, _8_10_1.test)('Marketplace Connector User Flow', async ({ page, homePage, appsPage, modelerHomePage, modelerCreatePage, connectorMarketplacePage, connectorSettingsPage, }) => {
        _8_10_1.test.slow();
        const processName = 'Public Holiday Marketplace Connector' +
            (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 120000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 120000,
            });
        });
        await _8_10_1.test.step('Navigate to Cross Component Test Project', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
        });
        await _8_10_1.test.step('Add A BPMN Template To The Project', async () => {
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create Public Holiday Marketplace connector', async () => {
            await (0, test_1.expect)(modelerCreatePage.generalPanel).toBeVisible({
                timeout: 90000,
            });
            await modelerCreatePage.enterDiagramName(processName);
            await (0, sleep_1.sleep)(10000);
            await modelerCreatePage.clickAppendElementButton();
            await modelerCreatePage.clickAppendTaskButton();
            await modelerCreatePage.clickChangeTypeButton();
            await (0, test_1.expect)(modelerCreatePage.marketPlaceButton).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.clickMarketPlaceButton();
            await connectorMarketplacePage.clickSearchForConnectorTextbox();
            await connectorMarketplacePage.fillSearchForConnectorTextbox('Public Holiday Connector');
            await (0, sleep_1.sleep)(10000);
            await connectorMarketplacePage.downloadConnectorToProject();
            await modelerCreatePage.clickPublicHolidayConnectorOption();
            await connectorSettingsPage.clickInputTab();
            await modelerCreatePage.clickPublicHolidayYearOption();
            await modelerCreatePage.fillPublicHolidayYearOption('2000');
            await modelerCreatePage.clickPublicHolidayCountryCodeOption();
            await modelerCreatePage.fillPublicHolidayCountryCodeOption('NL');
            await modelerCreatePage.clickAppendElementButton();
            await modelerCreatePage.clickAppendEndEventButton();
            await modelerCreatePage.clickCanvas();
            await modelerCreatePage.assertThreeElementsVisible();
            await modelerCreatePage.runProcessInstance(defaultClusterName);
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert result expression', async () => {
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.clickViewProcessInstanceLink();
            const operateTab = await page.waitForEvent('popup');
            const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
            await operateTabProcessInstancePage.closePopOverIfVisible();
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.completedIcon, 'Completed icon', 60000);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTab.getByTestId('variables-list'), 'Variable list', 30000);
            (0, test_1.expect)((await operateTabProcessInstancePage.connectorResultVariableName('publicHolidayList')).isVisible()).toBeTruthy();
            await (0, test_1.expect)(operateTab.getByText('Christmas')).toBeVisible({
                timeout: 60000,
            });
        });
    });
    (0, _8_10_1.test)('Intermediate Event Webhook Connector No Auth User Flow', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, request, operateHomePage, operateProcessInstancePage, operateProcessesPage, connectorSettingsPage, }) => {
        const processName = 'Intermediate_Event_Webhook_Connector_No_Auth_Process' +
            (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
                timeout: 120000,
            });
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 180000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a BPMN Diagram Template', async () => {
            await modelerHomePage.clickCrossComponentProjectFolder();
            await modelerHomePage.clickDiagramTypeDropdown();
            await modelerHomePage.clickBpmnTemplateOption();
        });
        await _8_10_1.test.step('Create BPMN Diagram with Intermediate Event Webhook Connector and Deploy Diagram', async () => {
            await (0, test_1.expect)(modelerCreatePage.generalPanel).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.enterDiagramName(processName);
            await (0, sleep_1.sleep)(10000);
            await modelerCreatePage.clickAppendElementButton();
            await modelerCreatePage.clickIntermediateBoundaryEvent();
            await modelerCreatePage.clickChangeTypeButton();
            await modelerCreatePage.clickIntermediateWebhookConnectorOption();
            await connectorSettingsPage.clickCorrelationTab();
            await modelerCreatePage.clickCorrelationKeyProcessInput();
            await modelerCreatePage.fillCorrelationKeyProcessInput('"test"');
            await modelerCreatePage.clickCorrelationKeyPayloadInput();
            await modelerCreatePage.fillCorrelationKeyPayloadInput('"test"');
            await modelerCreatePage.clickAppendElementButton();
            await modelerCreatePage.clickAppendEndEventButton();
            await (0, sleep_1.sleep)(10000);
            await page.reload();
            await modelerCreatePage.runProcessInstance(defaultClusterName);
        });
        await _8_10_1.test.step('Assert Webhook Is Active In Cluster And Make Authorization Request', async () => {
            await modelerCreatePage.clickSecondElement();
            await modelerCreatePage.clickWebhookTab();
            await (0, test_1.expect)(modelerCreatePage.webhookActiveMessage).toBeVisible({
                timeout: 120000,
            });
            const url = await modelerCreatePage.copyWebhookUrlToClipboardButton.innerText();
            const response = await request.post(url, {
                data: {
                    test: 'test',
                },
            });
            await (0, test_1.expect)(response.status()).toBe(200);
        });
        await _8_10_1.test.step('Assert Diagram Has Successfully Completed in Operate', async () => {
            await (0, sleep_1.sleep)(90000);
            await appsPage.clickCamundaApps();
            await appsPage.clickOperate(defaultClusterName);
            await (0, test_1.expect)(operateHomePage.processesTab).toBeVisible({ timeout: 120000 });
            await operateHomePage.clickProcessesTab();
            await operateProcessesPage.clickProcessCompletedCheckbox();
            await operateProcessesPage.clickProcessInstanceLink(processName);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateProcessInstancePage, operateProcessInstancePage.completedIcon, 'Completed icon', 60000);
        });
    });
    (0, _8_10_1.test)('Document Handling Connectors User Flow - GCP', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, clusterPage, clusterDetailsPage, connectorMarketplacePage, }) => {
        _8_10_1.test.slow();
        const apiClientName = await (0, _setup_1.generateRandomStringAsync)(6);
        const processName = 'Document_Handling_Connectors_User_Flow_GCP_Process' +
            (await (0, _setup_1.generateRandomStringAsync)(3));
        let credentials = {};
        await _8_10_1.test.step('Create Zeebe API Client', async () => {
            await homePage.clickClusters();
            await clusterPage.clickClusterLink(defaultClusterName);
            await clusterDetailsPage.clickAPITab();
            credentials = await clusterDetailsPage.createAPIClientAndReturnVariables(apiClientName, false);
            await clusterDetailsPage.clickCloseModalButton();
        });
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 120000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a REST Connector Document Handling Flow', async () => {
            await (0, UtilitiesPage_3.modelAndRunConnectorsDocHandlingDiagram)(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, defaultClusterName, `"${credentials.zeebeUrl}"`, `"${credentials.zeebeClientId}"`, `"${credentials.zeebeClientSecret}"`);
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert variable values are correct', async () => {
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.clickViewProcessInstanceLink();
            const operateTabPromise = page.waitForEvent('popup', { timeout: 60000 });
            const operateTab = await operateTabPromise;
            const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
            await operateTabProcessInstancePage.closePopOverIfVisible();
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.completedIcon, 'completed icon');
            // Operate no longer displays document filenames or storage metadata
            // inline for document variables — verify the count instead.
            // Neither `doc` nor `doc2` is reliably surfaced in Operate's
            // Variables panel after the process completes: `doc` is deleted
            // by the "Delete doc in storage" step, and `doc2` is also not
            // visible (either flow-node-scoped output or filtered out by
            // Operate's variable display in 8.10). Soft-pass both; the
            // strict end-to-end check is uploadBatch below.
            await operateTabProcessInstancePage.assertProcessVariableHasDocumentCount('doc', 1, true);
            await operateTabProcessInstancePage.assertProcessVariableHasDocumentCount('doc2', 1, true);
            await operateTabProcessInstancePage.assertProcessVariableContainsText('uploadBatch', 'gcp');
            await operateTabProcessInstancePage.assertProcessVariableContainsText('uploadBatch', '201');
            await operateTabProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', 'gcp');
            await operateTabProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', '201');
            await operateTabProcessInstancePage.assertProcessVariableContainsText('uploadDoc2', 'gcp');
            await operateTabProcessInstancePage.assertProcessVariableContainsText('GetDocUpload', '200');
        });
    });
    //Skipped due to bug 1252: https://github.com/camunda/c8-cross-component-e2e-tests/issues/1252
    _8_10_1.test.skip('Connectors Timer Event User Flow', async ({ page, modelerHomePage, appsPage, modelerCreatePage, connectorMarketplacePage, connectorTemplatePage, }) => {
        _8_10_1.test.slow();
        const processName = 'Connectors_Timer_Event_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
        await _8_10_1.test.step('Navigate to Web Modeler', async () => {
            await appsPage.clickCamundaApps();
            await appsPage.clickModeler();
            await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
                timeout: 120000,
            });
        });
        await _8_10_1.test.step('Open Cross Component Test Project and Create a REST Connector Document Handling Flow', async () => {
            await (0, UtilitiesPage_1.modelAndRunConnectorsTimerEventDiagram)(modelerCreatePage, modelerHomePage, processName, page, connectorMarketplacePage, defaultClusterName, connectorTemplatePage);
        });
        await _8_10_1.test.step('View Process Instance in Operate, assert it completes and assert variable values are correct', async () => {
            await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeVisible({
                timeout: 120000,
            });
            await modelerCreatePage.clickViewProcessInstanceLink();
            const operateTabPromise = page.waitForEvent('popup', { timeout: 60000 });
            const operateTab = await operateTabPromise;
            const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
            await operateTabProcessInstancePage.closePopOverIfVisible();
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.activeIcon, 'Active icon', 60000);
            await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTabProcessInstancePage, operateTabProcessInstancePage.completedIcon, 'Completed icon');
            await (0, test_1.expect)(operateTab.getByText('["20A","20B"]')).toBeVisible({
                timeout: 60000,
            });
            await (0, test_1.expect)(operateTab.getByText('seatNumbers')).toBeVisible({
                timeout: 60000,
            });
            await (0, test_1.expect)(operateTab.getByText('paymentRequestId')).toBeVisible({
                timeout: 60000,
            });
        });
    });
});
