@zohodesk/testinglibrary 0.0.7 → 0.0.8-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.
- package/.babelrc +7 -2
- package/.eslintrc.js +5 -1
- package/.gitlab-ci.yml +206 -0
- package/README.md +172 -1
- package/build/common/data-generator/steps/DataGenerator.spec.js +19 -0
- package/build/common/data-generator/steps/DataGeneratorStepsHelper.js +19 -0
- package/build/common/multi-actor/steps/multiActorHandling.spec.js +26 -0
- package/build/common/searchFake/helpers/rpcRequestHelper.js +52 -0
- package/build/common/searchFake/steps/searchFake.spec.js +77 -0
- package/build/core/dataGenerator/DataGenerator.js +108 -0
- package/build/core/dataGenerator/DataGeneratorError.js +50 -0
- package/build/core/dataGenerator/DataGeneratorHelper.js +49 -0
- package/build/core/jest/preprocessor/jsPreprocessor.js +3 -9
- package/build/core/jest/setup/index.js +1 -7
- package/build/core/playwright/builtInFixtures/actorContext.js +75 -0
- package/build/core/playwright/builtInFixtures/addTags.js +19 -0
- package/build/core/playwright/builtInFixtures/cacheLayer.js +13 -0
- package/build/core/playwright/builtInFixtures/context.js +32 -0
- package/build/core/playwright/builtInFixtures/executionContext.js +17 -0
- package/build/core/playwright/builtInFixtures/i18N.js +41 -0
- package/build/core/playwright/builtInFixtures/index.js +46 -0
- package/build/core/playwright/builtInFixtures/page.js +38 -0
- package/build/core/playwright/builtInFixtures/unauthenticatedPage.js +18 -0
- package/build/core/playwright/clear-caches.js +49 -0
- package/build/core/playwright/codegen.js +4 -4
- package/build/core/playwright/configuration/Configuration.js +25 -0
- package/build/core/playwright/configuration/ConfigurationHelper.js +43 -0
- package/build/core/playwright/configuration/UserArgs.js +12 -0
- package/build/core/playwright/constants/browserTypes.js +12 -0
- package/build/core/playwright/constants/fileMutexConfig.js +9 -0
- package/build/core/playwright/custom-commands.js +1 -2
- package/build/core/playwright/env-initializer.js +28 -6
- package/build/core/playwright/fixtures.js +24 -0
- package/build/core/playwright/helpers/additionalProfiles.js +25 -0
- package/build/core/playwright/helpers/auth/accountLogin.js +21 -0
- package/build/core/playwright/helpers/auth/checkAuthCookies.js +41 -0
- package/build/core/playwright/helpers/auth/getUrlOrigin.js +13 -0
- package/build/core/playwright/helpers/auth/getUsers.js +118 -0
- package/build/core/playwright/helpers/auth/index.js +76 -0
- package/build/core/playwright/helpers/auth/loginDefaultStepsHelper.js +54 -0
- package/build/core/playwright/helpers/auth/loginSteps.js +50 -0
- package/build/core/playwright/helpers/checkAuthDirectory.js +27 -0
- package/build/core/playwright/helpers/configFileNameProvider.js +31 -0
- package/build/core/playwright/helpers/customFixturesHelper.js +58 -0
- package/build/core/playwright/helpers/fileMutex.js +71 -0
- package/build/core/playwright/helpers/getUserFixtures.js +23 -0
- package/build/core/playwright/helpers/mergeObjects.js +13 -0
- package/build/core/playwright/helpers/parseUserArgs.js +10 -0
- package/build/core/playwright/index.js +10 -98
- package/build/core/playwright/readConfigFile.js +93 -14
- package/build/core/playwright/report-generator.js +9 -8
- package/build/core/playwright/runner/Runner.js +22 -0
- package/build/core/playwright/runner/RunnerHelper.js +43 -0
- package/build/core/playwright/runner/RunnerTypes.js +17 -0
- package/build/core/playwright/runner/SpawnRunner.js +113 -0
- package/build/core/playwright/setup/Project.js +35 -0
- package/build/core/playwright/setup/ProjectConfiguration.js +80 -0
- package/build/core/playwright/setup/config-creator.js +75 -103
- package/build/core/playwright/setup/config-utils.js +188 -0
- package/build/core/playwright/setup/custom-reporter.js +136 -0
- package/build/core/playwright/setup/qc-custom-reporter.js +291 -0
- package/build/core/playwright/tagProcessor.js +69 -0
- package/build/core/playwright/test-runner.js +84 -98
- package/build/core/playwright/types.js +44 -0
- package/build/core/playwright/validateFeature.js +28 -0
- package/build/decorators.d.ts +1 -1
- package/build/decorators.js +1 -1
- package/build/index.d.ts +76 -3
- package/build/index.js +63 -17
- package/build/lib/cli.js +28 -4
- package/build/lib/post-install.js +19 -11
- package/build/parser/parser.js +0 -1
- package/build/setup-folder-structure/helper.js +37 -0
- package/build/setup-folder-structure/reportEnhancement/addonScript.html +25 -0
- package/build/setup-folder-structure/reportEnhancement/reportAlteration.js +25 -0
- package/build/setup-folder-structure/samples/accountLogin-sample.js +19 -0
- package/build/setup-folder-structure/samples/actors-index.js +2 -0
- package/build/setup-folder-structure/samples/auth-setup-sample.js +10 -67
- package/build/setup-folder-structure/samples/editions-index.js +3 -0
- package/build/setup-folder-structure/samples/free-sample.json +25 -0
- package/build/setup-folder-structure/samples/git-ignore.sample.js +8 -4
- package/build/setup-folder-structure/samples/settings.json +7 -0
- package/build/setup-folder-structure/samples/testSetup-sample.js +14 -0
- package/build/setup-folder-structure/samples/uat-config-sample.js +13 -2
- package/build/setup-folder-structure/setupProject.js +34 -12
- package/build/test/core/playwright/__tests__/tagProcessor.test.js +94 -0
- package/build/test/core/playwright/__tests__/validateFeature.test.js +69 -0
- package/build/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js +27 -0
- package/build/test/core/playwright/configuration/__tests__/Configuration.test.js +53 -0
- package/build/test/core/playwright/helpers/__tests__/additionalProfiles.test.js +45 -0
- package/build/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js +34 -0
- package/build/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js +51 -0
- package/build/test/core/playwright/helpers/__tests__/fileMutex.test.js +79 -0
- package/build/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js +80 -0
- package/build/test/core/playwright/runner/__tests__/RunnerHelper.test.js +16 -0
- package/build/test/core/playwright/runner/__tests__/SpawnRunner.test.js +27 -0
- package/build/utils/cliArgsToObject.js +8 -1
- package/build/utils/commonUtils.js +17 -0
- package/build/utils/fileUtils.js +60 -4
- package/build/utils/logger.js +1 -31
- package/build/utils/rootPath.js +16 -9
- package/build/utils/stepDefinitionsFormatter.js +1 -2
- package/changelog.md +167 -0
- package/jest.config.js +29 -11
- package/npm-shrinkwrap.json +9610 -6631
- package/package.json +34 -27
- package/playwright.config.js +0 -50
- package/test-results/.last-run.json +4 -0
- package/unit_reports/unit-report.html +277 -0
- package/Changelog.md +0 -42
- package/build/bdd-framework/cli/commands/env.js +0 -43
- package/build/bdd-framework/cli/commands/export.js +0 -48
- package/build/bdd-framework/cli/commands/test.js +0 -59
- package/build/bdd-framework/cli/index.js +0 -11
- package/build/bdd-framework/cli/options.js +0 -20
- package/build/bdd-framework/cli/worker.js +0 -13
- package/build/bdd-framework/config/dir.js +0 -27
- package/build/bdd-framework/config/env.js +0 -49
- package/build/bdd-framework/config/index.js +0 -91
- package/build/bdd-framework/cucumber/buildStepDefinition.js +0 -43
- package/build/bdd-framework/cucumber/gherkin.d.js +0 -5
- package/build/bdd-framework/cucumber/gherkin.d.ts +0 -45
- package/build/bdd-framework/cucumber/loadConfig.js +0 -17
- package/build/bdd-framework/cucumber/loadFeatures.js +0 -39
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +0 -20
- package/build/bdd-framework/cucumber/loadSources.js +0 -57
- package/build/bdd-framework/cucumber/loadSteps.js +0 -35
- package/build/bdd-framework/decorators.js +0 -22
- package/build/bdd-framework/gen/formatter.js +0 -88
- package/build/bdd-framework/gen/i18n.js +0 -35
- package/build/bdd-framework/gen/index.js +0 -160
- package/build/bdd-framework/gen/poms.js +0 -46
- package/build/bdd-framework/gen/testFile.js +0 -356
- package/build/bdd-framework/gen/testNode.js +0 -48
- package/build/bdd-framework/gen/testPoms.js +0 -123
- package/build/bdd-framework/index.js +0 -45
- package/build/bdd-framework/playwright/fixtureParameterNames.js +0 -77
- package/build/bdd-framework/playwright/getLocationInFile.js +0 -46
- package/build/bdd-framework/playwright/loadConfig.js +0 -42
- package/build/bdd-framework/playwright/testTypeImpl.js +0 -41
- package/build/bdd-framework/playwright/transform.js +0 -80
- package/build/bdd-framework/playwright/types.js +0 -5
- package/build/bdd-framework/playwright/utils.js +0 -34
- package/build/bdd-framework/run/bddFixtures.js +0 -108
- package/build/bdd-framework/run/bddWorld.js +0 -87
- package/build/bdd-framework/snippets/index.js +0 -131
- package/build/bdd-framework/snippets/snippetSyntax.js +0 -41
- package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +0 -26
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +0 -18
- package/build/bdd-framework/stepDefinitions/createBdd.js +0 -49
- package/build/bdd-framework/stepDefinitions/createDecorators.js +0 -109
- package/build/bdd-framework/stepDefinitions/decorators/poms.js +0 -50
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +0 -94
- package/build/bdd-framework/stepDefinitions/defineStep.js +0 -61
- package/build/bdd-framework/stepDefinitions/stepConfig.js +0 -24
- package/build/bdd-framework/utils/index.js +0 -50
- package/build/bdd-framework/utils/jsStringWrap.js +0 -44
- package/build/bdd-framework/utils/logger.js +0 -29
- package/build/setup-folder-structure/samples/authUsers-sample.json +0 -9
- package/build/setup-folder-structure/samples/env-config-sample.json +0 -21
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-n20-experimental",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "node bin/postinstall.js",
|
|
8
|
-
"test": "
|
|
8
|
+
"test": "jest",
|
|
9
9
|
"clean": "rm -rf build && mkdir build",
|
|
10
10
|
"build-babel": "babel -d ./build ./src --copy-files",
|
|
11
11
|
"build": "npm run clean && npm run build-babel",
|
|
@@ -14,41 +14,48 @@
|
|
|
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",
|
|
19
|
+
"./DataGenerator": "./build/core/dataGenerator/DataGenerator.js"
|
|
18
20
|
},
|
|
19
21
|
"keywords": [],
|
|
20
22
|
"author": "",
|
|
21
23
|
"license": "ISC",
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@babel/
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@testing-library/
|
|
29
|
-
"
|
|
30
|
-
"babel-
|
|
31
|
-
"
|
|
32
|
-
"fast-glob": "
|
|
33
|
-
"jest": "
|
|
34
|
-
"jest-environment-jsdom": "
|
|
35
|
-
"
|
|
25
|
+
"@babel/code-frame": "7.27.1",
|
|
26
|
+
"@babel/preset-react": "7.28.5",
|
|
27
|
+
"@cucumber/cucumber": "12.2.0",
|
|
28
|
+
"@playwright/test": "1.56.1",
|
|
29
|
+
"@reportportal/agent-js-playwright": "5.2.2",
|
|
30
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
31
|
+
"@testing-library/react": "16.3.0",
|
|
32
|
+
"babel-jest": "30.2.0",
|
|
33
|
+
"babel-plugin-transform-dynamic-import": "2.1.0",
|
|
34
|
+
"fast-glob": "3.3.3",
|
|
35
|
+
"jest": "30.2.0",
|
|
36
|
+
"jest-environment-jsdom": "30.2.0",
|
|
37
|
+
"jsonpath": "1.1.1",
|
|
38
|
+
"msw": "2.11.6",
|
|
39
|
+
"playwright": "1.56.1",
|
|
40
|
+
"supports-color": "10.2.2",
|
|
41
|
+
"playwright-bdd": "8.4.1"
|
|
36
42
|
},
|
|
37
43
|
"bin": {
|
|
38
44
|
"ZDTestingFramework": "./bin/cli.js"
|
|
39
45
|
},
|
|
40
46
|
"peerDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"react
|
|
47
|
+
"eslint": "*",
|
|
48
|
+
"react": "*",
|
|
49
|
+
"react-dom": "*"
|
|
43
50
|
},
|
|
44
51
|
"devDependencies": {
|
|
45
|
-
"@babel/cli": "
|
|
46
|
-
"@babel/core": "
|
|
47
|
-
"@babel/node": "
|
|
48
|
-
"@babel/plugin-transform-runtime": "
|
|
49
|
-
"@babel/
|
|
50
|
-
"@babel/
|
|
51
|
-
"
|
|
52
|
-
"
|
|
52
|
+
"@babel/cli": "7.28.3",
|
|
53
|
+
"@babel/core": "7.28.4",
|
|
54
|
+
"@babel/node": "7.28.0",
|
|
55
|
+
"@babel/plugin-transform-runtime": "7.28.3",
|
|
56
|
+
"@babel/preset-env": "7.28.3",
|
|
57
|
+
"@babel/runtime": "7.28.4",
|
|
58
|
+
"commander": "14.0.1",
|
|
59
|
+
"jest-html-reporter": "4.3.0"
|
|
53
60
|
}
|
|
54
|
-
}
|
|
61
|
+
}
|
package/playwright.config.js
CHANGED
|
@@ -3,47 +3,23 @@ const { defineConfig, devices } = require('@playwright/test');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const numCPUs = require('os').cpus().length;
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Read environment variables from file.
|
|
8
|
-
* https://github.com/motdotla/dotenv
|
|
9
|
-
*/
|
|
10
|
-
// require('dotenv').config();
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @see https://playwright.dev/docs/test-configuration
|
|
14
|
-
*/
|
|
15
6
|
export default defineConfig({
|
|
16
7
|
testDir: path.join(path.resolve(process.cwd()), 'uat'),
|
|
17
8
|
outputDir: path.join(process.cwd(), 'uat', 'test-results'),
|
|
18
|
-
/* Run tests in files in parallel */
|
|
19
9
|
fullyParallel: true,
|
|
20
|
-
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
21
|
-
forbidOnly: !!process.env.CI,
|
|
22
|
-
/* Retry on CI only */
|
|
23
10
|
retries: process.env.CI ? 2 : 0,
|
|
24
|
-
/* Opt out of parallel tests on CI. */
|
|
25
|
-
workers: process.env.CI ? 1 : 1,
|
|
26
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
27
11
|
reporter: [['html', { outputFolder: path.join(process.cwd(), 'uat', 'playwright-report'), open: "always" }]],
|
|
28
12
|
timeout: 60 * 1000,
|
|
29
13
|
expect: {
|
|
30
14
|
timeout: 5 * 1000,
|
|
31
15
|
},
|
|
32
|
-
|
|
33
|
-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
34
16
|
use: {
|
|
35
|
-
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
36
|
-
//baseURL: process.env.domain,
|
|
37
|
-
|
|
38
|
-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
39
17
|
trace: 'on',
|
|
40
18
|
video: {
|
|
41
19
|
mode: 'on',
|
|
42
20
|
size: { width: 640, height: 480 }
|
|
43
21
|
}
|
|
44
22
|
},
|
|
45
|
-
|
|
46
|
-
/* Configure projects for major browsers */
|
|
47
23
|
projects: [
|
|
48
24
|
{ name: 'setup', testMatch: /.*\.setup\.js/ },
|
|
49
25
|
{
|
|
@@ -81,32 +57,6 @@ export default defineConfig({
|
|
|
81
57
|
dependencies: ['setup'],
|
|
82
58
|
},
|
|
83
59
|
|
|
84
|
-
/* Test against mobile viewports. */
|
|
85
|
-
// {
|
|
86
|
-
// name: 'Mobile Chrome',
|
|
87
|
-
// use: { ...devices['Pixel 5'] },
|
|
88
|
-
// },
|
|
89
|
-
// {
|
|
90
|
-
// name: 'Mobile Safari',
|
|
91
|
-
// use: { ...devices['iPhone 12'] },
|
|
92
|
-
// },
|
|
93
|
-
|
|
94
|
-
/* Test against branded browsers. */
|
|
95
|
-
// {
|
|
96
|
-
// name: 'Microsoft Edge',
|
|
97
|
-
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
98
|
-
// },
|
|
99
|
-
// {
|
|
100
|
-
// name: 'Google Chrome',
|
|
101
|
-
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
102
|
-
// },
|
|
103
60
|
],
|
|
104
|
-
|
|
105
|
-
/* Run your local dev server before starting the tests */
|
|
106
|
-
// webServer: {
|
|
107
|
-
// command: 'npm run start',
|
|
108
|
-
// url: 'http://127.0.0.1:3000',
|
|
109
|
-
// reuseExistingServer: !process.env.CI,
|
|
110
|
-
// },
|
|
111
61
|
});
|
|
112
62
|
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>Unit Report</title><style type="text/css">:root {
|
|
2
|
+
--text-primary: #111;
|
|
3
|
+
--text-secondary: #4f4f4f;
|
|
4
|
+
--success: #006633;
|
|
5
|
+
--success-bright: #80ffbf;
|
|
6
|
+
--danger: #cc071e;
|
|
7
|
+
--danger-bright: #fbdfe0;
|
|
8
|
+
--warning: #995c00;
|
|
9
|
+
--warning-bright: #ffeea8;
|
|
10
|
+
--panel: #eee;
|
|
11
|
+
--border: #949494;
|
|
12
|
+
--disabled: #6b6b6b;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html,
|
|
16
|
+
body {
|
|
17
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
color: var(--text-primary);
|
|
22
|
+
}
|
|
23
|
+
body {
|
|
24
|
+
padding: 2rem 1rem;
|
|
25
|
+
}
|
|
26
|
+
.jesthtml-content {
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
max-width: 70rem;
|
|
29
|
+
}
|
|
30
|
+
header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
#title {
|
|
35
|
+
margin: 0;
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
#logo {
|
|
39
|
+
height: 4rem;
|
|
40
|
+
}
|
|
41
|
+
#timestamp {
|
|
42
|
+
color: var(--text-secondary);
|
|
43
|
+
margin-top: 0.5rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#metadata-container {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 2rem;
|
|
50
|
+
margin-bottom: 2rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.additional-information-container {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 0.5rem;
|
|
57
|
+
color: var(--text-secondary);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** SUMMARY */
|
|
61
|
+
#summary {
|
|
62
|
+
color: var(--text-primary);
|
|
63
|
+
display: flex;
|
|
64
|
+
font-family: monospace;
|
|
65
|
+
font-size: 1rem;
|
|
66
|
+
}
|
|
67
|
+
#summary > div {
|
|
68
|
+
margin-right: 0.5rem;
|
|
69
|
+
background: var(--panel);
|
|
70
|
+
padding: 1rem;
|
|
71
|
+
min-width: 15rem;
|
|
72
|
+
}
|
|
73
|
+
#summary > div:last-child {
|
|
74
|
+
margin-right: 0;
|
|
75
|
+
}
|
|
76
|
+
@media only screen and (max-width: 720px) {
|
|
77
|
+
#summary {
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
}
|
|
80
|
+
#summary > div {
|
|
81
|
+
margin-right: 0;
|
|
82
|
+
margin-top: 1rem;
|
|
83
|
+
}
|
|
84
|
+
#summary > div:first-child {
|
|
85
|
+
margin-top: 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.summary-total {
|
|
90
|
+
font-weight: bold;
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
.summary-passed {
|
|
94
|
+
color: var(--success);
|
|
95
|
+
border-left: 0.4rem solid var(--success);
|
|
96
|
+
padding-left: 0.5rem;
|
|
97
|
+
margin-bottom: 0.15rem;
|
|
98
|
+
}
|
|
99
|
+
.summary-failed,
|
|
100
|
+
.summary-obsolete-snapshots {
|
|
101
|
+
color: var(--danger);
|
|
102
|
+
border-left: 0.4rem solid var(--danger);
|
|
103
|
+
padding-left: 0.5rem;
|
|
104
|
+
margin-bottom: 0.15rem;
|
|
105
|
+
}
|
|
106
|
+
.summary-pending {
|
|
107
|
+
color: var(--warning);
|
|
108
|
+
border-left: 0.4rem solid var(--warning);
|
|
109
|
+
padding-left: 0.5rem;
|
|
110
|
+
margin-bottom: 0.15rem;
|
|
111
|
+
}
|
|
112
|
+
.summary-empty {
|
|
113
|
+
color: var(--disabled);
|
|
114
|
+
border-left: 0.4rem solid var(--disabled);
|
|
115
|
+
margin-bottom: 0.15rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.test-result {
|
|
119
|
+
padding: 1rem;
|
|
120
|
+
margin-bottom: 0.25rem;
|
|
121
|
+
}
|
|
122
|
+
.test-result:last-child {
|
|
123
|
+
border: 0;
|
|
124
|
+
}
|
|
125
|
+
.test-result.passed {
|
|
126
|
+
background-color: var(--success-bright);
|
|
127
|
+
color: var(--success);
|
|
128
|
+
}
|
|
129
|
+
.test-result.failed {
|
|
130
|
+
background-color: var(--danger-bright);
|
|
131
|
+
color: var(--danger);
|
|
132
|
+
}
|
|
133
|
+
.test-result.pending {
|
|
134
|
+
background-color: var(--warning-bright);
|
|
135
|
+
color: var(--warning);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.test-info {
|
|
139
|
+
display: flex;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
}
|
|
142
|
+
.test-suitename {
|
|
143
|
+
width: 20%;
|
|
144
|
+
text-align: left;
|
|
145
|
+
font-weight: bold;
|
|
146
|
+
word-break: break-word;
|
|
147
|
+
}
|
|
148
|
+
.test-title {
|
|
149
|
+
width: 40%;
|
|
150
|
+
text-align: left;
|
|
151
|
+
font-style: italic;
|
|
152
|
+
}
|
|
153
|
+
.test-status {
|
|
154
|
+
width: 20%;
|
|
155
|
+
text-align: right;
|
|
156
|
+
}
|
|
157
|
+
.test-duration {
|
|
158
|
+
width: 10%;
|
|
159
|
+
text-align: right;
|
|
160
|
+
font-size: 0.85rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.failureMessages {
|
|
164
|
+
padding: 0 1rem;
|
|
165
|
+
margin-top: 1rem;
|
|
166
|
+
border-top: 1px dashed var(--danger);
|
|
167
|
+
}
|
|
168
|
+
.failureMessages.suiteFailure {
|
|
169
|
+
border-top: none;
|
|
170
|
+
}
|
|
171
|
+
.failureMsg {
|
|
172
|
+
white-space: pre-wrap;
|
|
173
|
+
white-space: -moz-pre-wrap;
|
|
174
|
+
white-space: -pre-wrap;
|
|
175
|
+
white-space: -o-pre-wrap;
|
|
176
|
+
word-wrap: break-word;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.suite-container {
|
|
180
|
+
margin-bottom: 1rem;
|
|
181
|
+
}
|
|
182
|
+
.suite-info {
|
|
183
|
+
padding: 1rem;
|
|
184
|
+
background-color: var(--panel);
|
|
185
|
+
color: var(--text-secondary);
|
|
186
|
+
border: 0.15rem solid;
|
|
187
|
+
border-color: var(--panel);
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
margin-bottom: 0.25rem;
|
|
191
|
+
}
|
|
192
|
+
.suite-info:hover {
|
|
193
|
+
border-color: var(--border);
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
}
|
|
196
|
+
.suite-info .suite-path {
|
|
197
|
+
word-break: break-all;
|
|
198
|
+
flex-grow: 1;
|
|
199
|
+
font-family: monospace;
|
|
200
|
+
font-size: 1rem;
|
|
201
|
+
}
|
|
202
|
+
.suite-info .suite-time {
|
|
203
|
+
margin-left: 1rem;
|
|
204
|
+
padding: 0.2rem 0.3rem;
|
|
205
|
+
font-size: 0.85rem;
|
|
206
|
+
}
|
|
207
|
+
.suite-info .suite-time.warn {
|
|
208
|
+
background-color: var(--danger);
|
|
209
|
+
color: #fff;
|
|
210
|
+
}
|
|
211
|
+
.suite-info:before {
|
|
212
|
+
content: "\2303";
|
|
213
|
+
display: inline-block;
|
|
214
|
+
margin-right: 1rem;
|
|
215
|
+
transform: rotate(180deg) translateY(0.15rem);
|
|
216
|
+
}
|
|
217
|
+
.suite-container[open] .suite-info:before {
|
|
218
|
+
transform: rotate(0deg) translateY(0.15rem);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* CONSOLE LOGS */
|
|
222
|
+
.suite-consolelog {
|
|
223
|
+
margin-bottom: 0.25rem;
|
|
224
|
+
padding: 1rem;
|
|
225
|
+
background-color: var(--panel);
|
|
226
|
+
}
|
|
227
|
+
.suite-consolelog-header {
|
|
228
|
+
font-weight: bold;
|
|
229
|
+
}
|
|
230
|
+
.suite-consolelog-item {
|
|
231
|
+
padding: 0.5rem;
|
|
232
|
+
}
|
|
233
|
+
.suite-consolelog-item pre {
|
|
234
|
+
margin: 0.5rem 0;
|
|
235
|
+
white-space: pre-wrap;
|
|
236
|
+
white-space: -moz-pre-wrap;
|
|
237
|
+
white-space: -pre-wrap;
|
|
238
|
+
white-space: -o-pre-wrap;
|
|
239
|
+
word-wrap: break-word;
|
|
240
|
+
}
|
|
241
|
+
.suite-consolelog-item-origin {
|
|
242
|
+
color: var(--text-secondary);
|
|
243
|
+
font-weight: bold;
|
|
244
|
+
}
|
|
245
|
+
.suite-consolelog-item-message {
|
|
246
|
+
color: var(--text-primary);
|
|
247
|
+
font-size: 1rem;
|
|
248
|
+
padding: 0 0.5rem;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* OBSOLETE SNAPSHOTS */
|
|
252
|
+
.suite-obsolete-snapshots {
|
|
253
|
+
margin-bottom: 0.25rem;
|
|
254
|
+
padding: 1rem;
|
|
255
|
+
background-color: var(--danger-bright);
|
|
256
|
+
color: var(--danger);
|
|
257
|
+
}
|
|
258
|
+
.suite-obsolete-snapshots-header {
|
|
259
|
+
font-weight: bold;
|
|
260
|
+
}
|
|
261
|
+
.suite-obsolete-snapshots-item {
|
|
262
|
+
padding: 0.5rem;
|
|
263
|
+
}
|
|
264
|
+
.suite-obsolete-snapshots-item pre {
|
|
265
|
+
margin: 0.5rem 0;
|
|
266
|
+
white-space: pre-wrap;
|
|
267
|
+
white-space: -moz-pre-wrap;
|
|
268
|
+
white-space: -pre-wrap;
|
|
269
|
+
white-space: -o-pre-wrap;
|
|
270
|
+
word-wrap: break-word;
|
|
271
|
+
}
|
|
272
|
+
.suite-obsolete-snapshots-item-message {
|
|
273
|
+
color: var(--text-primary);
|
|
274
|
+
font-size: 1rem;
|
|
275
|
+
padding: 0 0.5rem;
|
|
276
|
+
}
|
|
277
|
+
</style></head><body><main class="jesthtml-content"><header><h1 id="title">Unit Report</h1></header><section id="metadata-container"><div id="timestamp">Started: 2025-11-05 12:01:55</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (12)</div><div class="summary-passed ">12 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (41)</div><div class="summary-passed ">41 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></section><details id="suite-1" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/configuration/__tests__/Configuration.test.js</div><div class="suite-time">1.164s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should add new key-value pair to the configuration</div><div class="test-status">passed</div><div class="test-duration">0.003s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should combine configurations correctly using addAll</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should return correct value for a given key</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div></div></details><details id="suite-2" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js</div><div class="suite-time">1.498s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when config file cannot be loaded</div><div class="test-status">passed</div><div class="test-duration">0.032s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when beta feature config does not exist</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads main configuration when betaFeature is not provided and main config file exists</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">falls back to default configuration if main config file does not exist</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads beta feature configuration when betaFeature is provided</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-3" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/tagProcessor.test.js</div><div class="suite-time">1.336s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should return tagArgs if no edition is provided</div><div class="test-status">passed</div><div class="test-duration">0.003s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with <= operator</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with >= operator</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with < operator</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with > operator</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with no operator</div><div class="test-status">passed</div><div class="test-duration">0.023s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should log a message if edition is not found</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle multiple editions</div><div class="test-status">passed</div><div class="test-duration">0.014s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should build tags correctly when tags are empty</div><div class="test-status">passed</div><div class="test-duration">0.006s</div></div></div></div></details><details id="suite-4" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/additionalProfiles.test.js</div><div class="suite-time">1.789s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return empty object when no additional profile tags are present</div><div class="test-status">passed</div><div class="test-duration">0.013s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when additional profile tags and editionInfo are present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when all actor details are present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-5" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js</div><div class="suite-time">1.795s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns selected user when any tag info is present</div><div class="test-status">passed</div><div class="test-duration">0.054s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">logs and returns undefined if getCustomAccountDetails function throws</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns default actor when no tag info is not provided</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div></div></details><details id="suite-6" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js</div><div class="suite-time">0.329s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">return the pipeline matched config files for pipeline matched files exists</div><div class="test-status">passed</div><div class="test-duration">0.003s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">return the default config files for pipeline matched files not exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-7" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/examples/src/__tests__/App.test.js</div><div class="suite-time">0.106s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">add function adds two numbers correctly</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">greet function greets a person with their name</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-8" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js</div><div class="suite-time">0.211s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">executionContext</div><div class="test-title">should pass actorInfo with details from getCustomAccountDetails to use</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div></div></details><details id="suite-9" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/fileMutex.test.js</div><div class="suite-time">2.408s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should create the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should wait for lock file deletion if it exists</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should reject if watch timeout exceeds</div><div class="test-status">passed</div><div class="test-duration">1.014s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should delete the lock file if it exists</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should release lock by deleting lock file</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should not attempt to delete the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should log an error if deleting the lock file fails</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div></div></details><details id="suite-10" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/SpawnRunner.test.js</div><div class="suite-time">1.288s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">SpawnRunner > run</div><div class="test-title">should call runPreprocessing when bddMode is true</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-11" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/RunnerHelper.test.js</div><div class="suite-time">1.058s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should throw error on invalid runner type</div><div class="test-status">passed</div><div class="test-duration">0.018s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should create a valid runner class</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details><details id="suite-12" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/validateFeature.test.js</div><div class="suite-time">2.597s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with correct arguments and log success</div><div class="test-status">passed</div><div class="test-duration">0.006s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with playwright conf</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">error when runPreprocessing fails</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details></main></body></html>
|
package/Changelog.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Testing Framework
|
|
2
|
-
|
|
3
|
-
## Framework that abstracts the configuration for playwright and Jest
|
|
4
|
-
|
|
5
|
-
# 0.0.7
|
|
6
|
-
|
|
7
|
-
- Removed react and react-dom as dependencies. Added this as peer dependency
|
|
8
|
-
|
|
9
|
-
# 0.0.6
|
|
10
|
-
|
|
11
|
-
## Provided Initial Support for cucumber feature files
|
|
12
|
-
|
|
13
|
-
- Playwright-bdd and cucumber added as dependencies
|
|
14
|
-
- Added config bddMode which toggles the feature files processing
|
|
15
|
-
- Added expect timeout and test timeout as an option
|
|
16
|
-
- Decorators support for given, when and then. Typescript support needed to use this feature
|
|
17
|
-
|
|
18
|
-
## Internal Library change
|
|
19
|
-
|
|
20
|
-
- Provided support for import/export statements
|
|
21
|
-
|
|
22
|
-
# 0.0.5
|
|
23
|
-
|
|
24
|
-
- Added Init command to initialize the folder structure and configuration for testing
|
|
25
|
-
- Renamed config.json to env-config.json
|
|
26
|
-
- Configured report file path directory and Handled Edge case in Cookies Handling
|
|
27
|
-
|
|
28
|
-
# 0.0.4
|
|
29
|
-
|
|
30
|
-
- Issue Fixes while loading the storage state
|
|
31
|
-
|
|
32
|
-
# 0.0.3
|
|
33
|
-
|
|
34
|
-
- Added Support for custom config generator based on user preferences
|
|
35
|
-
|
|
36
|
-
# 0.0.2
|
|
37
|
-
|
|
38
|
-
- Fix for Finding directories inside node_modules folder
|
|
39
|
-
|
|
40
|
-
# 0.0.1
|
|
41
|
-
|
|
42
|
-
- test and report command support
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.envCommand = void 0;
|
|
8
|
-
exports.getOwnVersion = getOwnVersion;
|
|
9
|
-
var _commander = require("commander");
|
|
10
|
-
var _options = require("../options");
|
|
11
|
-
var _path = _interopRequireDefault(require("path"));
|
|
12
|
-
var _logger = require("../../utils/logger");
|
|
13
|
-
var _utils = require("../../utils");
|
|
14
|
-
var _loadConfig = require("../../playwright/loadConfig");
|
|
15
|
-
const logger = new _logger.Logger({
|
|
16
|
-
verbose: true
|
|
17
|
-
});
|
|
18
|
-
const envCommand = new _commander.Command('env').description('Prints environment info').addOption(_options.configOption).action(opts => {
|
|
19
|
-
logger.log(`Playwright-bdd environment info:\n`);
|
|
20
|
-
logger.log(`platform: ${process.platform}`);
|
|
21
|
-
logger.log(`node: ${process.version}`);
|
|
22
|
-
showPackageVersion('playwright-bdd');
|
|
23
|
-
showPackageVersion('@playwright/test');
|
|
24
|
-
showPackageVersion('@cucumber/cucumber');
|
|
25
|
-
showPlaywrightConfigPath(opts.config);
|
|
26
|
-
});
|
|
27
|
-
exports.envCommand = envCommand;
|
|
28
|
-
function showPackageVersion(packageName) {
|
|
29
|
-
const version = packageName === 'playwright-bdd' ? getOwnVersion() : (0, _utils.getPackageVersion)(packageName);
|
|
30
|
-
logger.log(`${packageName}: v${version}`);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Getting own version by relative path instead of using getPackageVersion(),
|
|
34
|
-
* to aneble using directly from /dist in tests.
|
|
35
|
-
*/
|
|
36
|
-
function getOwnVersion() {
|
|
37
|
-
return '5.3.0';
|
|
38
|
-
}
|
|
39
|
-
function showPlaywrightConfigPath(cliConfigPath) {
|
|
40
|
-
const resolvedConfigFile = (0, _loadConfig.resolveConfigFile)(cliConfigPath);
|
|
41
|
-
const relPath = _path.default.relative(process.cwd(), resolvedConfigFile);
|
|
42
|
-
logger.log(`Playwright config file: ${relPath}`);
|
|
43
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.exportCommand = void 0;
|
|
8
|
-
var _path = _interopRequireDefault(require("path"));
|
|
9
|
-
var _commander = require("commander");
|
|
10
|
-
var _options = require("../options");
|
|
11
|
-
var _loadConfig = require("../../playwright/loadConfig");
|
|
12
|
-
var _logger = require("../../utils/logger");
|
|
13
|
-
var _env = require("../../config/env");
|
|
14
|
-
var _test = require("./test");
|
|
15
|
-
var _gen = require("../../gen");
|
|
16
|
-
const logger = new _logger.Logger({
|
|
17
|
-
verbose: true
|
|
18
|
-
});
|
|
19
|
-
const exportCommand = new _commander.Command('export').description('Prints all step definitions').addOption(_options.configOption).action(async opts => {
|
|
20
|
-
const {
|
|
21
|
-
resolvedConfigFile
|
|
22
|
-
} = await (0, _loadConfig.loadConfig)(opts.config);
|
|
23
|
-
logger.log(`List of all steps found by config: ${_path.default.relative(process.cwd(), resolvedConfigFile)}\n`);
|
|
24
|
-
const configs = Object.values((0, _env.getEnvConfigs)());
|
|
25
|
-
(0, _test.assertConfigsCount)(configs);
|
|
26
|
-
await showStepsForConfigs(configs);
|
|
27
|
-
});
|
|
28
|
-
exports.exportCommand = exportCommand;
|
|
29
|
-
async function showStepsForConfigs(configs) {
|
|
30
|
-
// here we don't need workers (as in test command) because if some step files
|
|
31
|
-
// are already in node cache, we collected them.
|
|
32
|
-
const steps = new Set();
|
|
33
|
-
const tasks = configs.map(async config => {
|
|
34
|
-
const stepDefinitions = await new _gen.TestFilesGenerator(config).extractSteps();
|
|
35
|
-
stepDefinitions.forEach(s => steps.add(`* ${getStepText(s)}`));
|
|
36
|
-
});
|
|
37
|
-
await Promise.all(tasks);
|
|
38
|
-
steps.forEach(stepText => logger.log(stepText));
|
|
39
|
-
}
|
|
40
|
-
function getStepText({
|
|
41
|
-
pattern,
|
|
42
|
-
keyword
|
|
43
|
-
}) {
|
|
44
|
-
// for Unknown return When as it looks the most suitable
|
|
45
|
-
const keywordText = keyword === 'Unknown' ? 'When' : keyword;
|
|
46
|
-
const patternText = typeof pattern === 'string' ? pattern : pattern.source;
|
|
47
|
-
return `${keywordText} ${patternText}`;
|
|
48
|
-
}
|