@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.
Files changed (71) hide show
  1. package/dist/cli/executor.d.ts +4 -1
  2. package/dist/cli/executor.js +101 -5
  3. package/dist/cli/index.js +148 -4
  4. package/dist/cli/reporters/ConsoleReporter.d.ts +12 -0
  5. package/dist/cli/reporters/ConsoleReporter.js +39 -0
  6. package/dist/cli/reporters/HTMLReporter.d.ts +19 -0
  7. package/dist/cli/reporters/HTMLReporter.js +506 -0
  8. package/dist/cli/reporters/JSONReporter.d.ts +15 -0
  9. package/dist/cli/reporters/JSONReporter.js +80 -0
  10. package/dist/cli/reporters/JUnitReporter.d.ts +19 -0
  11. package/dist/cli/reporters/JUnitReporter.js +105 -0
  12. package/dist/cli/reporters/index.d.ts +17 -0
  13. package/dist/cli/reporters/index.js +31 -0
  14. package/dist/cli/reporters/types.d.ts +28 -0
  15. package/dist/cli/reporters/types.js +2 -0
  16. package/dist/cli/reporters/utils.d.ts +31 -0
  17. package/dist/cli/reporters/utils.js +136 -0
  18. package/dist/cli/reporters.d.ts +13 -62
  19. package/dist/cli/reporters.js +16 -719
  20. package/dist/client/assets/index-Boo8ZrY_.js +2195 -0
  21. package/dist/client/assets/{index-dXniUrbi.js.map → index-Boo8ZrY_.js.map} +1 -1
  22. package/dist/client/assets/index-OxNH9dW-.css +1 -0
  23. package/dist/client/index.html +2 -2
  24. package/dist/core/blocks/api.js +3 -6
  25. package/dist/core/blocks/assertions.d.ts +31 -0
  26. package/dist/core/blocks/assertions.js +72 -0
  27. package/dist/core/blocks/index.d.ts +1 -0
  28. package/dist/core/blocks/index.js +6 -1
  29. package/dist/core/blocks/lifecycle.js +5 -3
  30. package/dist/core/blocks/logic.js +2 -3
  31. package/dist/core/blocks/playwright/assertions.d.ts +5 -0
  32. package/dist/core/blocks/playwright/assertions.js +321 -0
  33. package/dist/core/blocks/playwright/index.d.ts +17 -0
  34. package/dist/core/blocks/playwright/index.js +49 -0
  35. package/dist/core/blocks/playwright/interactions.d.ts +5 -0
  36. package/dist/core/blocks/playwright/interactions.js +191 -0
  37. package/dist/core/blocks/playwright/navigation.d.ts +5 -0
  38. package/dist/core/blocks/playwright/navigation.js +133 -0
  39. package/dist/core/blocks/playwright/retrieval.d.ts +5 -0
  40. package/dist/core/blocks/playwright/retrieval.js +144 -0
  41. package/dist/core/blocks/playwright/types.d.ts +65 -0
  42. package/dist/core/blocks/playwright/types.js +5 -0
  43. package/dist/core/blocks/playwright/utils.d.ts +26 -0
  44. package/dist/core/blocks/playwright/utils.js +137 -0
  45. package/dist/core/blocks/playwright.d.ts +13 -2
  46. package/dist/core/blocks/playwright.js +14 -761
  47. package/dist/core/executor/BaseTestExecutor.d.ts +60 -0
  48. package/dist/core/executor/BaseTestExecutor.js +297 -0
  49. package/dist/core/executor/index.d.ts +1 -0
  50. package/dist/core/executor/index.js +5 -0
  51. package/dist/core/index.d.ts +1 -0
  52. package/dist/core/index.js +4 -0
  53. package/dist/core/types.d.ts +12 -0
  54. package/dist/core/utils/blocklyParser.d.ts +18 -0
  55. package/dist/core/utils/blocklyParser.js +84 -0
  56. package/dist/core/utils/dataLoader.d.ts +9 -0
  57. package/dist/core/utils/dataLoader.js +117 -0
  58. package/dist/core/utils/index.d.ts +2 -0
  59. package/dist/core/utils/index.js +12 -0
  60. package/dist/core/utils/logger.d.ts +14 -0
  61. package/dist/core/utils/logger.js +48 -0
  62. package/dist/core/utils/variableResolver.d.ts +24 -0
  63. package/dist/core/utils/variableResolver.js +92 -0
  64. package/dist/server/executor.d.ts +6 -0
  65. package/dist/server/executor.js +207 -47
  66. package/dist/server/globals.d.ts +6 -1
  67. package/dist/server/globals.js +7 -0
  68. package/dist/server/startServer.js +15 -0
  69. package/package.json +1 -1
  70. package/dist/client/assets/index-dXniUrbi.js +0 -2193
  71. 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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testsmith/testblocks",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Visual test automation tool with Blockly - API and Playwright testing",
5
5
  "author": "Roy de Kleijn",
6
6
  "license": "MIT",