Innovenergy_trunk/frontend/node_modules/testcafe/lib/test-run/commands/actions.js

665 lines
94 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 });
exports.RemoveRequestHooksCommand = exports.AddRequestHooksCommand = exports.RunCustomActionCommand = exports.SkipJsErrorsCommand = exports.GetProxyUrlCommand = exports.RequestCommand = exports.DeleteCookiesCommand = exports.SetCookiesCommand = exports.GetCookiesCommand = exports.RecorderCommand = exports.CloseChildWindowOnFileDownloading = exports.UseRoleCommand = exports.SetPageLoadTimeoutCommand = exports.SetTestSpeedCommand = exports.GetBrowserConsoleMessagesCommand = exports.GetNativeDialogHistoryCommand = exports.SetNativeDialogHandlerCommand = exports.SwitchToPreviousWindowCommand = exports.SwitchToParentWindowCommand = exports.SwitchToWindowByPredicateCommand = exports.SwitchToWindowCommand = exports.GetCurrentWindowsCommand = exports.GetCurrentWindowCommand = exports.CloseWindowCommand = exports.OpenWindowCommand = exports.SwitchToMainWindowCommand = exports.SwitchToIframeCommand = exports.ClearUploadCommand = exports.SetFilesToUploadCommand = exports.NavigateToCommand = exports.PressKeyCommand = exports.SelectTextAreaContentCommand = exports.SelectEditableContentCommand = exports.SelectTextCommand = exports.ScrollIntoViewCommand = exports.ScrollByCommand = exports.ScrollCommand = exports.DragToElementCommand = exports.DragCommand = exports.TypeTextCommand = exports.HoverCommand = exports.DoubleClickCommand = exports.ExecuteAsyncExpressionCommand = exports.ExecuteExpressionCommand = exports.RightClickCommand = exports.ClickCommand = exports.DispatchEventCommand = void 0;
const type_1 = __importDefault(require("./type"));
const selector_builder_1 = __importDefault(require("../../client-functions/selectors/selector-builder"));
const client_function_builder_1 = __importDefault(require("../../client-functions/client-function-builder"));
const builder_symbol_1 = __importDefault(require("../../client-functions/builder-symbol"));
const base_1 = require("./base");
const options_1 = require("./options");
const initializers_1 = require("./validations/initializers");
const execute_js_expression_1 = require("../execute-js-expression");
const utils_1 = require("./utils");
const argument_1 = require("./validations/argument");
const test_run_1 = require("../../errors/test-run");
const observation_1 = require("./observation");
const lodash_1 = require("lodash");
const skip_js_errors_1 = require("../../api/skip-js-errors");
// Initializers
function initActionOptions(name, val, initOptions, validate = true) {
return new options_1.ActionOptions(val, validate);
}
function initClickOptions(name, val, initOptions, validate = true) {
return new options_1.ClickOptions(val, validate);
}
function initMouseOptions(name, val, initOptions, validate = true) {
return new options_1.MouseOptions(val, validate);
}
function initOffsetOptions(name, val, initOptions, validate = true) {
return new options_1.OffsetOptions(val, validate);
}
function initTypeOptions(name, val, initOptions, validate = true) {
return new options_1.TypeOptions(val, validate);
}
function initDragToElementOptions(name, val, initOptions, validate = true) {
return new options_1.DragToElementOptions(val, validate);
}
function initPressOptions(name, val, initOptions, validate = true) {
return new options_1.PressOptions(val, validate);
}
function initDialogHandler(name, val, { skipVisibilityCheck, testRun }) {
let fn;
if ((0, utils_1.isJSExpression)(val))
fn = (0, execute_js_expression_1.executeJsExpression)(val.value, testRun, { skipVisibilityCheck });
else
fn = val.fn;
if (fn === null || fn instanceof observation_1.ExecuteClientFunctionCommand)
return fn;
const options = val.options;
const methodName = 'setNativeDialogHandler';
const functionType = typeof fn;
let builder = fn && fn[builder_symbol_1.default];
const isSelector = builder instanceof selector_builder_1.default;
const isClientFunction = builder instanceof client_function_builder_1.default;
if (functionType !== 'function' || isSelector)
throw new test_run_1.SetNativeDialogHandlerCodeWrongTypeError(isSelector ? 'Selector' : functionType);
if (isClientFunction)
builder = fn.with(options)[builder_symbol_1.default];
else
builder = new client_function_builder_1.default(fn, options, { instantiation: methodName, execution: methodName });
return builder.getCommand();
}
function initCookiesOption(name, val, initOptions, validate = true) {
return val.map(cookie => new options_1.CookieOptions(cookie, validate));
}
function initRequestOption(name, val, initOptions, validate = true) {
return new options_1.RequestOptions(val, validate);
}
function initGetProxyUrlOptions(name, val, initOptions, validate = true) {
return new options_1.GetProxyUrlOptions(val, validate);
}
function initSkipJsErrorsOptions(name, val, initOptions, validate = true) {
if (val === void 0)
return true;
if ((0, skip_js_errors_1.isSkipJsErrorsCallbackWithOptionsObject)(val))
val = new options_1.SkipJsErrorsCallbackWithOptions(val, validate);
else if ((0, skip_js_errors_1.isSkipJsErrorsOptionsObject)(val))
val = new options_1.SkipJsErrorsOptions(val, validate);
return (0, skip_js_errors_1.prepareSkipJsErrorsOptions)(val, initOptions.testRun.opts.experimentalProxyless);
}
// Commands
class DispatchEventCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.dispatchEvent, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'eventName', type: argument_1.nonEmptyStringArgument, required: true },
{ name: 'options', type: argument_1.actionOptions },
{ name: 'relatedTarget', init: initializers_1.initSelector, required: false },
];
}
}
exports.DispatchEventCommand = DispatchEventCommand;
DispatchEventCommand.methodName = (0, lodash_1.camelCase)(type_1.default.dispatchEvent);
class ClickCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.click, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initClickOptions, required: true },
];
}
}
exports.ClickCommand = ClickCommand;
ClickCommand.methodName = (0, lodash_1.camelCase)(type_1.default.click);
class RightClickCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.rightClick, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initClickOptions, required: true },
];
}
}
exports.RightClickCommand = RightClickCommand;
RightClickCommand.methodName = (0, lodash_1.camelCase)(type_1.default.rightClick);
class ExecuteExpressionCommand extends base_1.CommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.executeExpression, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'expression', type: argument_1.nonEmptyStringArgument, required: true },
{ name: 'resultVariableName', type: argument_1.nonEmptyStringArgument, defaultValue: null },
];
}
}
exports.ExecuteExpressionCommand = ExecuteExpressionCommand;
class ExecuteAsyncExpressionCommand extends base_1.CommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.executeAsyncExpression, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'expression', type: argument_1.stringArgument, required: true },
];
}
}
exports.ExecuteAsyncExpressionCommand = ExecuteAsyncExpressionCommand;
class DoubleClickCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.doubleClick, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initClickOptions, required: true },
];
}
}
exports.DoubleClickCommand = DoubleClickCommand;
DoubleClickCommand.methodName = (0, lodash_1.camelCase)(type_1.default.doubleClick);
class HoverCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.hover, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initMouseOptions, required: true },
];
}
}
exports.HoverCommand = HoverCommand;
HoverCommand.methodName = (0, lodash_1.camelCase)(type_1.default.hover);
class TypeTextCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.typeText, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initTypeSelector, required: true },
{ name: 'text', type: argument_1.nonEmptyStringArgument, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initTypeOptions, required: true },
];
}
}
exports.TypeTextCommand = TypeTextCommand;
TypeTextCommand.methodName = (0, lodash_1.camelCase)(type_1.default.typeText);
class DragCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.drag, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'dragOffsetX', type: argument_1.integerArgument, required: true },
{ name: 'dragOffsetY', type: argument_1.integerArgument, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initMouseOptions, required: true },
];
}
}
exports.DragCommand = DragCommand;
DragCommand.methodName = (0, lodash_1.camelCase)(type_1.default.drag);
class DragToElementCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.dragToElement, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'destinationSelector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initDragToElementOptions, required: true },
];
}
}
exports.DragToElementCommand = DragToElementCommand;
DragToElementCommand.methodName = (0, lodash_1.camelCase)(type_1.default.dragToElement);
class ScrollCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.scroll, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: false },
{ name: 'position', type: argument_1.nullableStringArgument, required: false },
{ name: 'x', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'y', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'options', type: argument_1.actionOptions, init: initOffsetOptions, required: true },
];
}
}
exports.ScrollCommand = ScrollCommand;
ScrollCommand.methodName = (0, lodash_1.camelCase)(type_1.default.scroll);
class ScrollByCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.scrollBy, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: false },
{ name: 'byX', type: argument_1.integerArgument, defaultValue: 0 },
{ name: 'byY', type: argument_1.integerArgument, defaultValue: 0 },
{ name: 'options', type: argument_1.actionOptions, init: initOffsetOptions, required: true },
];
}
}
exports.ScrollByCommand = ScrollByCommand;
ScrollByCommand.methodName = (0, lodash_1.camelCase)(type_1.default.scrollBy);
class ScrollIntoViewCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.scrollIntoView, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initOffsetOptions, required: true },
];
}
}
exports.ScrollIntoViewCommand = ScrollIntoViewCommand;
ScrollIntoViewCommand.methodName = (0, lodash_1.camelCase)(type_1.default.scrollIntoView);
class SelectTextCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.selectText, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'startPos', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'endPos', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'options', type: argument_1.actionOptions, init: initActionOptions, required: true },
];
}
}
exports.SelectTextCommand = SelectTextCommand;
SelectTextCommand.methodName = (0, lodash_1.camelCase)(type_1.default.selectText);
class SelectEditableContentCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.selectEditableContent, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'startSelector', init: initializers_1.initSelector, required: true },
{ name: 'endSelector', init: initializers_1.initSelector, defaultValue: null },
{ name: 'options', type: argument_1.actionOptions, init: initActionOptions, required: true },
];
}
}
exports.SelectEditableContentCommand = SelectEditableContentCommand;
SelectEditableContentCommand.methodName = (0, lodash_1.camelCase)(type_1.default.selectEditableContent);
class SelectTextAreaContentCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.selectTextAreaContent, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
{ name: 'startLine', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'startPos', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'endLine', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'endPos', type: argument_1.positiveIntegerArgument, defaultValue: null },
{ name: 'options', type: argument_1.actionOptions, init: initActionOptions, required: true },
];
}
}
exports.SelectTextAreaContentCommand = SelectTextAreaContentCommand;
SelectTextAreaContentCommand.methodName = (0, lodash_1.camelCase)(type_1.default.selectTextAreaContent);
class PressKeyCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.pressKey, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'keys', type: argument_1.nonEmptyStringArgument, required: true },
{ name: 'options', type: argument_1.actionOptions, init: initPressOptions, required: true },
];
}
}
exports.PressKeyCommand = PressKeyCommand;
PressKeyCommand.methodName = (0, lodash_1.camelCase)(type_1.default.pressKey);
class NavigateToCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.navigateTo, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'url', type: argument_1.pageUrlArgument, required: true },
{ name: 'stateSnapshot', type: argument_1.nullableStringArgument, defaultValue: null },
{ name: 'forceReload', type: argument_1.booleanArgument, defaultValue: false },
];
}
}
exports.NavigateToCommand = NavigateToCommand;
NavigateToCommand.methodName = (0, lodash_1.camelCase)(type_1.default.navigateTo);
class SetFilesToUploadCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.setFilesToUpload, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initUploadSelector, required: true },
{ name: 'filePath', type: argument_1.stringOrStringArrayArgument, required: true },
];
}
}
exports.SetFilesToUploadCommand = SetFilesToUploadCommand;
SetFilesToUploadCommand.methodName = (0, lodash_1.camelCase)(type_1.default.setFilesToUpload);
class ClearUploadCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.clearUpload, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initUploadSelector, required: true },
];
}
}
exports.ClearUploadCommand = ClearUploadCommand;
ClearUploadCommand.methodName = (0, lodash_1.camelCase)(type_1.default.clearUpload);
class SwitchToIframeCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.switchToIframe, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'selector', init: initializers_1.initSelector, required: true },
];
}
}
exports.SwitchToIframeCommand = SwitchToIframeCommand;
SwitchToIframeCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToIframe);
class SwitchToMainWindowCommand extends base_1.ActionCommandBase {
constructor() {
super();
this.type = type_1.default.switchToMainWindow;
}
}
exports.SwitchToMainWindowCommand = SwitchToMainWindowCommand;
SwitchToMainWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToMainWindow);
class OpenWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.openWindow, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'url', type: argument_1.pageUrlArgument },
];
}
}
exports.OpenWindowCommand = OpenWindowCommand;
OpenWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.openWindow);
class CloseWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.closeWindow, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'windowId', type: argument_1.nullableStringArgument, required: true },
];
}
}
exports.CloseWindowCommand = CloseWindowCommand;
CloseWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.closeWindow);
class GetCurrentWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.getCurrentWindow, validateProperties);
}
}
exports.GetCurrentWindowCommand = GetCurrentWindowCommand;
GetCurrentWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getCurrentWindow);
class GetCurrentWindowsCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.getCurrentWindows, validateProperties);
}
}
exports.GetCurrentWindowsCommand = GetCurrentWindowsCommand;
GetCurrentWindowsCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getCurrentWindows);
class SwitchToWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.switchToWindow, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'windowId', type: argument_1.nonEmptyStringArgument, required: true },
];
}
}
exports.SwitchToWindowCommand = SwitchToWindowCommand;
SwitchToWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToWindow);
class SwitchToWindowByPredicateCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.switchToWindowByPredicate, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'id', type: argument_1.nonEmptyStringArgument, required: false },
{ name: 'checkWindow', type: argument_1.functionArgument, required: true },
];
}
}
exports.SwitchToWindowByPredicateCommand = SwitchToWindowByPredicateCommand;
SwitchToWindowByPredicateCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToWindow);
class SwitchToParentWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.switchToParentWindow, validateProperties);
}
}
exports.SwitchToParentWindowCommand = SwitchToParentWindowCommand;
SwitchToParentWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToParentWindow);
class SwitchToPreviousWindowCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.switchToPreviousWindow, validateProperties);
}
}
exports.SwitchToPreviousWindowCommand = SwitchToPreviousWindowCommand;
SwitchToPreviousWindowCommand.methodName = (0, lodash_1.camelCase)(type_1.default.switchToPreviousWindow);
class SetNativeDialogHandlerCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.setNativeDialogHandler, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'dialogHandler', init: initDialogHandler, required: true },
];
}
static from(val) {
const dialogHandlerStub = {
dialogHandler: { fn: null },
};
const command = new SetNativeDialogHandlerCommand(dialogHandlerStub);
command.dialogHandler = val.dialogHandler;
return command;
}
}
exports.SetNativeDialogHandlerCommand = SetNativeDialogHandlerCommand;
SetNativeDialogHandlerCommand.methodName = (0, lodash_1.camelCase)(type_1.default.setNativeDialogHandler);
class GetNativeDialogHistoryCommand extends base_1.ActionCommandBase {
constructor() {
super();
this.type = type_1.default.getNativeDialogHistory;
}
}
exports.GetNativeDialogHistoryCommand = GetNativeDialogHistoryCommand;
GetNativeDialogHistoryCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getNativeDialogHistory);
class GetBrowserConsoleMessagesCommand extends base_1.ActionCommandBase {
constructor() {
super();
this.type = type_1.default.getBrowserConsoleMessages;
}
}
exports.GetBrowserConsoleMessagesCommand = GetBrowserConsoleMessagesCommand;
GetBrowserConsoleMessagesCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getBrowserConsoleMessages);
class SetTestSpeedCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.setTestSpeed, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'speed', type: argument_1.setSpeedArgument, required: true },
];
}
}
exports.SetTestSpeedCommand = SetTestSpeedCommand;
SetTestSpeedCommand.methodName = (0, lodash_1.camelCase)(type_1.default.setTestSpeed);
class SetPageLoadTimeoutCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.setPageLoadTimeout, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'duration', type: argument_1.positiveIntegerArgument, required: true },
];
}
}
exports.SetPageLoadTimeoutCommand = SetPageLoadTimeoutCommand;
SetPageLoadTimeoutCommand.methodName = (0, lodash_1.camelCase)(type_1.default.setPageLoadTimeout);
class UseRoleCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.useRole, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'role', type: argument_1.actionRoleArgument, required: true },
];
}
}
exports.UseRoleCommand = UseRoleCommand;
UseRoleCommand.methodName = (0, lodash_1.camelCase)(type_1.default.useRole);
class CloseChildWindowOnFileDownloading extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.closeChildWindowOnFileDownloading, validateProperties);
}
}
exports.CloseChildWindowOnFileDownloading = CloseChildWindowOnFileDownloading;
CloseChildWindowOnFileDownloading.methodName = (0, lodash_1.camelCase)(type_1.default.closeChildWindowOnFileDownloading);
class RecorderCommand extends base_1.ActionCommandBase {
constructor(obj, testRun) {
super(obj, testRun, type_1.default.recorder);
}
getAssignableProperties() {
return [
{ name: 'subtype', type: argument_1.nonEmptyStringArgument, required: true },
{ name: 'forceExecutionInTopWindowOnly', type: argument_1.booleanArgument, defaultValue: false },
];
}
}
exports.RecorderCommand = RecorderCommand;
RecorderCommand.methodName = (0, lodash_1.camelCase)(type_1.default.recorder);
class GetCookiesCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.getCookies, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'urls', type: argument_1.urlsArgument, required: false },
{ name: 'cookies', type: argument_1.cookiesArgument, init: initCookiesOption, required: false },
];
}
}
exports.GetCookiesCommand = GetCookiesCommand;
GetCookiesCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getCookies);
class SetCookiesCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.setCookies, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'url', type: argument_1.urlsArgument, required: false },
{ name: 'cookies', type: argument_1.setCookiesArgument, init: initCookiesOption, required: true },
];
}
}
exports.SetCookiesCommand = SetCookiesCommand;
SetCookiesCommand.methodName = (0, lodash_1.camelCase)(type_1.default.setCookies);
class DeleteCookiesCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.deleteCookies, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'urls', type: argument_1.urlsArgument, required: false },
{ name: 'cookies', type: argument_1.cookiesArgument, init: initCookiesOption, required: false },
];
}
}
exports.DeleteCookiesCommand = DeleteCookiesCommand;
DeleteCookiesCommand.methodName = (0, lodash_1.camelCase)(type_1.default.deleteCookies);
class RequestCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.request, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'url', type: argument_1.urlArgument, required: false },
{ name: 'options', type: argument_1.actionOptions, init: initRequestOption, required: false },
];
}
}
exports.RequestCommand = RequestCommand;
RequestCommand.methodName = (0, lodash_1.camelCase)(type_1.default.request);
RequestCommand.extendedMethods = ['get', 'post', 'delete', 'put', 'patch', 'head'];
RequestCommand.resultGetters = ['status', 'statusText', 'headers', 'body'];
class GetProxyUrlCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.getProxyUrl, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'url', type: argument_1.urlArgument, required: true },
{ name: 'options', init: initGetProxyUrlOptions, required: false },
];
}
}
exports.GetProxyUrlCommand = GetProxyUrlCommand;
GetProxyUrlCommand.methodName = (0, lodash_1.camelCase)(type_1.default.getProxyUrl);
class SkipJsErrorsCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.skipJsErrors, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'options', type: argument_1.skipJsErrorOptions, init: initSkipJsErrorsOptions, required: false },
];
}
}
exports.SkipJsErrorsCommand = SkipJsErrorsCommand;
SkipJsErrorsCommand.methodName = (0, lodash_1.camelCase)(type_1.default.skipJsErrors);
class RunCustomActionCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.runCustomAction, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'fn', type: argument_1.functionArgument, required: true },
{ name: 'name', type: argument_1.stringArgument, required: true },
{ name: 'args', required: false },
];
}
}
exports.RunCustomActionCommand = RunCustomActionCommand;
RunCustomActionCommand.methodName = (0, lodash_1.camelCase)(type_1.default.runCustomAction);
class AddRequestHooksCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.addRequestHooks, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'hooks', type: argument_1.requestHooksArgument, required: true },
];
}
}
exports.AddRequestHooksCommand = AddRequestHooksCommand;
AddRequestHooksCommand.methodName = (0, lodash_1.camelCase)(type_1.default.addRequestHooks);
class RemoveRequestHooksCommand extends base_1.ActionCommandBase {
constructor(obj, testRun, validateProperties) {
super(obj, testRun, type_1.default.removeRequestHooks, validateProperties);
}
getAssignableProperties() {
return [
{ name: 'hooks', type: argument_1.requestHooksArgument, required: true },
];
}
}
exports.RemoveRequestHooksCommand = RemoveRequestHooksCommand;
RemoveRequestHooksCommand.methodName = (0, lodash_1.camelCase)(type_1.default.removeRequestHooks);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0LXJ1bi9jb21tYW5kcy9hY3Rpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLGtEQUEwQjtBQUMxQix5R0FBZ0Y7QUFDaEYsNkdBQW1GO0FBQ25GLDJGQUEwRTtBQUMxRSxpQ0FBd0Q7QUFDeEQsdUNBYW1CO0FBRW5CLDZEQUlvQztBQUNwQyxvRUFBK0Q7QUFDL0QsbUNBQXlDO0FBRXpDLHFEQW1CZ0M7QUFFaEMsb0RBQWlGO0FBQ2pGLCtDQUE2RDtBQUM3RCxtQ0FBbUM7QUFDbkMsNkRBSWtDO0FBR2xDLGVBQWU7QUFDZixTQU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