@zohodesk/testinglibrary 0.1.8-exp.4 → 0.1.8-stb-bdd-v1

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