84 lines
13 KiB
JavaScript
84 lines
13 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const lodash_1 = require("lodash");
|
|
const testing_unit_1 = __importDefault(require("./testing-unit"));
|
|
const unit_type_1 = __importDefault(require("./unit-type"));
|
|
const type_assertions_1 = require("../../errors/runtime/type-assertions");
|
|
const handle_tag_args_1 = __importDefault(require("../../utils/handle-tag-args"));
|
|
const wrap_test_function_1 = __importDefault(require("../wrap-test-function"));
|
|
const assert_type_1 = __importDefault(require("../request-hooks/assert-type"));
|
|
const assert_type_2 = __importDefault(require("../../custom-client-scripts/assert-type"));
|
|
const option_names_1 = __importDefault(require("../../configuration/option-names"));
|
|
const runtime_1 = require("../../errors/runtime");
|
|
const types_1 = require("../../errors/types");
|
|
const testcafe_hammerhead_1 = require("testcafe-hammerhead");
|
|
class Fixture extends testing_unit_1.default {
|
|
constructor(testFile, baseUrl, returnApiOrigin = true) {
|
|
const pageUrl = baseUrl || testcafe_hammerhead_1.SPECIAL_BLANK_PAGE;
|
|
super(testFile, unit_type_1.default.fixture, pageUrl, baseUrl);
|
|
this.path = testFile.filename;
|
|
this.beforeEachFn = null;
|
|
this.afterEachFn = null;
|
|
this.beforeFn = null;
|
|
this.afterFn = null;
|
|
this.globalBeforeFn = null;
|
|
this.globalAfterFn = null;
|
|
if (returnApiOrigin)
|
|
return this.apiOrigin;
|
|
}
|
|
static init({ testFile, baseUrl }) {
|
|
return super.init(Fixture, testFile, baseUrl);
|
|
}
|
|
_add(name, ...rest) {
|
|
name = (0, handle_tag_args_1.default)(name, rest);
|
|
(0, type_assertions_1.assertType)(type_assertions_1.is.string, 'apiOrigin', 'The fixture name', name);
|
|
this.name = name;
|
|
this.testFile.currentFixture = this;
|
|
return this.apiOrigin;
|
|
}
|
|
_before$(fn) {
|
|
(0, type_assertions_1.assertType)(type_assertions_1.is.function, 'before', 'The fixture.before hook', fn);
|
|
this.beforeFn = fn;
|
|
return this.apiOrigin;
|
|
}
|
|
_after$(fn) {
|
|
(0, type_assertions_1.assertType)(type_assertions_1.is.function, 'after', 'The fixture.after hook', fn);
|
|
this.afterFn = fn;
|
|
return this.apiOrigin;
|
|
}
|
|
_beforeEach$(fn) {
|
|
(0, type_assertions_1.assertType)(type_assertions_1.is.function, 'beforeEach', 'The fixture.beforeEach hook', fn);
|
|
this.beforeEachFn = (0, wrap_test_function_1.default)(fn);
|
|
return this.apiOrigin;
|
|
}
|
|
_afterEach$(fn) {
|
|
(0, type_assertions_1.assertType)(type_assertions_1.is.function, 'afterEach', 'The fixture.afterEach hook', fn);
|
|
this.afterEachFn = (0, wrap_test_function_1.default)(fn);
|
|
return this.apiOrigin;
|
|
}
|
|
_requestHooks$(...hooks) {
|
|
if (this.apiMethodWasCalled.requestHooks)
|
|
throw new runtime_1.APIError(option_names_1.default.requestHooks, types_1.RUNTIME_ERRORS.multipleAPIMethodCallForbidden, option_names_1.default.requestHooks);
|
|
hooks = (0, lodash_1.flattenDeep)(hooks);
|
|
(0, assert_type_1.default)(hooks);
|
|
this.requestHooks = hooks;
|
|
this.apiMethodWasCalled.requestHooks = true;
|
|
return this.apiOrigin;
|
|
}
|
|
_clientScripts$(...scripts) {
|
|
if (this.apiMethodWasCalled.clientScripts)
|
|
throw new runtime_1.APIError(option_names_1.default.clientScripts, types_1.RUNTIME_ERRORS.multipleAPIMethodCallForbidden, option_names_1.default.clientScripts);
|
|
scripts = (0, lodash_1.flattenDeep)(scripts);
|
|
(0, assert_type_2.default)(scripts);
|
|
this.clientScripts = scripts;
|
|
this.apiMethodWasCalled.clientScripts = true;
|
|
return this.apiOrigin;
|
|
}
|
|
}
|
|
exports.default = Fixture;
|
|
testing_unit_1.default.makeAPIListForChildClass(Fixture);
|
|
module.exports = exports.default;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoi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