107 lines
14 KiB
JavaScript
107 lines
14 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.MaximizeWindowCommand = exports.ResizeWindowToFitDeviceCommand = exports.ResizeWindowCommand = exports.TakeScreenshotOnFailCommand = exports.TakeElementScreenshotCommand = exports.TakeScreenshotCommand = exports.TakeScreenshotBaseCommand = void 0;
|
|
const type_1 = __importDefault(require("./type"));
|
|
const base_1 = require("./base");
|
|
const options_1 = require("./options");
|
|
const initializers_1 = require("./validations/initializers");
|
|
const argument_1 = require("./validations/argument");
|
|
const utils_1 = require("../../screenshots/utils");
|
|
const lodash_1 = require("lodash");
|
|
function initResizeToFitDeviceOptions(name, val, initOptions, validate = true) {
|
|
return new options_1.ResizeToFitDeviceOptions(val, validate);
|
|
}
|
|
function initElementScreenshotOptions(name, val, initOptions, validate = true) {
|
|
return new options_1.ElementScreenshotOptions(val, validate);
|
|
}
|
|
// Commands
|
|
class TakeScreenshotBaseCommand extends base_1.ActionCommandBase {
|
|
constructor(obj, testRun, type, validateProperties) {
|
|
super(obj, testRun, type, validateProperties);
|
|
this.markSeed = null;
|
|
this.markData = '';
|
|
}
|
|
generateScreenshotMark() {
|
|
Object.assign(this, (0, utils_1.generateScreenshotMark)());
|
|
}
|
|
}
|
|
exports.TakeScreenshotBaseCommand = TakeScreenshotBaseCommand;
|
|
class TakeScreenshotCommand extends TakeScreenshotBaseCommand {
|
|
constructor(obj, testRun, validateProperties) {
|
|
super(obj, testRun, type_1.default.takeScreenshot, validateProperties);
|
|
}
|
|
getAssignableProperties() {
|
|
return [
|
|
{ name: 'path', type: argument_1.screenshotPathArgument, defaultValue: '' },
|
|
{ name: 'fullPage', type: argument_1.booleanArgument, defaultValue: void 0 },
|
|
{ name: 'thumbnails', type: argument_1.booleanArgument, defaultValue: void 0 },
|
|
];
|
|
}
|
|
}
|
|
exports.TakeScreenshotCommand = TakeScreenshotCommand;
|
|
TakeScreenshotCommand.methodName = (0, lodash_1.camelCase)(type_1.default.takeScreenshot);
|
|
class TakeElementScreenshotCommand extends TakeScreenshotBaseCommand {
|
|
constructor(obj, testRun, validateProperties) {
|
|
super(obj, testRun, type_1.default.takeElementScreenshot, validateProperties);
|
|
}
|
|
getAssignableProperties() {
|
|
return [
|
|
{ name: 'selector', init: initializers_1.initSelector, required: true },
|
|
{ name: 'options', init: initElementScreenshotOptions, required: true },
|
|
{ name: 'path', type: argument_1.screenshotPathArgument, defaultValue: '' },
|
|
];
|
|
}
|
|
}
|
|
exports.TakeElementScreenshotCommand = TakeElementScreenshotCommand;
|
|
TakeElementScreenshotCommand.methodName = (0, lodash_1.camelCase)(type_1.default.takeElementScreenshot);
|
|
class TakeScreenshotOnFailCommand extends TakeScreenshotBaseCommand {
|
|
constructor(obj, testRun) {
|
|
super(obj, testRun, type_1.default.takeScreenshotOnFail);
|
|
}
|
|
getAssignableProperties() {
|
|
return [
|
|
{ name: 'fullPage', type: argument_1.booleanArgument, defaultValue: false },
|
|
{ name: 'failedActionId', type: argument_1.stringArgument },
|
|
];
|
|
}
|
|
}
|
|
exports.TakeScreenshotOnFailCommand = TakeScreenshotOnFailCommand;
|
|
TakeScreenshotOnFailCommand.methodName = (0, lodash_1.camelCase)(type_1.default.takeScreenshotOnFail);
|
|
class ResizeWindowCommand extends base_1.ActionCommandBase {
|
|
constructor(obj, testRun) {
|
|
super(obj, testRun, type_1.default.resizeWindow);
|
|
}
|
|
getAssignableProperties() {
|
|
return [
|
|
{ name: 'width', type: argument_1.positiveIntegerArgument, required: true },
|
|
{ name: 'height', type: argument_1.positiveIntegerArgument, required: true },
|
|
];
|
|
}
|
|
}
|
|
exports.ResizeWindowCommand = ResizeWindowCommand;
|
|
ResizeWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.resizeWindow);
|
|
class ResizeWindowToFitDeviceCommand extends base_1.ActionCommandBase {
|
|
constructor(obj, testRun, validateProperties) {
|
|
super(obj, testRun, type_1.default.resizeWindowToFitDevice, validateProperties);
|
|
}
|
|
getAssignableProperties() {
|
|
return [
|
|
{ name: 'device', type: argument_1.resizeWindowDeviceArgument, required: true },
|
|
{ name: 'options', type: argument_1.actionOptions, init: initResizeToFitDeviceOptions, required: true },
|
|
];
|
|
}
|
|
}
|
|
exports.ResizeWindowToFitDeviceCommand = ResizeWindowToFitDeviceCommand;
|
|
ResizeWindowToFitDeviceCommand.methodName = (0, lodash_1.camelCase)(type_1.default.resizeWindowToFitDevice);
|
|
class MaximizeWindowCommand extends base_1.ActionCommandBase {
|
|
constructor() {
|
|
super();
|
|
this.type = type_1.default.maximizeWindow;
|
|
}
|
|
}
|
|
exports.MaximizeWindowCommand = MaximizeWindowCommand;
|
|
MaximizeWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.maximizeWindow);
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJvd3Nlci1tYW5pcHVsYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdC1ydW4vY29tbWFuZHMvYnJvd3Nlci1tYW5pcHVsYXRpb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsa0RBQTBCO0FBQzFCLGlDQUEyQztBQUMzQyx1Q0FBK0U7QUFDL0UsNkRBQTBEO0FBRTFELHFEQU9nQztBQUVoQyxtREFBaUU7QUFDakUsbUNBQW1DO0FBRW5DLFNBQVMsNEJBQTRCLENBQUUsSUFBSSxFQUFFLEdBQUcsRUFBRSxXQUFXLEVBQUUsUUFBUSxHQUFHLElBQUk7SUFDMUUsT0FBTyxJQUFJLGtDQUF3QixDQUFDLEdBQUcsRUFBRSxRQUFRLENBQUMsQ0FBQztBQUN2RCxDQUFDO0FBRUQsU0FBUyw0QkFBNEIsQ0FBRSxJQUFJLEVBQUUsR0FB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