@zohodesk/testinglibrary 0.1.7 → 0.1.8-exp-bdd

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 (91) hide show
  1. package/.babelrc +18 -18
  2. package/.eslintrc.js +27 -31
  3. package/.prettierrc +5 -5
  4. package/README.md +17 -17
  5. package/bin/cli.js +2 -2
  6. package/build/bdd-framework/cli/commands/env.js +4 -4
  7. package/build/bdd-framework/cli/commands/test.js +2 -6
  8. package/build/bdd-framework/cli/options.js +4 -4
  9. package/build/bdd-framework/cli/worker.js +3 -3
  10. package/build/bdd-framework/config/dir.js +6 -6
  11. package/build/bdd-framework/config/env.js +4 -5
  12. package/build/bdd-framework/config/index.js +2 -2
  13. package/build/bdd-framework/cucumber/buildStepDefinition.js +3 -3
  14. package/build/bdd-framework/cucumber/gherkin.d.ts +45 -0
  15. package/build/bdd-framework/cucumber/loadSnippetBuilder.js +3 -3
  16. package/build/bdd-framework/cucumber/loadSources.js +9 -9
  17. package/build/bdd-framework/cucumber/loadSteps.js +3 -8
  18. package/build/bdd-framework/decorators.js +2 -2
  19. package/build/bdd-framework/gen/formatter.js +17 -64
  20. package/build/bdd-framework/gen/i18n.js +5 -9
  21. package/build/bdd-framework/gen/index.js +8 -9
  22. package/build/bdd-framework/gen/poms.js +46 -0
  23. package/build/bdd-framework/gen/testFile.js +55 -121
  24. package/build/bdd-framework/gen/testNode.js +6 -19
  25. package/build/bdd-framework/gen/testPoms.js +39 -49
  26. package/build/bdd-framework/playwright/fixtureParameterNames.js +11 -27
  27. package/build/bdd-framework/playwright/getLocationInFile.js +11 -17
  28. package/build/bdd-framework/playwright/loadConfig.js +3 -3
  29. package/build/bdd-framework/playwright/testTypeImpl.js +15 -19
  30. package/build/bdd-framework/playwright/transform.js +6 -10
  31. package/build/bdd-framework/playwright/utils.js +6 -3
  32. package/build/bdd-framework/run/bddFixtures.js +55 -118
  33. package/build/bdd-framework/run/bddWorld.js +36 -24
  34. package/build/bdd-framework/snippets/index.js +3 -5
  35. package/build/bdd-framework/snippets/snippetSyntax.js +1 -3
  36. package/build/bdd-framework/snippets/snippetSyntaxTs.js +4 -4
  37. package/build/bdd-framework/stepDefinitions/createBdd.js +13 -30
  38. package/build/bdd-framework/stepDefinitions/createDecorators.js +108 -0
  39. package/build/bdd-framework/stepDefinitions/decorators/{class.js → poms.js} +9 -13
  40. package/build/bdd-framework/stepDefinitions/decorators/steps.js +8 -14
  41. package/build/bdd-framework/stepDefinitions/defineStep.js +4 -5
  42. package/build/bdd-framework/stepDefinitions/stepConfig.js +5 -5
  43. package/build/bdd-framework/utils/exit.js +18 -26
  44. package/build/bdd-framework/utils/index.js +4 -30
  45. package/build/bdd-framework/utils/jsStringWrap.js +9 -9
  46. package/build/bdd-framework/utils/logger.js +3 -5
  47. package/build/bdd-poc/core-runner/exportMethods.js +14 -0
  48. package/build/bdd-poc/core-runner/stepDefinitions.js +55 -0
  49. package/build/bdd-poc/main.js +10 -0
  50. package/build/bdd-poc/test/cucumber/featureFileParer.js +81 -0
  51. package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +36 -0
  52. package/build/bdd-poc/test/stepGenerate/stepsnippets.js +43 -0
  53. package/build/bdd-poc/test/testDataMap.js +98 -0
  54. package/build/bdd-poc/test/testStructure.js +83 -0
  55. package/build/bdd-poc/utils/stringManipulation.js +19 -0
  56. package/build/core/playwright/custom-commands.js +1 -1
  57. package/build/core/playwright/index.js +0 -15
  58. package/build/core/playwright/readConfigFile.js +30 -37
  59. package/build/core/playwright/report-generator.js +1 -2
  60. package/build/core/playwright/setup/config-creator.js +15 -21
  61. package/build/core/playwright/setup/config-utils.js +0 -30
  62. package/build/core/playwright/test-runner.js +5 -7
  63. package/build/index.d.ts +5 -60
  64. package/build/index.js +3 -5
  65. package/build/lib/cli.js +1 -10
  66. package/build/parser/sample.feature +34 -34
  67. package/build/parser/sample.spec.js +18 -18
  68. package/build/setup-folder-structure/samples/auth-setup-sample.js +72 -72
  69. package/build/setup-folder-structure/samples/authUsers-sample.json +8 -8
  70. package/build/setup-folder-structure/samples/env-config-sample.json +20 -20
  71. package/build/setup-folder-structure/samples/git-ignore.sample.js +32 -36
  72. package/build/setup-folder-structure/samples/uat-config-sample.js +43 -44
  73. package/build/setup-folder-structure/setupProject.js +5 -10
  74. package/build/utils/cliArgsToObject.js +25 -25
  75. package/build/utils/fileUtils.js +0 -12
  76. package/changelog.md +74 -124
  77. package/jest.config.js +63 -63
  78. package/npm-shrinkwrap.json +7781 -6469
  79. package/package.json +54 -55
  80. package/playwright.config.js +112 -112
  81. package/build/bdd-framework/config/lang.js +0 -14
  82. package/build/bdd-framework/gen/fixtures.js +0 -48
  83. package/build/bdd-framework/hooks/scenario.js +0 -107
  84. package/build/bdd-framework/hooks/worker.js +0 -83
  85. package/build/bdd-framework/run/StepInvoker.js +0 -73
  86. package/build/core/playwright/clear-caches.js +0 -29
  87. package/build/core/playwright/setup/custom-reporter.js +0 -100
  88. package/build/core/playwright/tag-processor.js +0 -68
  89. package/build/setup-folder-structure/helper.js +0 -34
  90. package/build/setup-folder-structure/reportEnhancement/addonScript.html +0 -25
  91. package/build/setup-folder-structure/reportEnhancement/reportAlteration.js +0 -25
package/changelog.md CHANGED
@@ -1,124 +1,74 @@
1
- # Testing Framework
2
-
3
- ## Framework that abstracts the configuration for playwright and Jest
4
-
5
- # 0.1.7
6
- **Enhancements**
7
- - Added option to run teardown logic.
8
- - Added support for tag based filtering.
9
- - Playwright-bdd version updated to 5.6.0.
10
- - New fixture added to add tag as annotations in test report
11
-
12
- **Issue Fixes**
13
- - Edition command option. Fixed the edition tags not generated properly
14
-
15
- # 0.1.6
16
-
17
- **Enhancements**
18
- - New Command option Added `--edition`.
19
- - New Configuration Added `editionOrder`.
20
- `In uat.config.js, editionOrder: ['Free', 'Express']`
21
- - Cache Layer added
22
-
23
- **USAGE**
24
- - npm run uat --edition="Free"
25
-
26
-
27
-
28
- # 0.1.5
29
-
30
- **Enhancements**
31
-
32
- - Playwright version updated to `1.40.1`
33
- - And and But Support added
34
- - Added Code Suggestions support
35
- - Custom Reporter added. Now the report will be available in json format.
36
- - New Commands added.
37
-
38
- `- help: npx ZDTestingFramework help`
39
-
40
- - Will list down the commands available in the tool
41
-
42
- `- clearCaches: npx ZDTestingFramework clearCaches`
43
-
44
- - Will clear the exisiting cookies in the authentication setup
45
-
46
- **Issue Fixes**
47
-
48
- - Fixed Issue that occurs while quitting node process.
49
-
50
- # 0.1.4
51
-
52
- - `testIdAttribute` config added
53
- - Fixed issue while reading boolean configuration values
54
-
55
- # 0.1.3
56
-
57
- - uat config sample file updated with `bddMode` and `viewport` values
58
- - user configuration issue fix when the value is undefined
59
-
60
- # 0.1.2
61
-
62
- - Bdd version updated to `5.4.0`
63
- - Playwright version updated to `1.39.0`
64
-
65
- # 0.1.1
66
-
67
- - Fixed post install script error
68
- - Fixed error `@cucumber/gherkin` not found. Cause of this issue is updating @cucumber/cucumber to 9.5.0. Reverting this version to 9.2.0
69
- - Removed testing library exports
70
-
71
- # 0.1.0
72
-
73
- - Removed eslint as dev dependencies as it causes `npm aliases not supported error` for npm version < 6
74
-
75
- # 0.0.9
76
-
77
- - Video sized in report adjusted to viewport size
78
- - Changes in package.json scripts while setting up project
79
-
80
- # 0.0.8
81
-
82
- - Tags Support
83
- - Enable running without bddmode feature
84
- - viewport configuration
85
- - Internal Change - Code refactoring
86
-
87
- # 0.0.7
88
-
89
- - Removed react and react-dom as dependencies. Added this as peer dependency
90
-
91
- # 0.0.6
92
-
93
- ## Provided Initial Support for cucumber feature files
94
-
95
- - Playwright-bdd and cucumber added as dependencies
96
- - Added config bddMode which toggles the feature files processing
97
- - Added expect timeout and test timeout as an option
98
- - Decorators support for given, when and then. Typescript support needed to use this feature
99
-
100
- ## Internal Library change
101
-
102
- - Provided support for import/export statements
103
-
104
- # 0.0.5
105
-
106
- - Added Init command to initialize the folder structure and configuration for testing
107
- - Renamed config.json to env-config.json
108
- - Configured report file path directory and Handled Edge case in Cookies Handling
109
-
110
- # 0.0.4
111
-
112
- - Issue Fixes while loading the storage state
113
-
114
- # 0.0.3
115
-
116
- - Added Support for custom config generator based on user preferences
117
-
118
- # 0.0.2
119
-
120
- - Fix for Finding directories inside node_modules folder
121
-
122
- # 0.0.1
123
-
124
- - test and report command support
1
+ # Testing Framework
2
+
3
+ ## Framework that abstracts the configuration for playwright and Jest
4
+
5
+ # 0.1.3
6
+
7
+ - uat config sample file updated with `bddMode` and `viewport` values
8
+ - user configuration issue fix when the value is undefined
9
+
10
+ # 0.1.2
11
+
12
+ - Bdd version updated to `5.4.0`
13
+ - Playwright version updated to `1.39.0`
14
+
15
+ # 0.1.1
16
+
17
+ - Fixed post install script error
18
+ - Fixed error `@cucumber/gherkin` not found. Cause of this issue is updating @cucumber/cucumber to 9.5.0. Reverting this version to 9.2.0
19
+ - Removed testing library exports
20
+
21
+ # 0.1.0
22
+
23
+ - Removed eslint as dev dependencies as it causes `npm aliases not supported error` for npm version < 6
24
+
25
+ # 0.0.9
26
+
27
+ - Video sized in report adjusted to viewport size
28
+ - Changes in package.json scripts while setting up project
29
+
30
+ # 0.0.8
31
+
32
+ - Tags Support
33
+ - Enable running without bddmode feature
34
+ - viewport configuration
35
+ - Internal Change - Code refactoring
36
+
37
+ # 0.0.7
38
+
39
+ - Removed react and react-dom as dependencies. Added this as peer dependency
40
+
41
+ # 0.0.6
42
+
43
+ ## Provided Initial Support for cucumber feature files
44
+
45
+ - Playwright-bdd and cucumber added as dependencies
46
+ - Added config bddMode which toggles the feature files processing
47
+ - Added expect timeout and test timeout as an option
48
+ - Decorators support for given, when and then. Typescript support needed to use this feature
49
+
50
+ ## Internal Library change
51
+
52
+ - Provided support for import/export statements
53
+
54
+ # 0.0.5
55
+
56
+ - Added Init command to initialize the folder structure and configuration for testing
57
+ - Renamed config.json to env-config.json
58
+ - Configured report file path directory and Handled Edge case in Cookies Handling
59
+
60
+ # 0.0.4
61
+
62
+ - Issue Fixes while loading the storage state
63
+
64
+ # 0.0.3
65
+
66
+ - Added Support for custom config generator based on user preferences
67
+
68
+ # 0.0.2
69
+
70
+ - Fix for Finding directories inside node_modules folder
71
+
72
+ # 0.0.1
73
+
74
+ - test and report command support
package/jest.config.js CHANGED
@@ -1,64 +1,64 @@
1
- const path = require('path');
2
- const { existsSync } = require('fs');
3
- const appPath = process.cwd();
4
-
5
- const appGlobals = path.resolve(appPath, '__testUtils__', 'globals.js');
6
-
7
- module.exports = {
8
- rootDir: process.cwd(),
9
- testEnvironment: 'jsdom',
10
-
11
- setupFilesAfterEnv: [
12
- existsSync(appGlobals) && appGlobals,
13
- path.resolve(__dirname, 'src', 'core', 'jest', 'setup', 'index.js')
14
- ].filter(Boolean),
15
-
16
- transform: {
17
- '^.+\\.(js|jsx)$': path.resolve(
18
- __dirname,
19
- 'src',
20
- 'core',
21
- 'jest',
22
- 'preprocessor',
23
- 'jsPreprocessor.js'
24
- )
25
- },
26
-
27
- modulePathIgnorePatterns: ['/build/'],
28
-
29
- transformIgnorePatterns: [
30
- '/node_modules/(?!(@zohodesk)/)'
31
- ],
32
-
33
- testPathIgnorePatterns: [
34
- '/node_modules/',
35
- '/build/',
36
- '/uat/'
37
- ],
38
-
39
- watchPathIgnorePatterns: [
40
- '/node_modules/',
41
- '/build/'
42
- ],
43
-
44
- clearMocks: true,
45
- resetMocks: false,
46
-
47
- collectCoverage: true,
48
- collectCoverageFrom: ['src/**/*.js'],
49
- coverageDirectory: './build/cov',
50
- coverageReporters: ['lcov', 'json', 'html', 'json-summary', 'text'],
51
- coverageThreshold: {
52
- global: {
53
- branches: 100,
54
- functions: 100,
55
- lines: 100,
56
- statements: 100
57
- }
58
- },
59
- globals: {
60
- __DEVELOPMENT__: true,
61
- __DOCS__: false,
62
- __TEST__: true
63
- }
1
+ const path = require('path');
2
+ const { existsSync } = require('fs');
3
+ const appPath = process.cwd();
4
+
5
+ const appGlobals = path.resolve(appPath, '__testUtils__', 'globals.js');
6
+
7
+ module.exports = {
8
+ rootDir: process.cwd(),
9
+ testEnvironment: 'jsdom',
10
+
11
+ setupFilesAfterEnv: [
12
+ existsSync(appGlobals) && appGlobals,
13
+ path.resolve(__dirname, 'src', 'core', 'jest', 'setup', 'index.js')
14
+ ].filter(Boolean),
15
+
16
+ transform: {
17
+ '^.+\\.(js|jsx)$': path.resolve(
18
+ __dirname,
19
+ 'src',
20
+ 'core',
21
+ 'jest',
22
+ 'preprocessor',
23
+ 'jsPreprocessor.js'
24
+ )
25
+ },
26
+
27
+ modulePathIgnorePatterns: ['/build/'],
28
+
29
+ transformIgnorePatterns: [
30
+ '/node_modules/(?!(@zohodesk)/)'
31
+ ],
32
+
33
+ testPathIgnorePatterns: [
34
+ '/node_modules/',
35
+ '/build/',
36
+ '/uat/'
37
+ ],
38
+
39
+ watchPathIgnorePatterns: [
40
+ '/node_modules/',
41
+ '/build/'
42
+ ],
43
+
44
+ clearMocks: true,
45
+ resetMocks: false,
46
+
47
+ collectCoverage: true,
48
+ collectCoverageFrom: ['src/**/*.js'],
49
+ coverageDirectory: './build/cov',
50
+ coverageReporters: ['lcov', 'json', 'html', 'json-summary', 'text'],
51
+ coverageThreshold: {
52
+ global: {
53
+ branches: 100,
54
+ functions: 100,
55
+ lines: 100,
56
+ statements: 100
57
+ }
58
+ },
59
+ globals: {
60
+ __DEVELOPMENT__: true,
61
+ __DOCS__: false,
62
+ __TEST__: true
63
+ }
64
64
  };