@testsmith/testblocks 0.6.0 → 0.8.0
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/executor.d.ts +4 -1
- package/dist/cli/executor.js +101 -5
- package/dist/cli/index.js +148 -4
- package/dist/cli/reporters/ConsoleReporter.d.ts +12 -0
- package/dist/cli/reporters/ConsoleReporter.js +39 -0
- package/dist/cli/reporters/HTMLReporter.d.ts +19 -0
- package/dist/cli/reporters/HTMLReporter.js +506 -0
- package/dist/cli/reporters/JSONReporter.d.ts +15 -0
- package/dist/cli/reporters/JSONReporter.js +80 -0
- package/dist/cli/reporters/JUnitReporter.d.ts +19 -0
- package/dist/cli/reporters/JUnitReporter.js +105 -0
- package/dist/cli/reporters/index.d.ts +17 -0
- package/dist/cli/reporters/index.js +31 -0
- package/dist/cli/reporters/types.d.ts +28 -0
- package/dist/cli/reporters/types.js +2 -0
- package/dist/cli/reporters/utils.d.ts +31 -0
- package/dist/cli/reporters/utils.js +136 -0
- package/dist/cli/reporters.d.ts +13 -62
- package/dist/cli/reporters.js +16 -719
- package/dist/client/assets/index-Boo8ZrY_.js +2195 -0
- package/dist/client/assets/{index-dXniUrbi.js.map → index-Boo8ZrY_.js.map} +1 -1
- package/dist/client/assets/index-OxNH9dW-.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/core/blocks/api.js +3 -6
- package/dist/core/blocks/assertions.d.ts +31 -0
- package/dist/core/blocks/assertions.js +72 -0
- package/dist/core/blocks/index.d.ts +1 -0
- package/dist/core/blocks/index.js +6 -1
- package/dist/core/blocks/lifecycle.js +5 -3
- package/dist/core/blocks/logic.js +2 -3
- package/dist/core/blocks/playwright/assertions.d.ts +5 -0
- package/dist/core/blocks/playwright/assertions.js +321 -0
- package/dist/core/blocks/playwright/index.d.ts +17 -0
- package/dist/core/blocks/playwright/index.js +49 -0
- package/dist/core/blocks/playwright/interactions.d.ts +5 -0
- package/dist/core/blocks/playwright/interactions.js +191 -0
- package/dist/core/blocks/playwright/navigation.d.ts +5 -0
- package/dist/core/blocks/playwright/navigation.js +133 -0
- package/dist/core/blocks/playwright/retrieval.d.ts +5 -0
- package/dist/core/blocks/playwright/retrieval.js +144 -0
- package/dist/core/blocks/playwright/types.d.ts +65 -0
- package/dist/core/blocks/playwright/types.js +5 -0
- package/dist/core/blocks/playwright/utils.d.ts +26 -0
- package/dist/core/blocks/playwright/utils.js +137 -0
- package/dist/core/blocks/playwright.d.ts +13 -2
- package/dist/core/blocks/playwright.js +14 -761
- package/dist/core/executor/BaseTestExecutor.d.ts +60 -0
- package/dist/core/executor/BaseTestExecutor.js +297 -0
- package/dist/core/executor/index.d.ts +1 -0
- package/dist/core/executor/index.js +5 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/types.d.ts +12 -0
- package/dist/core/utils/blocklyParser.d.ts +18 -0
- package/dist/core/utils/blocklyParser.js +84 -0
- package/dist/core/utils/dataLoader.d.ts +9 -0
- package/dist/core/utils/dataLoader.js +117 -0
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/core/utils/index.js +12 -0
- package/dist/core/utils/logger.d.ts +14 -0
- package/dist/core/utils/logger.js +48 -0
- package/dist/core/utils/variableResolver.d.ts +24 -0
- package/dist/core/utils/variableResolver.js +92 -0
- package/dist/server/executor.d.ts +6 -0
- package/dist/server/executor.js +207 -47
- package/dist/server/globals.d.ts +6 -1
- package/dist/server/globals.js +7 -0
- package/dist/server/startServer.js +15 -0
- package/package.json +1 -1
- package/dist/client/assets/index-dXniUrbi.js +0 -2193
- package/dist/client/assets/index-oTTttNKd.css +0 -1
|
@@ -196,6 +196,7 @@ async function startServer(options = {}) {
|
|
|
196
196
|
// Get globals and snippets
|
|
197
197
|
app.get('/api/globals', (_req, res) => {
|
|
198
198
|
const globals = (0, globals_1.getGlobals)();
|
|
199
|
+
const globalProcedures = (0, globals_1.getGlobalProcedures)();
|
|
199
200
|
const snippets = (0, globals_1.getAllSnippets)().map(s => ({
|
|
200
201
|
name: s.name,
|
|
201
202
|
description: s.description,
|
|
@@ -203,10 +204,19 @@ async function startServer(options = {}) {
|
|
|
203
204
|
params: s.params,
|
|
204
205
|
stepCount: s.steps.length,
|
|
205
206
|
}));
|
|
207
|
+
// Convert procedures to a format the client can use for blocks
|
|
208
|
+
const procedures = Object.entries(globalProcedures).map(([, proc]) => ({
|
|
209
|
+
name: proc.name,
|
|
210
|
+
description: proc.description,
|
|
211
|
+
category: 'Custom',
|
|
212
|
+
params: proc.params,
|
|
213
|
+
stepCount: proc.steps?.length || 0,
|
|
214
|
+
}));
|
|
206
215
|
res.json({
|
|
207
216
|
directory: (0, globals_1.getGlobalsDirectory)(),
|
|
208
217
|
globals,
|
|
209
218
|
snippets,
|
|
219
|
+
procedures,
|
|
210
220
|
testIdAttribute: (0, globals_1.getTestIdAttribute)(),
|
|
211
221
|
});
|
|
212
222
|
});
|
|
@@ -230,11 +240,13 @@ async function startServer(options = {}) {
|
|
|
230
240
|
// Merge folder hooks into test file
|
|
231
241
|
const mergedTestFile = mergeFolderHooksIntoTestFile(testFile, folderHooks || []);
|
|
232
242
|
const globalVars = (0, globals_1.getGlobalVariables)();
|
|
243
|
+
const globalProcs = (0, globals_1.getGlobalProcedures)();
|
|
233
244
|
const testIdAttr = (0, globals_1.getTestIdAttribute)();
|
|
234
245
|
const executor = new executor_1.TestExecutor({
|
|
235
246
|
headless: req.query.headless !== 'false',
|
|
236
247
|
timeout: Number(req.query.timeout) || 30000,
|
|
237
248
|
variables: globalVars,
|
|
249
|
+
procedures: globalProcs,
|
|
238
250
|
testIdAttribute: testIdAttr,
|
|
239
251
|
baseDir: globalsDir,
|
|
240
252
|
});
|
|
@@ -265,14 +277,17 @@ async function startServer(options = {}) {
|
|
|
265
277
|
// Merge folder hooks for beforeEach/afterEach
|
|
266
278
|
const mergedTestFile = mergeFolderHooksIntoTestFile(testFile, folderHooks || []);
|
|
267
279
|
const globalVars = (0, globals_1.getGlobalVariables)();
|
|
280
|
+
const globalProcs = (0, globals_1.getGlobalProcedures)();
|
|
268
281
|
const testIdAttr = (0, globals_1.getTestIdAttribute)();
|
|
269
282
|
const executor = new executor_1.TestExecutor({
|
|
270
283
|
headless: req.query.headless !== 'false',
|
|
271
284
|
timeout: Number(req.query.timeout) || 30000,
|
|
272
285
|
variables: globalVars,
|
|
286
|
+
procedures: globalProcs,
|
|
273
287
|
testIdAttribute: testIdAttr,
|
|
274
288
|
baseDir: globalsDir,
|
|
275
289
|
});
|
|
290
|
+
// Register file-level procedures (overrides globals)
|
|
276
291
|
if (mergedTestFile.procedures) {
|
|
277
292
|
executor.registerProcedures(mergedTestFile.procedures);
|
|
278
293
|
}
|