"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.test = void 0;
const test_1 = require("@playwright/test");
const playwright_1 = __importDefault(require("@axe-core/playwright"));
const LoginPage_1 = require("../pages/SM-8.7/LoginPage");
const HomePage_1 = require("../pages/SM-8.7/HomePage");
const ClusterPage_1 = require("../pages/SM-8.7/ClusterPage");
const ClusterDetailsPage_1 = require("../pages/SM-8.7/ClusterDetailsPage");
const NavigationPage_1 = require("../pages/SM-8.7/NavigationPage");
const ModelerHomePage_1 = require("../pages/SM-8.7/ModelerHomePage");
const ModelerCreatePage_1 = require("../pages/SM-8.7/ModelerCreatePage");
const PlayPage_1 = require("../pages/SM-8.7/PlayPage");
const TaskPanelPage_1 = require("../pages/SM-8.7/TaskPanelPage");
const TaskDetailsPage_1 = require("../pages/SM-8.7/TaskDetailsPage");
const OperateHomePage_1 = require("../pages/SM-8.7/OperateHomePage");
const OperateProcessesPage_1 = require("../pages/SM-8.7/OperateProcessesPage");
const OperateProcessInstancePage_1 = require("../pages/SM-8.7/OperateProcessInstancePage");
const OptimizeCollectionsPage_1 = require("../pages/SM-8.7/OptimizeCollectionsPage");
const OptimizeHomePage_1 = require("../pages/SM-8.7/OptimizeHomePage");
const FormJsPage_1 = require("../pages/SM-8.7/FormJsPage");
const OptimizeReportPage_1 = require("../pages/SM-8.7/OptimizeReportPage");
const ConsoleOrganizationPage_1 = require("../pages/SM-8.7/ConsoleOrganizationPage");
const SettingsPage_1 = require("../pages/SM-8.7/SettingsPage");
const ConnectorSettingsPage_1 = require("../pages/SM-8.7/ConnectorSettingsPage");
const ConnectorMarketplacePage_1 = require("../pages/SM-8.7/ConnectorMarketplacePage");
const IdentityPage_1 = require("../pages/SM-8.7/IdentityPage");
const ConsoleHomePage_1 = require("../pages/SM-8.7/ConsoleHomePage");
const OptimizeDashboardPage_1 = require("../pages/SM-8.7/OptimizeDashboardPage");
const TaskProcessesPage_1 = require("../pages/SM-8.7/TaskProcessesPage");
const IdentityUsersPage_1 = require("../pages/SM-8.7/IdentityUsersPage");
const IdentityTenantPage_1 = require("../pages/SM-8.7/IdentityTenantPage");
const ConnectorTemplatePage_1 = require("../pages/SM-8.7/ConnectorTemplatePage");
const KeycloakLoginPage_1 = require("../pages/SM-8.7/KeycloakLoginPage");
const KeycloakAdminPage_1 = require("../pages/SM-8.7/KeycloakAdminPage");
const _setup_1 = require("../test-setup.js");
const loggingUtils_1 = require("../utils/loggingUtils");
const test = test_1.test.extend({
    makeAxeBuilder: async ({ page }, use) => {
        const makeAxeBuilder = () => new playwright_1.default({ page }).withTags([
            'best-practice',
            'wcag2a',
            'wcag2aa',
            'cat.semantics',
            'cat.forms',
        ]);
        await use(makeAxeBuilder);
    },
    loginPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new LoginPage_1.LoginPage(page), 'LoginPage'));
    },
    homePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new HomePage_1.HomePage(page), 'HomePage'));
    },
    navigationPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new NavigationPage_1.NavigationPage(page), 'NavigationPage'));
    },
    modelerHomePage: async ({ page }, use) => {
        const randomName = await (0, _setup_1.generateRandomStringAsync)(3);
        await use((0, loggingUtils_1.withLogging)(new ModelerHomePage_1.ModelerHomePage(page, 'Cross Component Test Project' + randomName), 'ModelerHomePage'));
    },
    modelerCreatePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ModelerCreatePage_1.ModelerCreatePage(page), 'ModelerCreatePage'));
    },
    playPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new PlayPage_1.PlayPage(page), 'PlayPage'));
    },
    taskPanelPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new TaskPanelPage_1.TaskPanelPage(page), 'TaskPanelPage'));
    },
    taskDetailsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new TaskDetailsPage_1.TaskDetailsPage(page), 'TaskDetailsPage'));
    },
    operateHomePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OperateHomePage_1.OperateHomePage(page), 'OperateHomePage'));
    },
    operateProcessesPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OperateProcessesPage_1.OperateProcessesPage(page), 'OperateProcessesPage'));
    },
    operateProcessInstancePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OperateProcessInstancePage_1.OperateProcessInstancePage(page), 'OperateProcessInstancePage'));
    },
    optimizeCollectionsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OptimizeCollectionsPage_1.OptimizeCollectionsPage(page), 'OptimizeCollectionsPage'));
    },
    optimizeHomePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OptimizeHomePage_1.OptimizeHomePage(page), 'OptimizeHomePage'));
    },
    formJsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new FormJsPage_1.FormJsPage(page), 'FormJsPage'));
    },
    optimizeReportPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OptimizeReportPage_1.OptimizeReportPage(page), 'OptimizeReportPage'));
    },
    consoleOrganizationsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ConsoleOrganizationPage_1.ConsoleOrganizationPage(page), 'ConsoleOrganizationPage'));
    },
    settingsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new SettingsPage_1.SettingsPage(page), 'SettingsPage'));
    },
    connectorSettingsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ConnectorSettingsPage_1.ConnectorSettingsPage(page), 'ConnectorSettingsPage'));
    },
    connectorMarketplacePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ConnectorMarketplacePage_1.ConnectorMarketplacePage(page), 'ConnectorMarketplacePage'));
    },
    identityPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new IdentityPage_1.IdentityPage(page), 'IdentityPage'));
    },
    consoleHomePage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ConsoleHomePage_1.ConsoleHomePage(page), 'ConsoleHomePage'));
    },
    optimizeDashboardPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new OptimizeDashboardPage_1.OptimizeDashboardPage(page), 'OptimizeDashboardPage'));
    },
    taskProcessesPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new TaskProcessesPage_1.TaskProcessesPage(page), 'TaskProcessesPage'));
    },
    identityUsersPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new IdentityUsersPage_1.IdentityUsersPage(page), 'IdentityUsersPage'));
    },
    clusterPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ClusterPage_1.ClusterPage(page), 'ClusterPage'));
    },
    clusterDetailsPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new ClusterDetailsPage_1.ClusterDetailsPage(page), 'ClusterDetailsPage'));
    },
    identityTenantPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new IdentityTenantPage_1.IdentityTenantPage(page), 'IdentityTenantPage'));
    },
    keycloakLoginPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new KeycloakLoginPage_1.KeycloakLoginPage(page), 'KeycloakLoginPage'));
    },
    keycloakAdminPage: async ({ page }, use) => {
        await use((0, loggingUtils_1.withLogging)(new KeycloakAdminPage_1.KeycloakAdminPage(page), 'KeycloakAdminPage'));
    },
    connectorTemplatePage: async ({ page }, use) => {
        await use(new ConnectorTemplatePage_1.ConnectorTemplatePage(page));
    },
    overrideTrackingScripts: [
        async ({ context }, use) => {
            await context.route('https://cmp.osano.com/16CVvwSNKHi9t1grQ/9403708a-488b-4f3b-aea6-613825dec79f/osano.js', (route) => route.fulfill({
                status: 200,
                headers: {
                    'Content-Type': 'text/javascript;charset=UTF-8',
                },
                body: '',
            }));
            await use();
        },
        {
            auto: true,
        },
    ],
});
exports.test = test;
