Innovenergy_trunk/frontend/node_modules/testcafe/lib/api/structure/test-file.js

34 lines
4.4 KiB
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_unit_1 = __importDefault(require("./base-unit"));
const unit_type_1 = __importDefault(require("./unit-type"));
const BORROWED_TEST_PROPERTIES = ['skip', 'only', 'pageUrl', 'authCredentials'];
class TestFile extends base_unit_1.default {
constructor(filename) {
super(unit_type_1.default.testFile);
this.filename = filename;
this.currentFixture = null;
this.collectedTests = [];
}
getTests() {
this.collectedTests.forEach(test => {
BORROWED_TEST_PROPERTIES.forEach(prop => {
// TODO: add index signature to the Test and Fixture classes
//@ts-ignore
test[prop] = test[prop] || test.fixture[prop];
});
const testFixture = test.fixture;
if (test.disablePageReloads === void 0)
test.disablePageReloads = testFixture.disablePageReloads;
if (!test.disablePageCaching)
test.disablePageCaching = testFixture.disablePageCaching;
});
return this.collectedTests;
}
}
exports.default = TestFile;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC1maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FwaS9zdHJ1Y3R1cmUvdGVzdC1maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsNERBQW1DO0FBQ25DLDREQUFtQztBQUluQyxNQUFNLHdCQUF3QixHQUFHLENBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsaUJBQWlCLENBQUMsQ0FBQztBQUVoRixNQUFxQixRQUFTLFNBQVEsbUJBQVE7SUFLMUMsWUFBb0IsUUFBZ0I7UUFDaEMsS0FBSyxDQUFDLG1CQUFRLENBQUMsUUFBUSxDQUFDLENBQUM7UUFFekIsSUFBSSxDQUFDLFFBQVEsR0FBUyxR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