@uuv/playwright
Version:
A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and playwright
33 lines (32 loc) • 918 B
JavaScript
;
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Then = exports.When = exports.Given = exports.test = exports.World = void 0;
const playwright_bdd_1 = require("playwright-bdd");
class World {
page;
testInfo;
constructor(page, testInfo) {
this.page = page;
this.testInfo = testInfo;
}
get context() {
return this.page.context();
}
get browser() {
return this.page.context().browser();
}
get request() {
return this.page.request;
}
}
exports.World = World;
exports.test = playwright_bdd_1.test.extend({
world: async ({ page, $testInfo }, use) => {
const world = new World(page, $testInfo);
await use(world);
},
});
_a = (0, playwright_bdd_1.createBdd)(exports.test, {
worldFixture: "world"
}), exports.Given = _a.Given, exports.When = _a.When, exports.Then = _a.Then;