@testsmith/testblocks 0.9.4 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +4 -1
- package/dist/client/assets/index-B8OSvcUg.css +1 -0
- package/dist/client/assets/index-CMMJHs_d.js +2197 -0
- package/dist/client/assets/index-CMMJHs_d.js.map +1 -0
- package/dist/client/index.html +2 -2
- package/dist/core/blocks/api/ApiAssertBodyContainsBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiAssertBodyContainsBlock.js +40 -0
- package/dist/core/blocks/api/ApiAssertStatusBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiAssertStatusBlock.js +35 -0
- package/dist/core/blocks/api/ApiClearHeadersBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiClearHeadersBlock.js +25 -0
- package/dist/core/blocks/api/ApiDeleteBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiDeleteBlock.js +37 -0
- package/dist/core/blocks/api/ApiExtractBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiExtractBlock.js +40 -0
- package/dist/core/blocks/api/ApiExtractJsonPathBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiExtractJsonPathBlock.js +47 -0
- package/dist/core/blocks/api/ApiExtractXPathBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiExtractXPathBlock.js +70 -0
- package/dist/core/blocks/api/ApiGetBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiGetBlock.js +36 -0
- package/dist/core/blocks/api/ApiHeadersBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiHeadersBlock.js +44 -0
- package/dist/core/blocks/api/ApiJsonBodyBlock.d.ts +14 -0
- package/dist/core/blocks/api/ApiJsonBodyBlock.js +28 -0
- package/dist/core/blocks/api/ApiPatchBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPatchBlock.js +47 -0
- package/dist/core/blocks/api/ApiPostBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPostBlock.js +47 -0
- package/dist/core/blocks/api/ApiPutBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiPutBlock.js +47 -0
- package/dist/core/blocks/api/ApiSetHeaderBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiSetHeaderBlock.js +37 -0
- package/dist/core/blocks/api/ApiSetHeadersBlock.d.ts +13 -0
- package/dist/core/blocks/api/ApiSetHeadersBlock.js +41 -0
- package/dist/core/blocks/api/index.d.ts +25 -0
- package/dist/core/blocks/api/index.js +83 -0
- package/dist/core/blocks/base/Block.d.ts +59 -0
- package/dist/core/blocks/base/Block.js +151 -0
- package/dist/core/blocks/base/ContainerBlock.d.ts +14 -0
- package/dist/core/blocks/base/ContainerBlock.js +16 -0
- package/dist/core/blocks/base/ControlFlowBlock.d.ts +13 -0
- package/dist/core/blocks/base/ControlFlowBlock.js +17 -0
- package/dist/core/blocks/base/StatementBlock.d.ts +9 -0
- package/dist/core/blocks/base/StatementBlock.js +16 -0
- package/dist/core/blocks/base/ValueBlock.d.ts +12 -0
- package/dist/core/blocks/base/ValueBlock.js +16 -0
- package/dist/core/blocks/base/index.d.ts +5 -0
- package/dist/core/blocks/base/index.js +13 -0
- package/dist/core/blocks/data/DataCsvBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataCsvBlock.js +51 -0
- package/dist/core/blocks/data/DataDefineBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataDefineBlock.js +28 -0
- package/dist/core/blocks/data/DataForeachBlock.d.ts +13 -0
- package/dist/core/blocks/data/DataForeachBlock.js +37 -0
- package/dist/core/blocks/data/DataFromVariableBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataFromVariableBlock.js +27 -0
- package/dist/core/blocks/data/DataGetCurrentBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetCurrentBlock.js +34 -0
- package/dist/core/blocks/data/DataGetIndexBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetIndexBlock.js +24 -0
- package/dist/core/blocks/data/DataGetNameBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataGetNameBlock.js +24 -0
- package/dist/core/blocks/data/DataRangeBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataRangeBlock.js +40 -0
- package/dist/core/blocks/data/DataRowBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataRowBlock.js +33 -0
- package/dist/core/blocks/data/DataTableBlock.d.ts +14 -0
- package/dist/core/blocks/data/DataTableBlock.js +51 -0
- package/dist/core/blocks/data/index.d.ts +20 -0
- package/dist/core/blocks/data/index.js +57 -0
- package/dist/core/blocks/index.d.ts +66 -5
- package/dist/core/blocks/index.js +134 -35
- package/dist/core/blocks/lifecycle/LifecycleAfterAllBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterAllBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterEachBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleAfterEachBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeAllBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeAllBlock.js +28 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeEachBlock.d.ts +15 -0
- package/dist/core/blocks/lifecycle/LifecycleBeforeEachBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleOnFailureBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleOnFailureBlock.js +25 -0
- package/dist/core/blocks/lifecycle/LifecycleRetryBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleRetryBlock.js +29 -0
- package/dist/core/blocks/lifecycle/LifecycleSetupBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleSetupBlock.js +27 -0
- package/dist/core/blocks/lifecycle/LifecycleSkipIfBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleSkipIfBlock.js +31 -0
- package/dist/core/blocks/lifecycle/LifecycleTeardownBlock.d.ts +13 -0
- package/dist/core/blocks/lifecycle/LifecycleTeardownBlock.js +27 -0
- package/dist/core/blocks/lifecycle/TestCaseBlock.d.ts +21 -0
- package/dist/core/blocks/lifecycle/TestCaseBlock.js +72 -0
- package/dist/core/blocks/lifecycle/TestCaseDataDrivenBlock.d.ts +21 -0
- package/dist/core/blocks/lifecycle/TestCaseDataDrivenBlock.js +102 -0
- package/dist/core/blocks/lifecycle/index.d.ts +21 -0
- package/dist/core/blocks/lifecycle/index.js +63 -0
- package/dist/core/blocks/logic/LogicArrayBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicArrayBlock.js +28 -0
- package/dist/core/blocks/logic/LogicAssertBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicAssertBlock.js +32 -0
- package/dist/core/blocks/logic/LogicBooleanBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicBooleanBlock.js +26 -0
- package/dist/core/blocks/logic/LogicBooleanOpBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicBooleanOpBlock.js +31 -0
- package/dist/core/blocks/logic/LogicCommentBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicCommentBlock.js +26 -0
- package/dist/core/blocks/logic/LogicCompareBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicCompareBlock.js +52 -0
- package/dist/core/blocks/logic/LogicFailBlock.d.ts +16 -0
- package/dist/core/blocks/logic/LogicFailBlock.js +30 -0
- package/dist/core/blocks/logic/LogicForeachBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicForeachBlock.js +29 -0
- package/dist/core/blocks/logic/LogicGetVariableBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicGetVariableBlock.js +27 -0
- package/dist/core/blocks/logic/LogicIfBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicIfBlock.js +36 -0
- package/dist/core/blocks/logic/LogicLogBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicLogBlock.js +30 -0
- package/dist/core/blocks/logic/LogicNotBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicNotBlock.js +26 -0
- package/dist/core/blocks/logic/LogicNumberBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicNumberBlock.js +26 -0
- package/dist/core/blocks/logic/LogicObjectBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicObjectBlock.js +28 -0
- package/dist/core/blocks/logic/LogicRepeatBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicRepeatBlock.js +27 -0
- package/dist/core/blocks/logic/LogicSetVariableBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicSetVariableBlock.js +34 -0
- package/dist/core/blocks/logic/LogicTextBlock.d.ts +14 -0
- package/dist/core/blocks/logic/LogicTextBlock.js +27 -0
- package/dist/core/blocks/logic/LogicTryCatchBlock.d.ts +13 -0
- package/dist/core/blocks/logic/LogicTryCatchBlock.js +26 -0
- package/dist/core/blocks/logic/index.d.ts +28 -0
- package/dist/core/blocks/logic/index.js +95 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleDescriptionBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleDescriptionBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleNameBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAccessibleNameBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttachedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttachedBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttributeBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertAttributeBlock.js +44 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCheckedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCheckedBlock.js +48 -0
- package/dist/core/blocks/playwright/assertions/WebAssertClassBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertClassBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCountBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCountBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCssBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertCssBlock.js +44 -0
- package/dist/core/blocks/playwright/assertions/WebAssertDisabledBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertDisabledBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEditableBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEditableBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEmptyBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEmptyBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEnabledBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertEnabledBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertFocusedBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertFocusedBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertIdBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertIdBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertInViewportBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertInViewportBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertNotVisibleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertNotVisibleBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertRoleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertRoleBlock.js +69 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextContainsBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTextEqualsBlock.js +41 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleContainsBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertTitleEqualsBlock.js +36 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlContainsBlock.js +40 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlEqualsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertUrlEqualsBlock.js +37 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueContainsBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertValueContainsBlock.js +43 -0
- package/dist/core/blocks/playwright/assertions/WebAssertVisibleBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/assertions/WebAssertVisibleBlock.js +39 -0
- package/dist/core/blocks/playwright/assertions/index.d.ts +36 -0
- package/dist/core/blocks/playwright/assertions/index.js +127 -0
- package/dist/core/blocks/playwright/index.d.ts +16 -0
- package/dist/core/blocks/playwright/index.js +28 -3
- package/dist/core/blocks/playwright/interactions/WebCheckboxBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebCheckboxBlock.js +43 -0
- package/dist/core/blocks/playwright/interactions/WebClickBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebClickBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebDragAndDropBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebDragAndDropBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebFillBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebFillBlock.js +38 -0
- package/dist/core/blocks/playwright/interactions/WebFocusBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebFocusBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebHoverBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebHoverBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebPressKeyBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebPressKeyBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebScrollIntoViewBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebScrollIntoViewBlock.js +34 -0
- package/dist/core/blocks/playwright/interactions/WebSelectBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebSelectBlock.js +37 -0
- package/dist/core/blocks/playwright/interactions/WebTypeBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebTypeBlock.js +41 -0
- package/dist/core/blocks/playwright/interactions/WebUploadFileBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/interactions/WebUploadFileBlock.js +39 -0
- package/dist/core/blocks/playwright/interactions/index.d.ts +21 -0
- package/dist/core/blocks/playwright/interactions/index.js +56 -0
- package/dist/core/blocks/playwright/navigation/WebNavigateBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebNavigateBlock.js +36 -0
- package/dist/core/blocks/playwright/navigation/WebScreenshotBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebScreenshotBlock.js +36 -0
- package/dist/core/blocks/playwright/navigation/WebWaitBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitBlock.js +32 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForElementBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForElementBlock.js +37 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForUrlBlock.d.ts +13 -0
- package/dist/core/blocks/playwright/navigation/WebWaitForUrlBlock.js +34 -0
- package/dist/core/blocks/playwright/navigation/index.d.ts +15 -0
- package/dist/core/blocks/playwright/navigation/index.js +32 -0
- package/dist/core/blocks/playwright/retrieval/WebCountElementsBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebCountElementsBlock.js +36 -0
- package/dist/core/blocks/playwright/retrieval/WebGetAttributeBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetAttributeBlock.js +42 -0
- package/dist/core/blocks/playwright/retrieval/WebGetInputValueBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetInputValueBlock.js +40 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTextBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTextBlock.js +40 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTitleBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetTitleBlock.js +31 -0
- package/dist/core/blocks/playwright/retrieval/WebGetUrlBlock.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/WebGetUrlBlock.js +31 -0
- package/dist/core/blocks/playwright/retrieval/index.d.ts +16 -0
- package/dist/core/blocks/playwright/retrieval/index.js +36 -0
- package/dist/core/blocks/playwright/types.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureCallBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureCallBlock.js +66 -0
- package/dist/core/blocks/procedures/ProcedureCallWithReturnBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureCallWithReturnBlock.js +51 -0
- package/dist/core/blocks/procedures/ProcedureDefineBlock.d.ts +15 -0
- package/dist/core/blocks/procedures/ProcedureDefineBlock.js +59 -0
- package/dist/core/blocks/procedures/ProcedureFillFormBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureFillFormBlock.js +30 -0
- package/dist/core/blocks/procedures/ProcedureGetParamBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureGetParamBlock.js +33 -0
- package/dist/core/blocks/procedures/ProcedureInlineBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureInlineBlock.js +31 -0
- package/dist/core/blocks/procedures/ProcedureLoginBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureLoginBlock.js +37 -0
- package/dist/core/blocks/procedures/ProcedureMapBlock.d.ts +14 -0
- package/dist/core/blocks/procedures/ProcedureMapBlock.js +36 -0
- package/dist/core/blocks/procedures/ProcedureReturnBlock.d.ts +15 -0
- package/dist/core/blocks/procedures/ProcedureReturnBlock.js +28 -0
- package/dist/core/blocks/procedures/ProcedureWaitAndClickBlock.d.ts +13 -0
- package/dist/core/blocks/procedures/ProcedureWaitAndClickBlock.js +32 -0
- package/dist/core/blocks/procedures/index.d.ts +21 -0
- package/dist/core/blocks/procedures/index.js +62 -0
- package/dist/core/blocks/{procedures.d.ts → procedures/procedureRegistry.d.ts} +10 -2
- package/dist/core/blocks/procedures/procedureRegistry.js +27 -0
- package/dist/core/blocks/utils/apiUtils.d.ts +81 -0
- package/dist/core/blocks/utils/apiUtils.js +176 -0
- package/dist/core/blocks/utils/index.d.ts +2 -0
- package/dist/core/blocks/utils/index.js +16 -0
- package/dist/core/blocks/utils/variableUtils.d.ts +19 -0
- package/dist/core/blocks/utils/variableUtils.js +69 -0
- package/dist/server/index.js +117 -11
- package/dist/server/openApiParser.d.ts +82 -0
- package/dist/server/openApiParser.js +495 -0
- package/dist/server/startServer.d.ts +1 -0
- package/dist/server/startServer.js +164 -0
- package/package.json +4 -2
- package/dist/client/assets/index-BLBBQ6Rn.js +0 -2195
- package/dist/client/assets/index-BLBBQ6Rn.js.map +0 -1
- package/dist/client/assets/index-qjoPPl9y.css +0 -1
- package/dist/core/blocks/api.d.ts +0 -2
- package/dist/core/blocks/api.js +0 -607
- package/dist/core/blocks/data-driven.d.ts +0 -2
- package/dist/core/blocks/data-driven.js +0 -245
- package/dist/core/blocks/lifecycle.d.ts +0 -2
- package/dist/core/blocks/lifecycle.js +0 -201
- package/dist/core/blocks/logic.d.ts +0 -2
- package/dist/core/blocks/logic.js +0 -360
- package/dist/core/blocks/playwright/assertions.d.ts +0 -5
- package/dist/core/blocks/playwright/assertions.js +0 -311
- package/dist/core/blocks/playwright/interactions.d.ts +0 -5
- package/dist/core/blocks/playwright/interactions.js +0 -208
- package/dist/core/blocks/playwright/navigation.d.ts +0 -5
- package/dist/core/blocks/playwright/navigation.js +0 -131
- package/dist/core/blocks/playwright/retrieval.d.ts +0 -5
- package/dist/core/blocks/playwright/retrieval.js +0 -153
- package/dist/core/blocks/playwright.d.ts +0 -13
- package/dist/core/blocks/playwright.js +0 -17
- package/dist/core/blocks/procedures.js +0 -321
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebWaitForElementBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Wait for an element to appear/disappear.
|
|
8
|
+
*/
|
|
9
|
+
class WebWaitForElementBlock extends base_1.StatementBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_wait_for_element';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#9C27B0';
|
|
15
|
+
this.tooltip = 'Wait for an element to appear/disappear';
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [
|
|
19
|
+
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
20
|
+
{ name: 'STATE', type: 'field', fieldType: 'dropdown', options: [['Visible', 'visible'], ['Hidden', 'hidden'], ['Attached', 'attached'], ['Detached', 'detached']] },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const page = context.page;
|
|
25
|
+
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
26
|
+
const state = params.STATE;
|
|
27
|
+
const timeout = (0, utils_1.getTimeout)(context);
|
|
28
|
+
context.logger.info(`Waiting for ${selector} to be ${state}`);
|
|
29
|
+
await page.waitForSelector(selector, { state, timeout });
|
|
30
|
+
return {
|
|
31
|
+
_summary: `${params.SELECTOR} is ${state}`,
|
|
32
|
+
selector,
|
|
33
|
+
state,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.WebWaitForElementBlock = WebWaitForElementBlock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Wait for URL to match.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebWaitForUrlBlock extends StatementBlock {
|
|
7
|
+
readonly type = "web_wait_for_url";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#9C27B0";
|
|
10
|
+
readonly tooltip = "Wait for URL to match";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebWaitForUrlBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Wait for URL to match.
|
|
8
|
+
*/
|
|
9
|
+
class WebWaitForUrlBlock extends base_1.StatementBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_wait_for_url';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#9C27B0';
|
|
15
|
+
this.tooltip = 'Wait for URL to match';
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [
|
|
19
|
+
{ name: 'URL', type: 'field', fieldType: 'text', required: true },
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
async execute(params, context) {
|
|
23
|
+
const page = context.page;
|
|
24
|
+
const url = (0, utils_1.resolveVariables)(params.URL, context);
|
|
25
|
+
const timeout = (0, utils_1.getTimeout)(context);
|
|
26
|
+
context.logger.info(`Waiting for URL to match: ${url}`);
|
|
27
|
+
await page.waitForURL(url, { timeout });
|
|
28
|
+
return {
|
|
29
|
+
_summary: url,
|
|
30
|
+
url,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.WebWaitForUrlBlock = WebWaitForUrlBlock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Block } from '../../base';
|
|
2
|
+
import { BlockDefinition } from '../../../types';
|
|
3
|
+
export { WebNavigateBlock } from './WebNavigateBlock';
|
|
4
|
+
export { WebWaitForElementBlock } from './WebWaitForElementBlock';
|
|
5
|
+
export { WebWaitForUrlBlock } from './WebWaitForUrlBlock';
|
|
6
|
+
export { WebWaitBlock } from './WebWaitBlock';
|
|
7
|
+
export { WebScreenshotBlock } from './WebScreenshotBlock';
|
|
8
|
+
/**
|
|
9
|
+
* All navigation block class instances.
|
|
10
|
+
*/
|
|
11
|
+
export declare const navigationBlockClasses: Block[];
|
|
12
|
+
/**
|
|
13
|
+
* Navigation blocks as BlockDefinition array for backward compatibility.
|
|
14
|
+
*/
|
|
15
|
+
export declare const navigationBlocks: BlockDefinition[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navigationBlocks = exports.navigationBlockClasses = exports.WebScreenshotBlock = exports.WebWaitBlock = exports.WebWaitForUrlBlock = exports.WebWaitForElementBlock = exports.WebNavigateBlock = void 0;
|
|
4
|
+
var WebNavigateBlock_1 = require("./WebNavigateBlock");
|
|
5
|
+
Object.defineProperty(exports, "WebNavigateBlock", { enumerable: true, get: function () { return WebNavigateBlock_1.WebNavigateBlock; } });
|
|
6
|
+
var WebWaitForElementBlock_1 = require("./WebWaitForElementBlock");
|
|
7
|
+
Object.defineProperty(exports, "WebWaitForElementBlock", { enumerable: true, get: function () { return WebWaitForElementBlock_1.WebWaitForElementBlock; } });
|
|
8
|
+
var WebWaitForUrlBlock_1 = require("./WebWaitForUrlBlock");
|
|
9
|
+
Object.defineProperty(exports, "WebWaitForUrlBlock", { enumerable: true, get: function () { return WebWaitForUrlBlock_1.WebWaitForUrlBlock; } });
|
|
10
|
+
var WebWaitBlock_1 = require("./WebWaitBlock");
|
|
11
|
+
Object.defineProperty(exports, "WebWaitBlock", { enumerable: true, get: function () { return WebWaitBlock_1.WebWaitBlock; } });
|
|
12
|
+
var WebScreenshotBlock_1 = require("./WebScreenshotBlock");
|
|
13
|
+
Object.defineProperty(exports, "WebScreenshotBlock", { enumerable: true, get: function () { return WebScreenshotBlock_1.WebScreenshotBlock; } });
|
|
14
|
+
const WebNavigateBlock_2 = require("./WebNavigateBlock");
|
|
15
|
+
const WebWaitForElementBlock_2 = require("./WebWaitForElementBlock");
|
|
16
|
+
const WebWaitForUrlBlock_2 = require("./WebWaitForUrlBlock");
|
|
17
|
+
const WebWaitBlock_2 = require("./WebWaitBlock");
|
|
18
|
+
const WebScreenshotBlock_2 = require("./WebScreenshotBlock");
|
|
19
|
+
/**
|
|
20
|
+
* All navigation block class instances.
|
|
21
|
+
*/
|
|
22
|
+
exports.navigationBlockClasses = [
|
|
23
|
+
new WebNavigateBlock_2.WebNavigateBlock(),
|
|
24
|
+
new WebWaitForElementBlock_2.WebWaitForElementBlock(),
|
|
25
|
+
new WebWaitForUrlBlock_2.WebWaitForUrlBlock(),
|
|
26
|
+
new WebWaitBlock_2.WebWaitBlock(),
|
|
27
|
+
new WebScreenshotBlock_2.WebScreenshotBlock(),
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Navigation blocks as BlockDefinition array for backward compatibility.
|
|
31
|
+
*/
|
|
32
|
+
exports.navigationBlocks = exports.navigationBlockClasses.map(block => block.toDefinition());
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Count the number of elements matching a selector.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebCountElementsBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_count_elements";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Count the number of elements matching a selector";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebCountElementsBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Count the number of elements matching a selector.
|
|
8
|
+
*/
|
|
9
|
+
class WebCountElementsBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_count_elements';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#2196F3';
|
|
15
|
+
this.tooltip = 'Count the number of elements matching a selector';
|
|
16
|
+
this.output = { type: 'Number' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const page = context.page;
|
|
25
|
+
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
26
|
+
const count = await page.locator(selector).count();
|
|
27
|
+
context.logger.debug(`Found ${count} elements matching ${selector}`);
|
|
28
|
+
return {
|
|
29
|
+
_summary: `${count} elements`,
|
|
30
|
+
_value: count,
|
|
31
|
+
selector,
|
|
32
|
+
count,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.WebCountElementsBlock = WebCountElementsBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get attribute value of an element (auto-waits).
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGetAttributeBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_get_attribute";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Get attribute value of an element (auto-waits)";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebGetAttributeBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Get attribute value of an element (auto-waits).
|
|
8
|
+
*/
|
|
9
|
+
class WebGetAttributeBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_get_attribute';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#2196F3';
|
|
15
|
+
this.tooltip = 'Get attribute value of an element (auto-waits)';
|
|
16
|
+
this.output = { type: 'String' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
{ name: 'ATTRIBUTE', type: 'field', fieldType: 'text', required: true },
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const page = context.page;
|
|
26
|
+
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
27
|
+
const attribute = params.ATTRIBUTE;
|
|
28
|
+
const timeout = (0, utils_1.getTimeout)(context);
|
|
29
|
+
const locator = page.locator(selector);
|
|
30
|
+
await locator.waitFor({ state: 'attached', timeout });
|
|
31
|
+
const value = await locator.getAttribute(attribute, { timeout });
|
|
32
|
+
context.logger.debug(`Attribute ${attribute} of ${selector}: "${value}"`);
|
|
33
|
+
return {
|
|
34
|
+
_summary: `${attribute} = "${value}"`,
|
|
35
|
+
_value: value,
|
|
36
|
+
selector,
|
|
37
|
+
attribute,
|
|
38
|
+
value,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.WebGetAttributeBlock = WebGetAttributeBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get current value of an input field (auto-waits).
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGetInputValueBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_get_input_value";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Get current value of an input field (auto-waits)";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebGetInputValueBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Get current value of an input field (auto-waits).
|
|
8
|
+
*/
|
|
9
|
+
class WebGetInputValueBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_get_input_value';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#2196F3';
|
|
15
|
+
this.tooltip = 'Get current value of an input field (auto-waits)';
|
|
16
|
+
this.output = { type: 'String' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const page = context.page;
|
|
25
|
+
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
26
|
+
const timeout = (0, utils_1.getTimeout)(context);
|
|
27
|
+
const locator = page.locator(selector);
|
|
28
|
+
await locator.waitFor({ state: 'visible', timeout });
|
|
29
|
+
const value = await locator.inputValue({ timeout });
|
|
30
|
+
context.logger.debug(`Input value of ${selector}: "${value}"`);
|
|
31
|
+
const displayValue = value.length > 40 ? value.substring(0, 40) + '...' : value;
|
|
32
|
+
return {
|
|
33
|
+
_summary: `"${displayValue}"`,
|
|
34
|
+
_value: value,
|
|
35
|
+
selector,
|
|
36
|
+
value,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.WebGetInputValueBlock = WebGetInputValueBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get text content of an element (auto-waits).
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGetTextBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_get_text";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Get text content of an element (auto-waits)";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebGetTextBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Get text content of an element (auto-waits).
|
|
8
|
+
*/
|
|
9
|
+
class WebGetTextBlock extends base_1.ValueBlock {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'web_get_text';
|
|
13
|
+
this.category = 'Web';
|
|
14
|
+
this.color = '#2196F3';
|
|
15
|
+
this.tooltip = 'Get text content of an element (auto-waits)';
|
|
16
|
+
this.output = { type: 'String' };
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async execute(params, context) {
|
|
24
|
+
const page = context.page;
|
|
25
|
+
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
26
|
+
const timeout = (0, utils_1.getTimeout)(context);
|
|
27
|
+
const locator = page.locator(selector);
|
|
28
|
+
await locator.waitFor({ state: 'visible', timeout });
|
|
29
|
+
const text = await locator.textContent({ timeout });
|
|
30
|
+
context.logger.debug(`Text content of ${selector}: "${text}"`);
|
|
31
|
+
const displayText = text && text.length > 40 ? text.substring(0, 40) + '...' : text;
|
|
32
|
+
return {
|
|
33
|
+
_summary: `"${displayText}"`,
|
|
34
|
+
_value: text,
|
|
35
|
+
selector,
|
|
36
|
+
text,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.WebGetTextBlock = WebGetTextBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get the page title.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGetTitleBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_get_title";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Get the page title";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(_params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebGetTitleBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
/**
|
|
6
|
+
* Get the page title.
|
|
7
|
+
*/
|
|
8
|
+
class WebGetTitleBlock extends base_1.ValueBlock {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.type = 'web_get_title';
|
|
12
|
+
this.category = 'Web';
|
|
13
|
+
this.color = '#2196F3';
|
|
14
|
+
this.tooltip = 'Get the page title';
|
|
15
|
+
this.output = { type: 'String' };
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
async execute(_params, context) {
|
|
21
|
+
const page = context.page;
|
|
22
|
+
const title = await page.title();
|
|
23
|
+
context.logger.debug(`Page title: "${title}"`);
|
|
24
|
+
return {
|
|
25
|
+
_summary: `"${title}"`,
|
|
26
|
+
_value: title,
|
|
27
|
+
title,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.WebGetTitleBlock = WebGetTitleBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValueBlock } from '../../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get the current URL.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGetUrlBlock extends ValueBlock {
|
|
7
|
+
readonly type = "web_get_url";
|
|
8
|
+
readonly category = "Web";
|
|
9
|
+
readonly color = "#2196F3";
|
|
10
|
+
readonly tooltip = "Get the current URL";
|
|
11
|
+
readonly output: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
getInputs(): BlockInput[];
|
|
15
|
+
execute(_params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebGetUrlBlock = void 0;
|
|
4
|
+
const base_1 = require("../../base");
|
|
5
|
+
/**
|
|
6
|
+
* Get the current URL.
|
|
7
|
+
*/
|
|
8
|
+
class WebGetUrlBlock extends base_1.ValueBlock {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.type = 'web_get_url';
|
|
12
|
+
this.category = 'Web';
|
|
13
|
+
this.color = '#2196F3';
|
|
14
|
+
this.tooltip = 'Get the current URL';
|
|
15
|
+
this.output = { type: 'String' };
|
|
16
|
+
}
|
|
17
|
+
getInputs() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
async execute(_params, context) {
|
|
21
|
+
const page = context.page;
|
|
22
|
+
const url = page.url();
|
|
23
|
+
context.logger.debug(`Current URL: "${url}"`);
|
|
24
|
+
return {
|
|
25
|
+
_summary: url,
|
|
26
|
+
_value: url,
|
|
27
|
+
url,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.WebGetUrlBlock = WebGetUrlBlock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Block } from '../../base';
|
|
2
|
+
import { BlockDefinition } from '../../../types';
|
|
3
|
+
export { WebGetTextBlock } from './WebGetTextBlock';
|
|
4
|
+
export { WebGetAttributeBlock } from './WebGetAttributeBlock';
|
|
5
|
+
export { WebGetInputValueBlock } from './WebGetInputValueBlock';
|
|
6
|
+
export { WebGetTitleBlock } from './WebGetTitleBlock';
|
|
7
|
+
export { WebGetUrlBlock } from './WebGetUrlBlock';
|
|
8
|
+
export { WebCountElementsBlock } from './WebCountElementsBlock';
|
|
9
|
+
/**
|
|
10
|
+
* All retrieval block class instances.
|
|
11
|
+
*/
|
|
12
|
+
export declare const retrievalBlockClasses: Block[];
|
|
13
|
+
/**
|
|
14
|
+
* Retrieval blocks as BlockDefinition array for backward compatibility.
|
|
15
|
+
*/
|
|
16
|
+
export declare const retrievalBlocks: BlockDefinition[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.retrievalBlocks = exports.retrievalBlockClasses = exports.WebCountElementsBlock = exports.WebGetUrlBlock = exports.WebGetTitleBlock = exports.WebGetInputValueBlock = exports.WebGetAttributeBlock = exports.WebGetTextBlock = void 0;
|
|
4
|
+
var WebGetTextBlock_1 = require("./WebGetTextBlock");
|
|
5
|
+
Object.defineProperty(exports, "WebGetTextBlock", { enumerable: true, get: function () { return WebGetTextBlock_1.WebGetTextBlock; } });
|
|
6
|
+
var WebGetAttributeBlock_1 = require("./WebGetAttributeBlock");
|
|
7
|
+
Object.defineProperty(exports, "WebGetAttributeBlock", { enumerable: true, get: function () { return WebGetAttributeBlock_1.WebGetAttributeBlock; } });
|
|
8
|
+
var WebGetInputValueBlock_1 = require("./WebGetInputValueBlock");
|
|
9
|
+
Object.defineProperty(exports, "WebGetInputValueBlock", { enumerable: true, get: function () { return WebGetInputValueBlock_1.WebGetInputValueBlock; } });
|
|
10
|
+
var WebGetTitleBlock_1 = require("./WebGetTitleBlock");
|
|
11
|
+
Object.defineProperty(exports, "WebGetTitleBlock", { enumerable: true, get: function () { return WebGetTitleBlock_1.WebGetTitleBlock; } });
|
|
12
|
+
var WebGetUrlBlock_1 = require("./WebGetUrlBlock");
|
|
13
|
+
Object.defineProperty(exports, "WebGetUrlBlock", { enumerable: true, get: function () { return WebGetUrlBlock_1.WebGetUrlBlock; } });
|
|
14
|
+
var WebCountElementsBlock_1 = require("./WebCountElementsBlock");
|
|
15
|
+
Object.defineProperty(exports, "WebCountElementsBlock", { enumerable: true, get: function () { return WebCountElementsBlock_1.WebCountElementsBlock; } });
|
|
16
|
+
const WebGetTextBlock_2 = require("./WebGetTextBlock");
|
|
17
|
+
const WebGetAttributeBlock_2 = require("./WebGetAttributeBlock");
|
|
18
|
+
const WebGetInputValueBlock_2 = require("./WebGetInputValueBlock");
|
|
19
|
+
const WebGetTitleBlock_2 = require("./WebGetTitleBlock");
|
|
20
|
+
const WebGetUrlBlock_2 = require("./WebGetUrlBlock");
|
|
21
|
+
const WebCountElementsBlock_2 = require("./WebCountElementsBlock");
|
|
22
|
+
/**
|
|
23
|
+
* All retrieval block class instances.
|
|
24
|
+
*/
|
|
25
|
+
exports.retrievalBlockClasses = [
|
|
26
|
+
new WebGetTextBlock_2.WebGetTextBlock(),
|
|
27
|
+
new WebGetAttributeBlock_2.WebGetAttributeBlock(),
|
|
28
|
+
new WebGetInputValueBlock_2.WebGetInputValueBlock(),
|
|
29
|
+
new WebGetTitleBlock_2.WebGetTitleBlock(),
|
|
30
|
+
new WebGetUrlBlock_2.WebGetUrlBlock(),
|
|
31
|
+
new WebCountElementsBlock_2.WebCountElementsBlock(),
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Retrieval blocks as BlockDefinition array for backward compatibility.
|
|
35
|
+
*/
|
|
36
|
+
exports.retrievalBlocks = exports.retrievalBlockClasses.map(block => block.toDefinition());
|
|
@@ -55,6 +55,20 @@ export interface PlaywrightLocator {
|
|
|
55
55
|
scrollIntoViewIfNeeded(options?: {
|
|
56
56
|
timeout?: number;
|
|
57
57
|
}): Promise<void>;
|
|
58
|
+
setInputFiles(files: string | string[] | {
|
|
59
|
+
name: string;
|
|
60
|
+
mimeType: string;
|
|
61
|
+
buffer: Buffer;
|
|
62
|
+
} | {
|
|
63
|
+
name: string;
|
|
64
|
+
mimeType: string;
|
|
65
|
+
buffer: Buffer;
|
|
66
|
+
}[], options?: {
|
|
67
|
+
timeout?: number;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
dragTo(target: PlaywrightLocator, options?: {
|
|
70
|
+
timeout?: number;
|
|
71
|
+
}): Promise<void>;
|
|
58
72
|
}
|
|
59
73
|
export interface PlaywrightPage {
|
|
60
74
|
goto(url: string, options?: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StatementBlock } from '../base';
|
|
2
|
+
import { BlockInput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Call a defined procedure.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProcedureCallBlock extends StatementBlock {
|
|
7
|
+
readonly type = "procedure_call";
|
|
8
|
+
readonly category = "Procedures";
|
|
9
|
+
readonly color = "#9C27B0";
|
|
10
|
+
readonly tooltip = "Call a defined procedure";
|
|
11
|
+
getInputs(): BlockInput[];
|
|
12
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcedureCallBlock = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const procedureRegistry_1 = require("./procedureRegistry");
|
|
7
|
+
/**
|
|
8
|
+
* Call a defined procedure.
|
|
9
|
+
*/
|
|
10
|
+
class ProcedureCallBlock extends base_1.StatementBlock {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.type = 'procedure_call';
|
|
14
|
+
this.category = 'Procedures';
|
|
15
|
+
this.color = '#9C27B0';
|
|
16
|
+
this.tooltip = 'Call a defined procedure';
|
|
17
|
+
}
|
|
18
|
+
getInputs() {
|
|
19
|
+
return [
|
|
20
|
+
{ name: 'NAME', type: 'field', fieldType: 'text', required: true },
|
|
21
|
+
{ name: 'ARGS', type: 'field', fieldType: 'text', default: '' }, // JSON object or comma-separated values
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
async execute(params, context) {
|
|
25
|
+
const name = params.NAME;
|
|
26
|
+
const argsStr = (0, utils_1.resolveVariables)(params.ARGS, context);
|
|
27
|
+
// Look up procedure
|
|
28
|
+
const procedure = context.procedures?.get(name) || (0, procedureRegistry_1.getProcedure)(name);
|
|
29
|
+
if (!procedure) {
|
|
30
|
+
throw new Error(`Procedure not found: ${name}`);
|
|
31
|
+
}
|
|
32
|
+
// Parse arguments
|
|
33
|
+
let args = {};
|
|
34
|
+
if (argsStr.trim()) {
|
|
35
|
+
try {
|
|
36
|
+
// Try JSON format first: {"username": "test", "password": "123"}
|
|
37
|
+
args = JSON.parse(argsStr);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Fall back to comma-separated values matching parameter order
|
|
41
|
+
const values = argsStr.split(',').map(v => {
|
|
42
|
+
const trimmed = v.trim();
|
|
43
|
+
try {
|
|
44
|
+
return JSON.parse(trimmed);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return trimmed;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (procedure.params) {
|
|
51
|
+
procedure.params.forEach((param, index) => {
|
|
52
|
+
if (index < values.length) {
|
|
53
|
+
args[param.name] = values[index];
|
|
54
|
+
}
|
|
55
|
+
else if (param.default !== undefined) {
|
|
56
|
+
args[param.name] = param.default;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
context.logger.info(`Calling procedure: ${name}`);
|
|
63
|
+
return { procedureCall: true, name, args, procedure };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.ProcedureCallBlock = ProcedureCallBlock;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValueBlock } from '../base';
|
|
2
|
+
import { BlockInput, BlockOutput, ExecutionContext } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Call a procedure and get return value.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProcedureCallWithReturnBlock extends ValueBlock {
|
|
7
|
+
readonly type = "procedure_call_with_return";
|
|
8
|
+
readonly category = "Procedures";
|
|
9
|
+
readonly color = "#9C27B0";
|
|
10
|
+
readonly tooltip = "Call a procedure and get return value";
|
|
11
|
+
readonly output: BlockOutput;
|
|
12
|
+
getInputs(): BlockInput[];
|
|
13
|
+
execute(params: Record<string, unknown>, context: ExecutionContext): Promise<unknown>;
|
|
14
|
+
}
|