e2ed
Version:
E2E testing framework over Playwright
39 lines (38 loc) • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Expect = void 0;
const assertionMessageGetters_1 = require("./assertionMessageGetters");
const createExpectMethod_1 = require("./createExpectMethod");
const playwrightMethods_1 = require("./playwrightMethods");
/**
* Wrapper of playwright's `expect` with logs.
* @internal
*/
// eslint-disable-next-line import/exports-last
class Expect {
/**
* Actual value of `expect`.
*/
actualValue;
/**
* Optional additional fields that will be added to the assert logs.
*/
additionalLogFields;
/**
* Description of `expect`.
*/
description;
/**
* Optional error of assert method.
*/
error;
constructor(actualValue, description) {
this.actualValue = actualValue;
this.description = description;
}
}
exports.Expect = Expect;
const methods = [...Object.keys(assertionMessageGetters_1.assertionMessageGetters), ...playwrightMethods_1.playwrightMethods];
for (const key of methods) {
Expect.prototype[key] = (0, createExpectMethod_1.createExpectMethod)(key, assertionMessageGetters_1.assertionMessageGetters[key]);
}