"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cucumber_1 = require("@cucumber/cucumber");
const test_1 = require("@playwright/test");
(0, cucumber_1.Given)('I open the application', async function () {
    await this.page?.goto(this.config.baseUrl);
});
(0, cucumber_1.Given)('I navigate to {string}', async function (path) {
    const targetUrl = new URL(path, this.config.baseUrl).toString();
    await this.page?.goto(targetUrl);
});
(0, cucumber_1.Then)('the current URL should contain {string}', async function (expected) {
    await (0, test_1.expect)(this.page).toHaveURL(new RegExp(escapeRegExp(expected)));
});
function escapeRegExp(value) {
    return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
