@zohodesk/testinglibrary 0.1.9 → 0.2.1

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 (55) hide show
  1. package/build/bdd-framework/cli/commands/env.js +1 -1
  2. package/build/bdd-framework/cli/commands/export.js +18 -3
  3. package/build/bdd-framework/decorators.js +2 -2
  4. package/build/bdd-framework/gen/formatter.js +57 -13
  5. package/build/bdd-framework/gen/index.js +21 -9
  6. package/build/bdd-framework/gen/specialTags.js +70 -0
  7. package/build/bdd-framework/gen/testFile.js +10 -5
  8. package/build/bdd-framework/gen/testNode.js +4 -29
  9. package/build/bdd-framework/gen/testPoms.js +1 -1
  10. package/build/bdd-framework/index.js +1 -1
  11. package/build/bdd-framework/playwright/testTypeImpl.js +28 -10
  12. package/build/bdd-framework/playwright/types.js +8 -1
  13. package/build/bdd-framework/playwright/utils.js +22 -0
  14. package/build/bdd-framework/reporter/cucumber/base.js +2 -7
  15. package/build/bdd-framework/reporter/cucumber/html.js +9 -4
  16. package/build/bdd-framework/reporter/cucumber/messagesBuilder/AttachmentMapper.js +28 -10
  17. package/build/bdd-framework/reporter/cucumber/messagesBuilder/Builder.js +21 -20
  18. package/build/bdd-framework/reporter/cucumber/messagesBuilder/Hook.js +3 -3
  19. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRun.js +46 -18
  20. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRunHooks.js +41 -20
  21. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +19 -2
  22. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +42 -16
  23. package/build/bdd-framework/reporter/cucumber/messagesBuilder/{pwUtils.js → pwStepUtils.js} +33 -14
  24. package/build/bdd-framework/run/StepInvoker.js +8 -7
  25. package/build/bdd-framework/run/bddData/index.js +59 -0
  26. package/build/bdd-framework/run/bddData/types.js +5 -0
  27. package/build/bdd-framework/run/bddFixtures.js +5 -4
  28. package/build/bdd-framework/run/bddWorld.js +3 -3
  29. package/build/bdd-framework/run/bddWorldInternal.js +1 -5
  30. package/build/bdd-framework/snippets/index.js +1 -1
  31. package/build/bdd-framework/steps/createBdd.js +78 -0
  32. package/build/bdd-framework/steps/decorators/class.js +68 -0
  33. package/build/bdd-framework/steps/decorators/steps.js +98 -0
  34. package/build/bdd-framework/steps/defineStep.js +62 -0
  35. package/build/bdd-framework/steps/stepConfig.js +24 -0
  36. package/build/core/playwright/builtInFixtures/page.js +21 -14
  37. package/build/core/playwright/clear-caches.js +5 -3
  38. package/build/core/playwright/env-initializer.js +22 -6
  39. package/build/core/playwright/helpers/auth/checkAuthCookies.js +10 -5
  40. package/build/core/playwright/helpers/auth/getUsers.js +79 -32
  41. package/build/core/playwright/helpers/auth/index.js +22 -4
  42. package/build/core/playwright/helpers/auth/loginSteps.js +2 -2
  43. package/build/core/playwright/helpers/configFileNameProvider.js +9 -1
  44. package/build/core/playwright/index.js +14 -59
  45. package/build/core/playwright/readConfigFile.js +14 -2
  46. package/build/core/playwright/test-runner.js +2 -3
  47. package/build/index.d.ts +17 -18
  48. package/build/index.js +16 -4
  49. package/build/setup-folder-structure/samples/auth-setup-sample.js +22 -21
  50. package/build/setup-folder-structure/setupProject.js +1 -0
  51. package/build/utils/fileUtils.js +5 -0
  52. package/changelog.md +18 -0
  53. package/npm-shrinkwrap.json +1 -1
  54. package/package.json +3 -2
  55. package/build/bdd-framework/run/bddDataAttachment.js +0 -46
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.9",
3
+ "version": "0.2.1",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.9",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "exports": {
16
16
  ".": "./build/index.js",
17
- "./decorators": "./build/decorators.js"
17
+ "./decorators": "./build/decorators.js",
18
+ "./helpers": "./build/core/playwright/helpers/auth/index.js"
18
19
  },
19
20
  "keywords": [],
20
21
  "author": "",
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BddData = void 0;
7
- exports.getBddDataFromTestResult = getBddDataFromTestResult;
8
- exports.isBddDataAttachment = isBddDataAttachment;
9
- var _createTestStep = require("../cucumber/createTestStep");
10
- var _utils = require("../utils");
11
- const BDD_DATA_ATTACHMENT_NAME = '__bddData';
12
- class BddData {
13
- world;
14
- steps = [];
15
- constructor(world) {
16
- this.world = world;
17
- }
18
- registerStep(stepDefinition, stepText, pwStepLocation) {
19
- const step = (0, _createTestStep.createTestStep)(stepDefinition, stepText);
20
- this.steps.push({
21
- pwStepLocation: (0, _utils.stringifyLocation)(pwStepLocation),
22
- stepMatchArgumentsLists: step.stepMatchArgumentsLists || []
23
- });
24
- }
25
- async attach(testMeta, uri) {
26
- const attachment = {
27
- uri,
28
- pickleLocation: testMeta.pickleLocation,
29
- steps: this.steps
30
- };
31
- await this.world.testInfo.attach(BDD_DATA_ATTACHMENT_NAME, {
32
- contentType: 'application/json',
33
- body: JSON.stringify(attachment)
34
- });
35
- }
36
- }
37
- exports.BddData = BddData;
38
- function getBddDataFromTestResult(result) {
39
- var _attachment$body;
40
- const attachment = result.attachments.find(isBddDataAttachment);
41
- const attachmentBody = attachment === null || attachment === void 0 || (_attachment$body = attachment.body) === null || _attachment$body === void 0 ? void 0 : _attachment$body.toString();
42
- return attachmentBody ? JSON.parse(attachmentBody) : undefined;
43
- }
44
- function isBddDataAttachment(attachment) {
45
- return attachment.name === BDD_DATA_ATTACHMENT_NAME;
46
- }