playwright-cucumber-ts-steps
Version:
A collection of reusable Playwright step definitions for Cucumber in TypeScript, designed to streamline end-to-end testing across web, API, and mobile applications.
12 lines (11 loc) • 509 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const cucumber_1 = require("@cucumber/cucumber");
(0, cucumber_1.When)("I find href in iframe {string} and store as {string}", async function (iframeSelector, key) {
const iframe = this.page.frameLocator(iframeSelector);
const link = await iframe.locator("a[href]").first();
const href = await link.getAttribute("href");
if (!href)
throw new Error("No link found in iframe.");
this.data[key] = href;
});