@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.
- package/.babelrc +18 -18
- package/.eslintrc.js +27 -31
- package/.prettierrc +5 -5
- package/README.md +17 -17
- package/bin/cli.js +2 -2
- package/build/bdd-framework/cli/commands/env.js +4 -4
- package/build/bdd-framework/cli/commands/test.js +2 -6
- package/build/bdd-framework/cli/options.js +4 -4
- package/build/bdd-framework/cli/worker.js +3 -3
- package/build/bdd-framework/config/dir.js +6 -6
- package/build/bdd-framework/config/env.js +4 -5
- package/build/bdd-framework/config/index.js +2 -2
- package/build/bdd-framework/cucumber/buildStepDefinition.js +3 -3
- package/build/bdd-framework/cucumber/gherkin.d.ts +45 -0
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +3 -3
- package/build/bdd-framework/cucumber/loadSources.js +9 -9
- package/build/bdd-framework/cucumber/loadSteps.js +3 -8
- package/build/bdd-framework/decorators.js +2 -2
- package/build/bdd-framework/gen/formatter.js +17 -64
- package/build/bdd-framework/gen/i18n.js +5 -9
- package/build/bdd-framework/gen/index.js +8 -9
- package/build/bdd-framework/gen/poms.js +46 -0
- package/build/bdd-framework/gen/testFile.js +55 -121
- package/build/bdd-framework/gen/testNode.js +6 -19
- package/build/bdd-framework/gen/testPoms.js +39 -49
- package/build/bdd-framework/playwright/fixtureParameterNames.js +11 -27
- package/build/bdd-framework/playwright/getLocationInFile.js +11 -17
- package/build/bdd-framework/playwright/loadConfig.js +3 -3
- package/build/bdd-framework/playwright/testTypeImpl.js +15 -19
- package/build/bdd-framework/playwright/transform.js +6 -10
- package/build/bdd-framework/playwright/utils.js +6 -3
- package/build/bdd-framework/run/bddFixtures.js +55 -118
- package/build/bdd-framework/run/bddWorld.js +36 -24
- package/build/bdd-framework/snippets/index.js +3 -5
- package/build/bdd-framework/snippets/snippetSyntax.js +1 -3
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +4 -4
- package/build/bdd-framework/stepDefinitions/createBdd.js +13 -30
- package/build/bdd-framework/stepDefinitions/createDecorators.js +108 -0
- package/build/bdd-framework/stepDefinitions/decorators/{class.js → poms.js} +9 -13
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +8 -14
- package/build/bdd-framework/stepDefinitions/defineStep.js +4 -5
- package/build/bdd-framework/stepDefinitions/stepConfig.js +5 -5
- package/build/bdd-framework/utils/exit.js +18 -26
- package/build/bdd-framework/utils/index.js +4 -30
- package/build/bdd-framework/utils/jsStringWrap.js +9 -9
- package/build/bdd-framework/utils/logger.js +3 -5
- package/build/bdd-poc/core-runner/exportMethods.js +14 -0
- package/build/bdd-poc/core-runner/stepDefinitions.js +55 -0
- package/build/bdd-poc/main.js +10 -0
- package/build/bdd-poc/test/cucumber/featureFileParer.js +81 -0
- package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +36 -0
- package/build/bdd-poc/test/stepGenerate/stepsnippets.js +43 -0
- package/build/bdd-poc/test/testDataMap.js +98 -0
- package/build/bdd-poc/test/testStructure.js +83 -0
- package/build/bdd-poc/utils/stringManipulation.js +19 -0
- package/build/core/playwright/custom-commands.js +1 -1
- package/build/core/playwright/index.js +0 -15
- package/build/core/playwright/readConfigFile.js +30 -37
- package/build/core/playwright/report-generator.js +1 -2
- package/build/core/playwright/setup/config-creator.js +15 -21
- package/build/core/playwright/setup/config-utils.js +0 -30
- package/build/core/playwright/test-runner.js +5 -7
- package/build/index.d.ts +5 -60
- package/build/index.js +3 -5
- package/build/lib/cli.js +1 -10
- package/build/parser/sample.feature +34 -34
- package/build/parser/sample.spec.js +18 -18
- package/build/setup-folder-structure/samples/auth-setup-sample.js +72 -72
- package/build/setup-folder-structure/samples/authUsers-sample.json +8 -8
- package/build/setup-folder-structure/samples/env-config-sample.json +20 -20
- package/build/setup-folder-structure/samples/git-ignore.sample.js +32 -36
- package/build/setup-folder-structure/samples/uat-config-sample.js +43 -44
- package/build/setup-folder-structure/setupProject.js +5 -10
- package/build/utils/cliArgsToObject.js +25 -25
- package/build/utils/fileUtils.js +0 -12
- package/changelog.md +74 -124
- package/jest.config.js +63 -63
- package/npm-shrinkwrap.json +7781 -6469
- package/package.json +54 -55
- package/playwright.config.js +112 -112
- package/build/bdd-framework/config/lang.js +0 -14
- package/build/bdd-framework/gen/fixtures.js +0 -48
- package/build/bdd-framework/hooks/scenario.js +0 -107
- package/build/bdd-framework/hooks/worker.js +0 -83
- package/build/bdd-framework/run/StepInvoker.js +0 -73
- package/build/core/playwright/clear-caches.js +0 -29
- package/build/core/playwright/setup/custom-reporter.js +0 -100
- package/build/core/playwright/tag-processor.js +0 -68
- package/build/setup-folder-structure/helper.js +0 -34
- package/build/setup-folder-structure/reportEnhancement/addonScript.html +0 -25
- 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.
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
# 0.1.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
# 0.
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
};
|