@zohodesk/testinglibrary 0.0.5 → 0.0.6-n20-experimental

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 (136) hide show
  1. package/.babelrc +24 -0
  2. package/.eslintrc.js +31 -0
  3. package/.gitlab-ci.yml +206 -0
  4. package/.prettierrc +6 -0
  5. package/README.md +189 -18
  6. package/bin/cli.js +2 -2
  7. package/bin/postinstall.js +1 -16
  8. package/build/common/data-generator/steps/DataGenerator.spec.js +19 -0
  9. package/build/common/data-generator/steps/DataGeneratorStepsHelper.js +19 -0
  10. package/build/common/multi-actor/steps/multiActorHandling.spec.js +26 -0
  11. package/build/common/searchFake/helpers/rpcRequestHelper.js +52 -0
  12. package/build/common/searchFake/steps/searchFake.spec.js +77 -0
  13. package/build/core/dataGenerator/DataGenerator.js +108 -0
  14. package/build/core/dataGenerator/DataGeneratorError.js +50 -0
  15. package/build/core/dataGenerator/DataGeneratorHelper.js +49 -0
  16. package/{src → build}/core/jest/preprocessor/jsPreprocessor.js +7 -9
  17. package/{src → build}/core/jest/runner/jest-runner.js +46 -44
  18. package/build/core/jest/setup/index.js +3 -0
  19. package/build/core/playwright/builtInFixtures/actorContext.js +75 -0
  20. package/build/core/playwright/builtInFixtures/addTags.js +19 -0
  21. package/build/core/playwright/builtInFixtures/cacheLayer.js +13 -0
  22. package/build/core/playwright/builtInFixtures/context.js +32 -0
  23. package/build/core/playwright/builtInFixtures/executionContext.js +17 -0
  24. package/build/core/playwright/builtInFixtures/i18N.js +41 -0
  25. package/build/core/playwright/builtInFixtures/index.js +46 -0
  26. package/build/core/playwright/builtInFixtures/page.js +38 -0
  27. package/build/core/playwright/builtInFixtures/unauthenticatedPage.js +18 -0
  28. package/build/core/playwright/clear-caches.js +49 -0
  29. package/build/core/playwright/codegen.js +55 -0
  30. package/build/core/playwright/configuration/Configuration.js +25 -0
  31. package/build/core/playwright/configuration/ConfigurationHelper.js +43 -0
  32. package/build/core/playwright/configuration/UserArgs.js +12 -0
  33. package/build/core/playwright/constants/browserTypes.js +12 -0
  34. package/build/core/playwright/constants/fileMutexConfig.js +9 -0
  35. package/build/core/playwright/custom-commands.js +7 -0
  36. package/build/core/playwright/env-initializer.js +43 -0
  37. package/build/core/playwright/fixtures.js +24 -0
  38. package/build/core/playwright/helpers/additionalProfiles.js +25 -0
  39. package/build/core/playwright/helpers/auth/accountLogin.js +21 -0
  40. package/build/core/playwright/helpers/auth/checkAuthCookies.js +41 -0
  41. package/build/core/playwright/helpers/auth/getUrlOrigin.js +13 -0
  42. package/build/core/playwright/helpers/auth/getUsers.js +118 -0
  43. package/build/core/playwright/helpers/auth/index.js +76 -0
  44. package/build/core/playwright/helpers/auth/loginDefaultStepsHelper.js +54 -0
  45. package/build/core/playwright/helpers/auth/loginSteps.js +51 -0
  46. package/build/core/playwright/helpers/checkAuthDirectory.js +27 -0
  47. package/build/core/playwright/helpers/configFileNameProvider.js +31 -0
  48. package/build/core/playwright/helpers/customFixturesHelper.js +58 -0
  49. package/build/core/playwright/helpers/fileMutex.js +72 -0
  50. package/build/core/playwright/helpers/getUserFixtures.js +23 -0
  51. package/build/core/playwright/helpers/mergeObjects.js +13 -0
  52. package/build/core/playwright/helpers/parseUserArgs.js +10 -0
  53. package/build/core/playwright/index.js +24 -0
  54. package/build/core/playwright/readConfigFile.js +148 -0
  55. package/build/core/playwright/report-generator.js +42 -0
  56. package/build/core/playwright/runner/Runner.js +22 -0
  57. package/build/core/playwright/runner/RunnerHelper.js +43 -0
  58. package/build/core/playwright/runner/RunnerTypes.js +17 -0
  59. package/build/core/playwright/runner/SpawnRunner.js +113 -0
  60. package/build/core/playwright/setup/Project.js +35 -0
  61. package/build/core/playwright/setup/ProjectConfiguration.js +80 -0
  62. package/build/core/playwright/setup/config-creator.js +89 -0
  63. package/build/core/playwright/setup/config-utils.js +188 -0
  64. package/build/core/playwright/setup/custom-reporter.js +136 -0
  65. package/build/core/playwright/setup/qc-custom-reporter.js +291 -0
  66. package/build/core/playwright/tagProcessor.js +69 -0
  67. package/build/core/playwright/test-runner.js +118 -0
  68. package/build/core/playwright/types.js +44 -0
  69. package/build/core/playwright/validateFeature.js +28 -0
  70. package/build/decorators.d.ts +1 -0
  71. package/build/decorators.js +16 -0
  72. package/build/index.d.ts +78 -0
  73. package/build/index.js +105 -0
  74. package/build/lib/cli.js +78 -0
  75. package/build/lib/post-install.js +25 -0
  76. package/build/lint/index.js +4 -0
  77. package/build/parser/parser.js +205 -0
  78. package/build/parser/sample.feature +34 -0
  79. package/build/parser/sample.spec.js +37 -0
  80. package/build/parser/verifier.js +130 -0
  81. package/build/setup-folder-structure/helper.js +37 -0
  82. package/build/setup-folder-structure/reportEnhancement/addonScript.html +25 -0
  83. package/build/setup-folder-structure/reportEnhancement/reportAlteration.js +25 -0
  84. package/build/setup-folder-structure/samples/accountLogin-sample.js +19 -0
  85. package/build/setup-folder-structure/samples/actors-index.js +2 -0
  86. package/build/setup-folder-structure/samples/auth-setup-sample.js +15 -0
  87. package/build/setup-folder-structure/samples/editions-index.js +3 -0
  88. package/build/setup-folder-structure/samples/free-sample.json +25 -0
  89. package/build/setup-folder-structure/samples/git-ignore.sample.js +37 -0
  90. package/build/setup-folder-structure/samples/settings.json +7 -0
  91. package/build/setup-folder-structure/samples/testSetup-sample.js +14 -0
  92. package/build/setup-folder-structure/samples/uat-config-sample.js +46 -0
  93. package/build/setup-folder-structure/setupProject.js +122 -0
  94. package/build/test/core/playwright/__tests__/tagProcessor.test.js +94 -0
  95. package/build/test/core/playwright/__tests__/validateFeature.test.js +69 -0
  96. package/build/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js +27 -0
  97. package/build/test/core/playwright/configuration/__tests__/Configuration.test.js +53 -0
  98. package/build/test/core/playwright/helpers/__tests__/additionalProfiles.test.js +45 -0
  99. package/build/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js +34 -0
  100. package/build/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js +51 -0
  101. package/build/test/core/playwright/helpers/__tests__/fileMutex.test.js +79 -0
  102. package/build/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js +80 -0
  103. package/build/test/core/playwright/runner/__tests__/RunnerHelper.test.js +16 -0
  104. package/build/test/core/playwright/runner/__tests__/SpawnRunner.test.js +27 -0
  105. package/{src → build}/utils/cliArgsToObject.js +72 -63
  106. package/build/utils/commonUtils.js +17 -0
  107. package/build/utils/fileUtils.js +109 -0
  108. package/build/utils/getFilePath.js +11 -0
  109. package/build/utils/logger.js +28 -0
  110. package/build/utils/rootPath.js +53 -0
  111. package/build/utils/stepDefinitionsFormatter.js +11 -0
  112. package/changelog.md +167 -25
  113. package/jest.config.js +81 -63
  114. package/npm-shrinkwrap.json +11894 -5772
  115. package/package.json +61 -31
  116. package/playwright.config.js +62 -112
  117. package/test-results/.last-run.json +4 -0
  118. package/unit_reports/unit-report.html +260 -0
  119. package/src/core/jest/setup/index.js +0 -165
  120. package/src/core/playwright/codegen.js +0 -60
  121. package/src/core/playwright/custom-commands.js +0 -3
  122. package/src/core/playwright/env-initializer.js +0 -24
  123. package/src/core/playwright/index.js +0 -82
  124. package/src/core/playwright/readConfigFile.js +0 -63
  125. package/src/core/playwright/report-generator.js +0 -45
  126. package/src/core/playwright/setup/config-creator.js +0 -77
  127. package/src/core/playwright/test-runner.js +0 -67
  128. package/src/index.js +0 -9
  129. package/src/lib/cli.js +0 -42
  130. package/src/setup-folder-structure/env-config-sample.json +0 -17
  131. package/src/setup-folder-structure/setupProject.js +0 -99
  132. package/src/setup-folder-structure/uat-config-sample.js +0 -22
  133. package/src/setup-folder-structure/user-example.json +0 -3
  134. package/src/utils/getFilePath.js +0 -9
  135. package/src/utils/logger.js +0 -28
  136. package/src/utils/rootPath.js +0 -51
package/changelog.md CHANGED
@@ -1,25 +1,167 @@
1
- # Testing Framework
2
-
3
- ## Framework that abstracts the configuration for playwright and Jest
4
-
5
- # 0.0.5
6
-
7
- - Added Init command to initialize the folder structure and configuration for testing
8
- - Renamed config.json to env-config.json
9
- - Configured report file path directory and Handled Edge case in Cookies Handling
10
-
11
- # 0.0.4
12
-
13
- - Issue Fixes while loading the storage state
14
-
15
- # 0.0.3
16
-
17
- - Added Support for custom config generator based on user preferences
18
-
19
- # 0.0.2
20
-
21
- - Fix for Finding directories inside node_modules folder
22
-
23
- # 0.0.1
24
-
25
- - test and report command support
1
+ # Testing Framework
2
+
3
+ ## Framework that abstracts the configuration for playwright and Jest
4
+ # 0.2.4
5
+ - Issue fixes on custom fixtures
6
+ - Page Fixture
7
+ - i18n Fixture
8
+
9
+ # 0.2.1
10
+ **Issue Fixes**
11
+ - Fixes issue in actors configuration
12
+ - Added Error Logger
13
+
14
+ # 0.2.0
15
+ **Major Breaking Change**
16
+ - Removed Env-config.json in favour of conf/*/settings.json
17
+ - Mode in uat.config.js is deprecated. Use command args instead
18
+
19
+ **Enhancements**
20
+ - Playwright version updated to 1.42.1
21
+ - Playwright-bdd version updated to 6.1.1
22
+ - Tags Support
23
+ - Added getMetaInfo fixture to get the actors Info data
24
+
25
+ **Issue Fixes**
26
+ - Fixes #10- Mode config not working properly
27
+
28
+ # 0.1.9
29
+ **Enhancements**
30
+ - Added option to specify browsers in command line.
31
+ - npm run uat -- --browsers='chrome,firefox'
32
+ - Playwright version updated to 1.41.1
33
+ - Added option to Skip Browser download
34
+ - Added New Command re-run-failed to run only the failed cases
35
+ **Major Change**
36
+ - Default fixtures moved inside the library.(Page, Context, i18N, unauthenticatedPage)
37
+ **Internal Library Change**
38
+ Examples folder updated to latest testing library version.
39
+
40
+ # 0.1.8
41
+ **Issue Fixes**
42
+ - Fix #9 Custom report generate Error on Windows
43
+ - Add Tags annotations only on bddMode
44
+
45
+ **Enhancements**
46
+ - Added Failed steps in test summary
47
+
48
+ # 0.1.7
49
+ **Enhancements**
50
+ - Added option to run teardown logic.
51
+ - Added support for tag based filtering.
52
+ - Playwright-bdd version updated to 5.6.0.
53
+ - New fixture added to add tag as annotations in test report
54
+
55
+ **Issue Fixes**
56
+ - Edition command option. Fixed the edition tags not generated properly
57
+
58
+ # 0.1.6
59
+
60
+ **Enhancements**
61
+ - New Command option Added `--edition`.
62
+ - New Configuration Added `editionOrder`.
63
+ `In uat.config.js, editionOrder: ['Free', 'Express']`
64
+ - Cache Layer added
65
+
66
+ **USAGE**
67
+ - npm run uat --edition="Free"
68
+
69
+
70
+
71
+ # 0.1.5
72
+
73
+ **Enhancements**
74
+
75
+ - Playwright version updated to `1.40.1`
76
+ - And and But Support added
77
+ - Added Code Suggestions support
78
+ - Custom Reporter added. Now the report will be available in json format.
79
+ - New Commands added.
80
+
81
+ `- help: npx ZDTestingFramework help`
82
+
83
+ - Will list down the commands available in the tool
84
+
85
+ `- clearCaches: npx ZDTestingFramework clearCaches`
86
+
87
+ - Will clear the exisiting cookies in the authentication setup
88
+
89
+ **Issue Fixes**
90
+
91
+ - Fixed Issue that occurs while quitting node process.
92
+
93
+ # 0.1.4
94
+
95
+ - `testIdAttribute` config added
96
+ - Fixed issue while reading boolean configuration values
97
+
98
+ # 0.1.3
99
+
100
+ - uat config sample file updated with `bddMode` and `viewport` values
101
+ - user configuration issue fix when the value is undefined
102
+
103
+ # 0.1.2
104
+
105
+ - Bdd version updated to `5.4.0`
106
+ - Playwright version updated to `1.39.0`
107
+
108
+ # 0.1.1
109
+
110
+ - Fixed post install script error
111
+ - 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
112
+ - Removed testing library exports
113
+
114
+ # 0.1.0
115
+
116
+ - Removed eslint as dev dependencies as it causes `npm aliases not supported error` for npm version < 6
117
+
118
+ # 0.0.9
119
+
120
+ - Video sized in report adjusted to viewport size
121
+ - Changes in package.json scripts while setting up project
122
+
123
+ # 0.0.8
124
+
125
+ - Tags Support
126
+ - Enable running without bddmode feature
127
+ - viewport configuration
128
+ - Internal Change - Code refactoring
129
+
130
+ # 0.0.7
131
+
132
+ - Removed react and react-dom as dependencies. Added this as peer dependency
133
+
134
+ # 0.0.6
135
+
136
+ ## Provided Initial Support for cucumber feature files
137
+
138
+ - Playwright-bdd and cucumber added as dependencies
139
+ - Added config bddMode which toggles the feature files processing
140
+ - Added expect timeout and test timeout as an option
141
+ - Decorators support for given, when and then. Typescript support needed to use this feature
142
+
143
+ ## Internal Library change
144
+
145
+ - Provided support for import/export statements
146
+
147
+ # 0.0.5
148
+
149
+ - Added Init command to initialize the folder structure and configuration for testing
150
+ - Renamed config.json to env-config.json
151
+ - Configured report file path directory and Handled Edge case in Cookies Handling
152
+
153
+ # 0.0.4
154
+
155
+ - Issue Fixes while loading the storage state
156
+
157
+ # 0.0.3
158
+
159
+ - Added Support for custom config generator based on user preferences
160
+
161
+ # 0.0.2
162
+
163
+ - Fix for Finding directories inside node_modules folder
164
+
165
+ # 0.0.1
166
+
167
+ - test and report command support
package/jest.config.js CHANGED
@@ -1,64 +1,82 @@
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
+ reporters: [
9
+ "default",
10
+ [
11
+ "jest-html-reporter",
12
+ {
13
+ outputPath: "unit_reports/unit-report.html",
14
+ pageTitle: "Unit Report"
15
+ }
16
+ ]
17
+ ],
18
+ rootDir: process.cwd(),
19
+ testEnvironment: 'node',
20
+
21
+ setupFilesAfterEnv: [
22
+ existsSync(appGlobals) && appGlobals,
23
+ path.resolve(__dirname, 'src', 'core', 'jest', 'setup', 'index.js')
24
+ ].filter(Boolean),
25
+
26
+ transform: {
27
+ '^.+\\.(js|jsx)$': path.resolve(
28
+ __dirname,
29
+ 'src',
30
+ 'core',
31
+ 'jest',
32
+ 'preprocessor',
33
+ 'jsPreprocessor.js'
34
+ ),
35
+ '^.+\\.jsx?$': 'babel-jest'
36
+ },
37
+
38
+ testMatch: ['**/__tests__/**/*.test.js'],
39
+
40
+ modulePathIgnorePatterns: ['/build/'],
41
+
42
+ transformIgnorePatterns: [
43
+ '/node_modules/',
44
+ '/src/setup-folder-structure/samples/'
45
+ ],
46
+
47
+ coveragePathIgnorePatterns:[
48
+ '/src/setup-folder-structure/samples/'
49
+ ],
50
+
51
+ testPathIgnorePatterns: [
52
+ '/node_modules/',
53
+ '/build/',
54
+ '/uat/'
55
+ ],
56
+
57
+ watchPathIgnorePatterns: [
58
+ '/node_modules/',
59
+ '/build/'
60
+ ],
61
+
62
+ clearMocks: true,
63
+ resetMocks: false,
64
+
65
+ collectCoverage: true,
66
+ collectCoverageFrom: ['src/**/*.js'],
67
+ coverageDirectory: './build/cov',
68
+ coverageReporters: ['lcov', 'json', 'html', 'json-summary', 'text'],
69
+ // coverageThreshold: {
70
+ // global: {
71
+ // branches: 100,
72
+ // functions: 100,
73
+ // lines: 100,
74
+ // statements: 100
75
+ // }
76
+ // },
77
+ globals: {
78
+ __DEVELOPMENT__: true,
79
+ __DOCS__: false,
80
+ __TEST__: true
81
+ }
64
82
  };