@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
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logicBlocks = void 0;
|
|
4
|
-
const assertions_1 = require("./assertions");
|
|
5
|
-
// Logic and Control Flow Blocks
|
|
6
|
-
exports.logicBlocks = [
|
|
7
|
-
// Set Variable
|
|
8
|
-
{
|
|
9
|
-
type: 'logic_set_variable',
|
|
10
|
-
category: 'Logic',
|
|
11
|
-
color: '#795548',
|
|
12
|
-
tooltip: 'Set a variable value',
|
|
13
|
-
inputs: [
|
|
14
|
-
{ name: 'NAME', type: 'field', fieldType: 'text', required: true },
|
|
15
|
-
{ name: 'VALUE', type: 'value', required: true },
|
|
16
|
-
],
|
|
17
|
-
previousStatement: true,
|
|
18
|
-
nextStatement: true,
|
|
19
|
-
execute: async (params, context) => {
|
|
20
|
-
const name = params.NAME;
|
|
21
|
-
let value = params.VALUE;
|
|
22
|
-
// If the value is a block result with _value, extract just the value
|
|
23
|
-
if (value && typeof value === 'object' && '_value' in value) {
|
|
24
|
-
value = value._value;
|
|
25
|
-
}
|
|
26
|
-
context.variables.set(name, value);
|
|
27
|
-
context.logger.debug(`Set variable ${name} = ${JSON.stringify(value)}`);
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
// Get Variable
|
|
31
|
-
{
|
|
32
|
-
type: 'logic_get_variable',
|
|
33
|
-
category: 'Logic',
|
|
34
|
-
color: '#795548',
|
|
35
|
-
tooltip: 'Get a variable value',
|
|
36
|
-
inputs: [
|
|
37
|
-
{ name: 'NAME', type: 'field', fieldType: 'text', required: true },
|
|
38
|
-
],
|
|
39
|
-
output: { type: ['String', 'Number', 'Boolean', 'Object', 'Array'] },
|
|
40
|
-
execute: async (params, context) => {
|
|
41
|
-
const name = params.NAME;
|
|
42
|
-
return context.variables.get(name);
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
// If Condition
|
|
46
|
-
{
|
|
47
|
-
type: 'logic_if',
|
|
48
|
-
category: 'Logic',
|
|
49
|
-
color: '#5C6BC0',
|
|
50
|
-
tooltip: 'Execute blocks if condition is true',
|
|
51
|
-
inputs: [
|
|
52
|
-
{ name: 'CONDITION', type: 'value', check: 'Boolean', required: true },
|
|
53
|
-
{ name: 'DO', type: 'statement' },
|
|
54
|
-
{ name: 'ELSE', type: 'statement' },
|
|
55
|
-
],
|
|
56
|
-
previousStatement: true,
|
|
57
|
-
nextStatement: true,
|
|
58
|
-
execute: async (params, _context) => {
|
|
59
|
-
const condition = params.CONDITION;
|
|
60
|
-
if (condition && params.DO) {
|
|
61
|
-
// Execute DO block - handled by executor
|
|
62
|
-
return { branch: 'DO' };
|
|
63
|
-
}
|
|
64
|
-
else if (!condition && params.ELSE) {
|
|
65
|
-
// Execute ELSE block - handled by executor
|
|
66
|
-
return { branch: 'ELSE' };
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
// Compare Values
|
|
71
|
-
{
|
|
72
|
-
type: 'logic_compare',
|
|
73
|
-
category: 'Logic',
|
|
74
|
-
color: '#5C6BC0',
|
|
75
|
-
tooltip: 'Compare two values',
|
|
76
|
-
inputs: [
|
|
77
|
-
{ name: 'A', type: 'value', required: true },
|
|
78
|
-
{ name: 'OP', type: 'field', fieldType: 'dropdown', options: [['=', 'eq'], ['≠', 'neq'], ['<', 'lt'], ['≤', 'lte'], ['>', 'gt'], ['≥', 'gte'], ['contains', 'contains']] },
|
|
79
|
-
{ name: 'B', type: 'value', required: true },
|
|
80
|
-
],
|
|
81
|
-
output: { type: 'Boolean' },
|
|
82
|
-
execute: async (params, _context) => {
|
|
83
|
-
const a = params.A;
|
|
84
|
-
const b = params.B;
|
|
85
|
-
const op = params.OP;
|
|
86
|
-
switch (op) {
|
|
87
|
-
case 'eq':
|
|
88
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
89
|
-
case 'neq':
|
|
90
|
-
return JSON.stringify(a) !== JSON.stringify(b);
|
|
91
|
-
case 'lt':
|
|
92
|
-
return a < b;
|
|
93
|
-
case 'lte':
|
|
94
|
-
return a <= b;
|
|
95
|
-
case 'gt':
|
|
96
|
-
return a > b;
|
|
97
|
-
case 'gte':
|
|
98
|
-
return a >= b;
|
|
99
|
-
case 'contains':
|
|
100
|
-
if (typeof a === 'string')
|
|
101
|
-
return a.includes(b);
|
|
102
|
-
if (Array.isArray(a))
|
|
103
|
-
return a.includes(b);
|
|
104
|
-
return false;
|
|
105
|
-
default:
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
// Boolean Operations
|
|
111
|
-
{
|
|
112
|
-
type: 'logic_boolean_op',
|
|
113
|
-
category: 'Logic',
|
|
114
|
-
color: '#5C6BC0',
|
|
115
|
-
tooltip: 'Combine boolean values',
|
|
116
|
-
inputs: [
|
|
117
|
-
{ name: 'A', type: 'value', check: 'Boolean', required: true },
|
|
118
|
-
{ name: 'OP', type: 'field', fieldType: 'dropdown', options: [['and', 'and'], ['or', 'or']] },
|
|
119
|
-
{ name: 'B', type: 'value', check: 'Boolean', required: true },
|
|
120
|
-
],
|
|
121
|
-
output: { type: 'Boolean' },
|
|
122
|
-
execute: async (params) => {
|
|
123
|
-
const a = params.A;
|
|
124
|
-
const b = params.B;
|
|
125
|
-
const op = params.OP;
|
|
126
|
-
return op === 'and' ? a && b : a || b;
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
// Not
|
|
130
|
-
{
|
|
131
|
-
type: 'logic_not',
|
|
132
|
-
category: 'Logic',
|
|
133
|
-
color: '#5C6BC0',
|
|
134
|
-
tooltip: 'Negate a boolean value',
|
|
135
|
-
inputs: [
|
|
136
|
-
{ name: 'VALUE', type: 'value', check: 'Boolean', required: true },
|
|
137
|
-
],
|
|
138
|
-
output: { type: 'Boolean' },
|
|
139
|
-
execute: async (params) => {
|
|
140
|
-
return !params.VALUE;
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
// Loop (repeat n times)
|
|
144
|
-
{
|
|
145
|
-
type: 'logic_repeat',
|
|
146
|
-
category: 'Logic',
|
|
147
|
-
color: '#5C6BC0',
|
|
148
|
-
tooltip: 'Repeat blocks a specified number of times',
|
|
149
|
-
inputs: [
|
|
150
|
-
{ name: 'TIMES', type: 'field', fieldType: 'number', default: 10, required: true },
|
|
151
|
-
{ name: 'DO', type: 'statement' },
|
|
152
|
-
],
|
|
153
|
-
previousStatement: true,
|
|
154
|
-
nextStatement: true,
|
|
155
|
-
execute: async (params, _context) => {
|
|
156
|
-
const times = params.TIMES;
|
|
157
|
-
return { loop: true, times, statement: 'DO' };
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
// For Each
|
|
161
|
-
{
|
|
162
|
-
type: 'logic_foreach',
|
|
163
|
-
category: 'Logic',
|
|
164
|
-
color: '#5C6BC0',
|
|
165
|
-
tooltip: 'Iterate over an array',
|
|
166
|
-
inputs: [
|
|
167
|
-
{ name: 'ARRAY', type: 'value', check: 'Array', required: true },
|
|
168
|
-
{ name: 'VAR', type: 'field', fieldType: 'text', default: 'item', required: true },
|
|
169
|
-
{ name: 'DO', type: 'statement' },
|
|
170
|
-
],
|
|
171
|
-
previousStatement: true,
|
|
172
|
-
nextStatement: true,
|
|
173
|
-
execute: async (params, _context) => {
|
|
174
|
-
const array = params.ARRAY;
|
|
175
|
-
const varName = params.VAR;
|
|
176
|
-
return { loop: true, array, varName, statement: 'DO' };
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
// Try/Catch
|
|
180
|
-
{
|
|
181
|
-
type: 'logic_try_catch',
|
|
182
|
-
category: 'Logic',
|
|
183
|
-
color: '#5C6BC0',
|
|
184
|
-
tooltip: 'Handle errors gracefully',
|
|
185
|
-
inputs: [
|
|
186
|
-
{ name: 'TRY', type: 'statement' },
|
|
187
|
-
{ name: 'CATCH', type: 'statement' },
|
|
188
|
-
],
|
|
189
|
-
previousStatement: true,
|
|
190
|
-
nextStatement: true,
|
|
191
|
-
execute: async (_params, _context) => {
|
|
192
|
-
return { tryCatch: true };
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
// Log Message
|
|
196
|
-
{
|
|
197
|
-
type: 'logic_log',
|
|
198
|
-
category: 'Logic',
|
|
199
|
-
color: '#607D8B',
|
|
200
|
-
tooltip: 'Log a message',
|
|
201
|
-
inputs: [
|
|
202
|
-
{ name: 'LEVEL', type: 'field', fieldType: 'dropdown', options: [['Info', 'info'], ['Warning', 'warn'], ['Error', 'error'], ['Debug', 'debug']] },
|
|
203
|
-
{ name: 'MESSAGE', type: 'field', fieldType: 'text', required: true },
|
|
204
|
-
],
|
|
205
|
-
previousStatement: true,
|
|
206
|
-
nextStatement: true,
|
|
207
|
-
execute: async (params, context) => {
|
|
208
|
-
const level = params.LEVEL || 'info';
|
|
209
|
-
const message = resolveVariables(params.MESSAGE, context);
|
|
210
|
-
context.logger[level](message);
|
|
211
|
-
return { _message: message, _summary: message };
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
// Comment (no-op, for documentation)
|
|
215
|
-
{
|
|
216
|
-
type: 'logic_comment',
|
|
217
|
-
category: 'Logic',
|
|
218
|
-
color: '#9E9E9E',
|
|
219
|
-
tooltip: 'Add a comment (does nothing)',
|
|
220
|
-
inputs: [
|
|
221
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', default: 'Comment' },
|
|
222
|
-
],
|
|
223
|
-
previousStatement: true,
|
|
224
|
-
nextStatement: true,
|
|
225
|
-
execute: async () => {
|
|
226
|
-
// No-op
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
// Text/String block
|
|
230
|
-
{
|
|
231
|
-
type: 'logic_text',
|
|
232
|
-
category: 'Logic',
|
|
233
|
-
color: '#795548',
|
|
234
|
-
tooltip: 'A text value',
|
|
235
|
-
inputs: [
|
|
236
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', default: '' },
|
|
237
|
-
],
|
|
238
|
-
output: { type: 'String' },
|
|
239
|
-
execute: async (params, context) => {
|
|
240
|
-
return resolveVariables(params.TEXT, context);
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
// Number block
|
|
244
|
-
{
|
|
245
|
-
type: 'logic_number',
|
|
246
|
-
category: 'Logic',
|
|
247
|
-
color: '#795548',
|
|
248
|
-
tooltip: 'A number value',
|
|
249
|
-
inputs: [
|
|
250
|
-
{ name: 'NUM', type: 'field', fieldType: 'number', default: 0 },
|
|
251
|
-
],
|
|
252
|
-
output: { type: 'Number' },
|
|
253
|
-
execute: async (params) => {
|
|
254
|
-
return params.NUM;
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
// Boolean block
|
|
258
|
-
{
|
|
259
|
-
type: 'logic_boolean',
|
|
260
|
-
category: 'Logic',
|
|
261
|
-
color: '#795548',
|
|
262
|
-
tooltip: 'A boolean value',
|
|
263
|
-
inputs: [
|
|
264
|
-
{ name: 'BOOL', type: 'field', fieldType: 'dropdown', options: [['true', 'true'], ['false', 'false']] },
|
|
265
|
-
],
|
|
266
|
-
output: { type: 'Boolean' },
|
|
267
|
-
execute: async (params) => {
|
|
268
|
-
return params.BOOL === 'true';
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
// Create Object
|
|
272
|
-
{
|
|
273
|
-
type: 'logic_object',
|
|
274
|
-
category: 'Logic',
|
|
275
|
-
color: '#795548',
|
|
276
|
-
tooltip: 'Create a JSON object',
|
|
277
|
-
inputs: [
|
|
278
|
-
{ name: 'JSON', type: 'field', fieldType: 'text', default: '{}' },
|
|
279
|
-
],
|
|
280
|
-
output: { type: 'Object' },
|
|
281
|
-
execute: async (params, context) => {
|
|
282
|
-
const json = resolveVariables(params.JSON, context);
|
|
283
|
-
return JSON.parse(json);
|
|
284
|
-
},
|
|
285
|
-
},
|
|
286
|
-
// Create Array
|
|
287
|
-
{
|
|
288
|
-
type: 'logic_array',
|
|
289
|
-
category: 'Logic',
|
|
290
|
-
color: '#795548',
|
|
291
|
-
tooltip: 'Create an array',
|
|
292
|
-
inputs: [
|
|
293
|
-
{ name: 'JSON', type: 'field', fieldType: 'text', default: '[]' },
|
|
294
|
-
],
|
|
295
|
-
output: { type: 'Array' },
|
|
296
|
-
execute: async (params, context) => {
|
|
297
|
-
const json = resolveVariables(params.JSON, context);
|
|
298
|
-
return JSON.parse(json);
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
// Fail Test
|
|
302
|
-
{
|
|
303
|
-
type: 'logic_fail',
|
|
304
|
-
category: 'Logic',
|
|
305
|
-
color: '#f44336',
|
|
306
|
-
tooltip: 'Fail the test with a message',
|
|
307
|
-
inputs: [
|
|
308
|
-
{ name: 'MESSAGE', type: 'field', fieldType: 'text', default: 'Test failed' },
|
|
309
|
-
],
|
|
310
|
-
previousStatement: true,
|
|
311
|
-
execute: async (params, context) => {
|
|
312
|
-
const message = resolveVariables(params.MESSAGE, context);
|
|
313
|
-
throw new Error(message);
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
// Assert
|
|
317
|
-
{
|
|
318
|
-
type: 'logic_assert',
|
|
319
|
-
category: 'Logic',
|
|
320
|
-
color: '#FF9800',
|
|
321
|
-
tooltip: 'Assert a condition is true',
|
|
322
|
-
inputs: [
|
|
323
|
-
{ name: 'CONDITION', type: 'value', check: 'Boolean', required: true },
|
|
324
|
-
{ name: 'MESSAGE', type: 'field', fieldType: 'text', default: 'Assertion failed' },
|
|
325
|
-
],
|
|
326
|
-
previousStatement: true,
|
|
327
|
-
nextStatement: true,
|
|
328
|
-
execute: async (params, context) => {
|
|
329
|
-
const condition = params.CONDITION;
|
|
330
|
-
const message = resolveVariables(params.MESSAGE, context);
|
|
331
|
-
(0, assertions_1.handleAssertion)(context, condition, message, { stepType: 'logic_assert', expected: true, actual: condition });
|
|
332
|
-
context.logger.info('✓ Assertion passed');
|
|
333
|
-
},
|
|
334
|
-
},
|
|
335
|
-
];
|
|
336
|
-
// Helper function
|
|
337
|
-
function resolveVariables(text, context) {
|
|
338
|
-
// Match ${varName} or ${varName.property.path}
|
|
339
|
-
return text.replace(/\$\{([\w.]+)\}/g, (match, path) => {
|
|
340
|
-
const parts = path.split('.');
|
|
341
|
-
const varName = parts[0];
|
|
342
|
-
let value = context.variables.get(varName);
|
|
343
|
-
// Navigate through object properties if path has dots
|
|
344
|
-
if (parts.length > 1 && value !== undefined && value !== null) {
|
|
345
|
-
for (let i = 1; i < parts.length; i++) {
|
|
346
|
-
if (value === undefined || value === null)
|
|
347
|
-
break;
|
|
348
|
-
value = value[parts[i]];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
if (value === undefined || value === null) {
|
|
352
|
-
return match; // Keep original if not found
|
|
353
|
-
}
|
|
354
|
-
// Return stringified value
|
|
355
|
-
if (typeof value === 'object') {
|
|
356
|
-
return JSON.stringify(value);
|
|
357
|
-
}
|
|
358
|
-
return String(value);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertionBlocks = void 0;
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
/**
|
|
6
|
-
* Assertion blocks for Playwright (visibility, text, values)
|
|
7
|
-
*/
|
|
8
|
-
exports.assertionBlocks = [
|
|
9
|
-
// Assert Element Visible
|
|
10
|
-
{
|
|
11
|
-
type: 'web_assert_visible',
|
|
12
|
-
category: 'Web',
|
|
13
|
-
color: '#FF9800',
|
|
14
|
-
tooltip: 'Assert that an element is visible (auto-waits)',
|
|
15
|
-
inputs: [
|
|
16
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
17
|
-
],
|
|
18
|
-
previousStatement: true,
|
|
19
|
-
nextStatement: true,
|
|
20
|
-
execute: async (params, context) => {
|
|
21
|
-
const page = context.page;
|
|
22
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
23
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
24
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
25
|
-
const expect = await (0, utils_1.getExpect)();
|
|
26
|
-
const locator = page.locator(selector);
|
|
27
|
-
context.logger.info(`Asserting ${displaySelector} is visible`);
|
|
28
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(locator).toBeVisible({ timeout }); }, `Expected element ${displaySelector} to be visible`, { stepType: 'web_assert_visible', expected: 'visible', actual: 'not visible' });
|
|
29
|
-
context.logger.info(`✓ Element ${displaySelector} is visible`);
|
|
30
|
-
return {
|
|
31
|
-
_summary: `${displaySelector} is visible`,
|
|
32
|
-
selector,
|
|
33
|
-
isVisible: true,
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
// Assert Element Not Visible
|
|
38
|
-
{
|
|
39
|
-
type: 'web_assert_not_visible',
|
|
40
|
-
category: 'Web',
|
|
41
|
-
color: '#FF9800',
|
|
42
|
-
tooltip: 'Assert that an element is not visible (auto-waits)',
|
|
43
|
-
inputs: [
|
|
44
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
45
|
-
],
|
|
46
|
-
previousStatement: true,
|
|
47
|
-
nextStatement: true,
|
|
48
|
-
execute: async (params, context) => {
|
|
49
|
-
const page = context.page;
|
|
50
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
51
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
52
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
53
|
-
const expect = await (0, utils_1.getExpect)();
|
|
54
|
-
const locator = page.locator(selector);
|
|
55
|
-
context.logger.info(`Asserting ${displaySelector} is not visible`);
|
|
56
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(locator).toBeHidden({ timeout }); }, `Expected element ${displaySelector} to be hidden`, { stepType: 'web_assert_not_visible', expected: 'hidden', actual: 'visible' });
|
|
57
|
-
context.logger.info(`✓ Element ${displaySelector} is not visible`);
|
|
58
|
-
return {
|
|
59
|
-
_summary: `${displaySelector} is not visible`,
|
|
60
|
-
selector,
|
|
61
|
-
isVisible: false,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
// Assert Text Contains
|
|
66
|
-
{
|
|
67
|
-
type: 'web_assert_text_contains',
|
|
68
|
-
category: 'Web',
|
|
69
|
-
color: '#FF9800',
|
|
70
|
-
tooltip: 'Assert that element text contains expected value (auto-waits)',
|
|
71
|
-
inputs: [
|
|
72
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
73
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', required: true },
|
|
74
|
-
],
|
|
75
|
-
previousStatement: true,
|
|
76
|
-
nextStatement: true,
|
|
77
|
-
execute: async (params, context) => {
|
|
78
|
-
const page = context.page;
|
|
79
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
80
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
81
|
-
const expectedText = (0, utils_1.resolveVariables)(params.TEXT, context);
|
|
82
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
83
|
-
const expect = await (0, utils_1.getExpect)();
|
|
84
|
-
const locator = page.locator(selector);
|
|
85
|
-
context.logger.info(`Asserting ${displaySelector} contains "${expectedText}"`);
|
|
86
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(locator).toContainText(expectedText, { timeout }); }, `Expected element ${displaySelector} to contain text "${expectedText}"`, { stepType: 'web_assert_text_contains', expected: expectedText });
|
|
87
|
-
context.logger.info(`✓ Element ${displaySelector} contains text "${expectedText}"`);
|
|
88
|
-
return {
|
|
89
|
-
_summary: `"${expectedText}" found`,
|
|
90
|
-
selector,
|
|
91
|
-
expectedText,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
// Assert Text Equals
|
|
96
|
-
{
|
|
97
|
-
type: 'web_assert_text_equals',
|
|
98
|
-
category: 'Web',
|
|
99
|
-
color: '#FF9800',
|
|
100
|
-
tooltip: 'Assert that element text equals expected value (auto-waits)',
|
|
101
|
-
inputs: [
|
|
102
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
103
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', required: true },
|
|
104
|
-
],
|
|
105
|
-
previousStatement: true,
|
|
106
|
-
nextStatement: true,
|
|
107
|
-
execute: async (params, context) => {
|
|
108
|
-
const page = context.page;
|
|
109
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
110
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
111
|
-
const expectedText = (0, utils_1.resolveVariables)(params.TEXT, context);
|
|
112
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
113
|
-
const expect = await (0, utils_1.getExpect)();
|
|
114
|
-
const locator = page.locator(selector);
|
|
115
|
-
context.logger.info(`Asserting ${displaySelector} text equals "${expectedText}"`);
|
|
116
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(locator).toHaveText(expectedText, { timeout }); }, `Expected element ${displaySelector} text to equal "${expectedText}"`, { stepType: 'web_assert_text_equals', expected: expectedText });
|
|
117
|
-
context.logger.info(`✓ Element ${displaySelector} text equals "${expectedText}"`);
|
|
118
|
-
return {
|
|
119
|
-
_summary: `"${expectedText}" matches`,
|
|
120
|
-
selector,
|
|
121
|
-
expectedText,
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
// Assert URL Contains
|
|
126
|
-
{
|
|
127
|
-
type: 'web_assert_url_contains',
|
|
128
|
-
category: 'Web',
|
|
129
|
-
color: '#FF9800',
|
|
130
|
-
tooltip: 'Assert that current URL contains expected value (auto-waits)',
|
|
131
|
-
inputs: [
|
|
132
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', required: true },
|
|
133
|
-
],
|
|
134
|
-
previousStatement: true,
|
|
135
|
-
nextStatement: true,
|
|
136
|
-
execute: async (params, context) => {
|
|
137
|
-
const page = context.page;
|
|
138
|
-
const expectedText = (0, utils_1.resolveVariables)(params.TEXT, context);
|
|
139
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
140
|
-
const expect = await (0, utils_1.getExpect)();
|
|
141
|
-
// Escape special regex characters and create a regex pattern
|
|
142
|
-
const escapedText = expectedText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
143
|
-
const urlPattern = new RegExp(escapedText);
|
|
144
|
-
context.logger.info(`Asserting URL contains "${expectedText}"`);
|
|
145
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(page).toHaveURL(urlPattern, { timeout }); }, `Expected URL to contain "${expectedText}"`, { stepType: 'web_assert_url_contains', expected: expectedText, actual: page.url() });
|
|
146
|
-
context.logger.info(`✓ URL contains "${expectedText}"`);
|
|
147
|
-
return {
|
|
148
|
-
_summary: `"${expectedText}" in URL`,
|
|
149
|
-
expectedText,
|
|
150
|
-
actualUrl: page.url(),
|
|
151
|
-
};
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
// Assert Title Contains
|
|
155
|
-
{
|
|
156
|
-
type: 'web_assert_title_contains',
|
|
157
|
-
category: 'Web',
|
|
158
|
-
color: '#FF9800',
|
|
159
|
-
tooltip: 'Assert that page title contains expected value (auto-waits)',
|
|
160
|
-
inputs: [
|
|
161
|
-
{ name: 'TEXT', type: 'field', fieldType: 'text', required: true },
|
|
162
|
-
],
|
|
163
|
-
previousStatement: true,
|
|
164
|
-
nextStatement: true,
|
|
165
|
-
execute: async (params, context) => {
|
|
166
|
-
const page = context.page;
|
|
167
|
-
const expectedText = (0, utils_1.resolveVariables)(params.TEXT, context);
|
|
168
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
169
|
-
const expect = await (0, utils_1.getExpect)();
|
|
170
|
-
// Escape special regex characters and create a regex pattern
|
|
171
|
-
const escapedText = expectedText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
172
|
-
const titlePattern = new RegExp(escapedText);
|
|
173
|
-
context.logger.info(`Asserting title contains "${expectedText}"`);
|
|
174
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(page).toHaveTitle(titlePattern, { timeout }); }, `Expected title to contain "${expectedText}"`, { stepType: 'web_assert_title_contains', expected: expectedText });
|
|
175
|
-
context.logger.info(`✓ Title contains "${expectedText}"`);
|
|
176
|
-
return {
|
|
177
|
-
_summary: `"${expectedText}" in title`,
|
|
178
|
-
expectedText,
|
|
179
|
-
};
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
// Assert Element Enabled
|
|
183
|
-
{
|
|
184
|
-
type: 'web_assert_enabled',
|
|
185
|
-
category: 'Web',
|
|
186
|
-
color: '#FF9800',
|
|
187
|
-
tooltip: 'Assert that an element is enabled (auto-waits)',
|
|
188
|
-
inputs: [
|
|
189
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
190
|
-
],
|
|
191
|
-
previousStatement: true,
|
|
192
|
-
nextStatement: true,
|
|
193
|
-
execute: async (params, context) => {
|
|
194
|
-
const page = context.page;
|
|
195
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
196
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
197
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
198
|
-
const expect = await (0, utils_1.getExpect)();
|
|
199
|
-
const locator = page.locator(selector);
|
|
200
|
-
context.logger.info(`Asserting ${displaySelector} is enabled`);
|
|
201
|
-
await (0, utils_1.executeWebAssertion)(context, async () => { await expect(locator).toBeEnabled({ timeout }); }, `Expected element ${displaySelector} to be enabled`, { stepType: 'web_assert_enabled', expected: 'enabled', actual: 'disabled' });
|
|
202
|
-
context.logger.info(`✓ Element ${displaySelector} is enabled`);
|
|
203
|
-
return {
|
|
204
|
-
_summary: `${displaySelector} is enabled`,
|
|
205
|
-
selector,
|
|
206
|
-
isEnabled: true,
|
|
207
|
-
};
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
// Assert Checkbox Checked
|
|
211
|
-
{
|
|
212
|
-
type: 'web_assert_checked',
|
|
213
|
-
category: 'Web',
|
|
214
|
-
color: '#FF9800',
|
|
215
|
-
tooltip: 'Assert that a checkbox is checked (auto-waits)',
|
|
216
|
-
inputs: [
|
|
217
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
218
|
-
{ name: 'EXPECTED', type: 'field', fieldType: 'checkbox', default: true },
|
|
219
|
-
],
|
|
220
|
-
previousStatement: true,
|
|
221
|
-
nextStatement: true,
|
|
222
|
-
execute: async (params, context) => {
|
|
223
|
-
const page = context.page;
|
|
224
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
225
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
226
|
-
const expected = params.EXPECTED;
|
|
227
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
228
|
-
const expect = await (0, utils_1.getExpect)();
|
|
229
|
-
const locator = page.locator(selector);
|
|
230
|
-
context.logger.info(`Asserting ${displaySelector} is ${expected ? 'checked' : 'unchecked'}`);
|
|
231
|
-
await (0, utils_1.executeWebAssertion)(context, async () => {
|
|
232
|
-
if (expected) {
|
|
233
|
-
await expect(locator).toBeChecked({ timeout });
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
await expect(locator).not.toBeChecked({ timeout });
|
|
237
|
-
}
|
|
238
|
-
}, `Expected checkbox ${displaySelector} to be ${expected ? 'checked' : 'unchecked'}`, { stepType: 'web_assert_checked', expected: expected ? 'checked' : 'unchecked' });
|
|
239
|
-
context.logger.info(`✓ Checkbox ${displaySelector} is ${expected ? 'checked' : 'unchecked'}`);
|
|
240
|
-
return {
|
|
241
|
-
_summary: `${displaySelector} is ${expected ? 'checked' : 'unchecked'}`,
|
|
242
|
-
selector,
|
|
243
|
-
expected,
|
|
244
|
-
};
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
// Assert Input Value
|
|
248
|
-
{
|
|
249
|
-
type: 'web_assert_value',
|
|
250
|
-
category: 'Web',
|
|
251
|
-
color: '#FF9800',
|
|
252
|
-
tooltip: 'Assert that an input field has a specific value (auto-waits)',
|
|
253
|
-
inputs: [
|
|
254
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
255
|
-
{ name: 'VALUE', type: 'field', fieldType: 'text', required: true },
|
|
256
|
-
],
|
|
257
|
-
previousStatement: true,
|
|
258
|
-
nextStatement: true,
|
|
259
|
-
execute: async (params, context) => {
|
|
260
|
-
const page = context.page;
|
|
261
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
262
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
263
|
-
const expectedValue = (0, utils_1.resolveVariables)(params.VALUE, context);
|
|
264
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
265
|
-
const expect = await (0, utils_1.getExpect)();
|
|
266
|
-
const locator = page.locator(selector);
|
|
267
|
-
context.logger.info(`Asserting ${displaySelector} has value "${expectedValue}"`);
|
|
268
|
-
await (0, utils_1.executeWebAssertion)(context, async () => {
|
|
269
|
-
await expect(locator).toHaveValue(expectedValue, { timeout });
|
|
270
|
-
}, `Expected input ${displaySelector} to have value "${expectedValue}"`, { stepType: 'web_assert_value', expected: expectedValue });
|
|
271
|
-
context.logger.info(`✓ Input ${displaySelector} has value "${expectedValue}"`);
|
|
272
|
-
return {
|
|
273
|
-
_summary: `${displaySelector} = "${expectedValue}"`,
|
|
274
|
-
selector,
|
|
275
|
-
expected: expectedValue,
|
|
276
|
-
};
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
// Assert Input Value Contains
|
|
280
|
-
{
|
|
281
|
-
type: 'web_assert_value_contains',
|
|
282
|
-
category: 'Web',
|
|
283
|
-
color: '#FF9800',
|
|
284
|
-
tooltip: 'Assert that an input field value contains specific text (auto-waits)',
|
|
285
|
-
inputs: [
|
|
286
|
-
{ name: 'SELECTOR', type: 'field', fieldType: 'text', required: true },
|
|
287
|
-
{ name: 'VALUE', type: 'field', fieldType: 'text', required: true },
|
|
288
|
-
],
|
|
289
|
-
previousStatement: true,
|
|
290
|
-
nextStatement: true,
|
|
291
|
-
execute: async (params, context) => {
|
|
292
|
-
const page = context.page;
|
|
293
|
-
const selector = (0, utils_1.resolveSelector)(params, context);
|
|
294
|
-
const displaySelector = (0, utils_1.getDisplaySelector)(params, context);
|
|
295
|
-
const expectedValue = (0, utils_1.resolveVariables)(params.VALUE, context);
|
|
296
|
-
const timeout = (0, utils_1.getTimeout)(context);
|
|
297
|
-
const expect = await (0, utils_1.getExpect)();
|
|
298
|
-
const locator = page.locator(selector);
|
|
299
|
-
context.logger.info(`Asserting ${displaySelector} value contains "${expectedValue}"`);
|
|
300
|
-
await (0, utils_1.executeWebAssertion)(context, async () => {
|
|
301
|
-
await expect(locator).toHaveValue(new RegExp(expectedValue), { timeout });
|
|
302
|
-
}, `Expected input ${displaySelector} value to contain "${expectedValue}"`, { stepType: 'web_assert_value_contains', expected: expectedValue });
|
|
303
|
-
context.logger.info(`✓ Input ${displaySelector} value contains "${expectedValue}"`);
|
|
304
|
-
return {
|
|
305
|
-
_summary: `${displaySelector} contains "${expectedValue}"`,
|
|
306
|
-
selector,
|
|
307
|
-
expected: expectedValue,
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
];
|