"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runPlaywrightTestWithConfig = runPlaywrightTestWithConfig;
const frontendTestConfigs_1 = require("../frontendTestConfigs");
function runPlaywrightTestWithConfig(runTest) {
    const specificUrl = process.env.URL;
    const isClientsArg = process.env.CLIENTS;
    let selectedConfigs;
    if (specificUrl) {
        // Find the matching config or create one for the given URL
        const testConfig = frontendTestConfigs_1.testConfigs.find((config) => config.url === specificUrl) || {
            url: specificUrl,
            proceedWithPayment: false,
        };
        selectedConfigs = [testConfig];
    }
    else if (isClientsArg) {
        selectedConfigs = frontendTestConfigs_1.testConfigs.filter((config) => config.isClient);
    }
    else {
        // No URL provided, use the default config(s)
        selectedConfigs = frontendTestConfigs_1.testConfigs.filter((config) => config.runByDefault);
    }
    selectedConfigs.forEach((config) => runTest(config));
}
//# sourceMappingURL=playwrightHelpers.js.map