@zohodesk/testinglibrary 0.0.3 → 0.0.4-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 +24 -0
- package/.eslintrc.js +31 -0
- package/.gitlab-ci.yml +175 -0
- package/.prettierrc +6 -0
- package/README.md +151 -1
- package/bin/cli.js +1 -1
- package/bin/postinstall.js +1 -16
- 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 +41 -0
- package/build/common/searchFake/steps/searchFake.spec.js +26 -0
- package/build/core/dataGenerator/DataGenerator.js +94 -0
- package/build/core/dataGenerator/DataGeneratorHelper.js +49 -0
- package/{src → build}/core/jest/preprocessor/jsPreprocessor.js +4 -6
- package/{src → build}/core/jest/runner/jest-runner.js +17 -15
- package/build/core/jest/setup/index.js +3 -0
- 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 +55 -0
- 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 +7 -0
- package/build/core/playwright/env-initializer.js +43 -0
- 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 +24 -0
- package/build/core/playwright/readConfigFile.js +147 -0
- package/build/core/playwright/report-generator.js +42 -0
- 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/config-creator.js +117 -0
- 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 +116 -0
- package/build/core/playwright/types.js +44 -0
- package/build/core/playwright/validateFeature.js +28 -0
- package/build/decorators.d.ts +1 -0
- package/build/decorators.js +16 -0
- package/build/index.d.ts +78 -0
- package/build/index.js +105 -0
- package/build/lib/cli.js +78 -0
- package/build/lib/post-install.js +25 -0
- package/build/lint/index.js +4 -0
- package/build/parser/parser.js +205 -0
- package/build/parser/sample.feature +34 -0
- package/build/parser/sample.spec.js +37 -0
- package/build/parser/verifier.js +130 -0
- 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 +15 -0
- 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 +37 -0
- 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 +46 -0
- package/build/setup-folder-structure/setupProject.js +122 -0
- 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 +72 -0
- package/build/utils/commonUtils.js +17 -0
- package/build/utils/fileUtils.js +109 -0
- package/build/utils/getFilePath.js +11 -0
- package/build/utils/logger.js +28 -0
- package/build/utils/rootPath.js +53 -0
- package/build/utils/stepDefinitionsFormatter.js +11 -0
- package/changelog.md +153 -1
- package/jest.config.js +29 -11
- package/npm-shrinkwrap.json +10902 -4825
- package/package.json +47 -17
- package/playwright.config.js +6 -56
- package/test-results/.last-run.json +4 -0
- package/unit_reports/unit-report.html +260 -0
- package/src/core/jest/setup/index.js +0 -165
- package/src/core/playwright/codegen.js +0 -60
- package/src/core/playwright/custom-commands.js +0 -3
- package/src/core/playwright/env-initializer.js +0 -24
- package/src/core/playwright/index.js +0 -82
- package/src/core/playwright/readConfigFile.js +0 -30
- package/src/core/playwright/report-generator.js +0 -43
- package/src/core/playwright/setup/config-creator.js +0 -79
- package/src/core/playwright/test-runner.js +0 -64
- package/src/index.js +0 -9
- package/src/lib/cli.js +0 -35
- package/src/utils/cliArgsToObject.js +0 -35
- package/src/utils/getFilePath.js +0 -9
- package/src/utils/logger.js +0 -28
- package/src/utils/rootPath.js +0 -51
package/package.json
CHANGED
|
@@ -1,31 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4-n20-experimental",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./
|
|
5
|
+
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "node bin/postinstall.js",
|
|
8
|
-
"test": "
|
|
8
|
+
"test": "jest",
|
|
9
|
+
"clean": "rm -rf build && mkdir build",
|
|
10
|
+
"build-babel": "babel -d ./build ./src --copy-files",
|
|
11
|
+
"build": "npm run clean && npm run build-babel",
|
|
12
|
+
"prepare": "npm run build",
|
|
13
|
+
"lint": "eslint src/* --fix"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./build/index.js",
|
|
17
|
+
"./decorators": "./build/decorators.js",
|
|
18
|
+
"./helpers": "./build/core/playwright/helpers/auth/index.js",
|
|
19
|
+
"./DataGenerator": "./build/core/dataGenerator/DataGenerator.js"
|
|
9
20
|
},
|
|
10
21
|
"keywords": [],
|
|
11
22
|
"author": "",
|
|
12
23
|
"license": "ISC",
|
|
13
24
|
"dependencies": {
|
|
14
|
-
"@babel/
|
|
15
|
-
"@babel/preset-react": "
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@testing-library/
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"jest": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"@babel/code-frame": "7.27.1",
|
|
26
|
+
"@babel/preset-react": "7.27.1",
|
|
27
|
+
"@cucumber/cucumber": "12.2.0",
|
|
28
|
+
"@playwright/test": "1.55.0",
|
|
29
|
+
"@reportportal/agent-js-playwright": "5.2.2",
|
|
30
|
+
"@testing-library/jest-dom": "6.8.0",
|
|
31
|
+
"@testing-library/react": "11.2.7",
|
|
32
|
+
"@testing-library/react-hooks": "7.0.2",
|
|
33
|
+
"babel-jest": "30.1.2",
|
|
34
|
+
"babel-plugin-transform-dynamic-import": "2.1.0",
|
|
35
|
+
"fast-glob": "3.3.3",
|
|
36
|
+
"jest": "30.1.2",
|
|
37
|
+
"jest-environment-jsdom": "30.1.2",
|
|
38
|
+
"msw": "2.11.2",
|
|
39
|
+
"playwright": "1.55.0",
|
|
40
|
+
"supports-color": "10.2.2",
|
|
41
|
+
"playwright-bdd": "8.4.1"
|
|
27
42
|
},
|
|
28
43
|
"bin": {
|
|
29
44
|
"ZDTestingFramework": "./bin/cli.js"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"eslint": "*",
|
|
48
|
+
"react": "*",
|
|
49
|
+
"react-dom": "*"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
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"
|
|
30
60
|
}
|
|
31
|
-
}
|
|
61
|
+
}
|
package/playwright.config.js
CHANGED
|
@@ -3,54 +3,30 @@ 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
|
-
module.exports = defineConfig({
|
|
6
|
+
export default defineConfig({
|
|
16
7
|
testDir: path.join(path.resolve(process.cwd()), 'uat'),
|
|
17
|
-
outputDir: path.join(process.cwd(), 'test-results'),
|
|
18
|
-
/* Run tests in files in parallel */
|
|
8
|
+
outputDir: path.join(process.cwd(), 'uat', 'test-results'),
|
|
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
|
-
|
|
25
|
-
workers: process.env.CI ? 1 : 1,
|
|
26
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
27
|
-
reporter: [['html', { outputFolder: path.join(process.cwd(), 'playwright-report'), open: "always" }]],
|
|
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
|
{
|
|
50
26
|
name: 'chromium',
|
|
51
27
|
use: {
|
|
52
28
|
...devices['Desktop Chrome'],
|
|
53
|
-
storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
|
|
29
|
+
storageState: path.resolve(process.cwd(), 'uat', 'playwright/.auth/user.json')
|
|
54
30
|
},
|
|
55
31
|
dependencies: ['setup'],
|
|
56
32
|
},
|
|
@@ -63,7 +39,7 @@ module.exports = defineConfig({
|
|
|
63
39
|
},
|
|
64
40
|
use: {
|
|
65
41
|
...devices['Desktop Firefox'],
|
|
66
|
-
storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
|
|
42
|
+
storageState: path.resolve(process.cwd(), 'uat', 'playwright/.auth/user.json')
|
|
67
43
|
},
|
|
68
44
|
dependencies: ['setup'],
|
|
69
45
|
},
|
|
@@ -76,37 +52,11 @@ module.exports = defineConfig({
|
|
|
76
52
|
},
|
|
77
53
|
use: {
|
|
78
54
|
...devices['Desktop Safari'],
|
|
79
|
-
storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
|
|
55
|
+
storageState: path.resolve(process.cwd(), 'uat', 'playwright/.auth/user.json')
|
|
80
56
|
},
|
|
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,260 @@
|
|
|
1
|
+
<html><head><meta charset="utf-8"/><title>Unit Report</title><style type="text/css">html,
|
|
2
|
+
body {
|
|
3
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
4
|
+
font-size: 1rem;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
color: #333;
|
|
8
|
+
}
|
|
9
|
+
body {
|
|
10
|
+
padding: 2rem 1rem;
|
|
11
|
+
font-size: 0.85rem;
|
|
12
|
+
}
|
|
13
|
+
.jesthtml-content {
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
max-width: 70rem;
|
|
16
|
+
}
|
|
17
|
+
header {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
#title {
|
|
22
|
+
margin: 0;
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
}
|
|
25
|
+
#logo {
|
|
26
|
+
height: 4rem;
|
|
27
|
+
}
|
|
28
|
+
#timestamp {
|
|
29
|
+
color: #777;
|
|
30
|
+
margin-top: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** SUMMARY */
|
|
34
|
+
#summary {
|
|
35
|
+
color: #333;
|
|
36
|
+
margin: 2rem 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
font-family: monospace;
|
|
39
|
+
font-size: 1rem;
|
|
40
|
+
}
|
|
41
|
+
#summary > div {
|
|
42
|
+
margin-right: 2rem;
|
|
43
|
+
background: #eee;
|
|
44
|
+
padding: 1rem;
|
|
45
|
+
min-width: 15rem;
|
|
46
|
+
}
|
|
47
|
+
#summary > div:last-child {
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
}
|
|
50
|
+
@media only screen and (max-width: 720px) {
|
|
51
|
+
#summary {
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
}
|
|
54
|
+
#summary > div {
|
|
55
|
+
margin-right: 0;
|
|
56
|
+
margin-top: 2rem;
|
|
57
|
+
}
|
|
58
|
+
#summary > div:first-child {
|
|
59
|
+
margin-top: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.summary-total {
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
margin-bottom: 0.5rem;
|
|
66
|
+
}
|
|
67
|
+
.summary-passed {
|
|
68
|
+
color: #4f8a10;
|
|
69
|
+
border-left: 0.4rem solid #4f8a10;
|
|
70
|
+
padding-left: 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
.summary-failed,
|
|
73
|
+
.summary-obsolete-snapshots {
|
|
74
|
+
color: #d8000c;
|
|
75
|
+
border-left: 0.4rem solid #d8000c;
|
|
76
|
+
padding-left: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
.summary-pending {
|
|
79
|
+
color: #9f6000;
|
|
80
|
+
border-left: 0.4rem solid #9f6000;
|
|
81
|
+
padding-left: 0.5rem;
|
|
82
|
+
}
|
|
83
|
+
.summary-empty {
|
|
84
|
+
color: #999;
|
|
85
|
+
border-left: 0.4rem solid #999;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.test-result {
|
|
89
|
+
padding: 1rem;
|
|
90
|
+
margin-bottom: 0.25rem;
|
|
91
|
+
}
|
|
92
|
+
.test-result:last-child {
|
|
93
|
+
border: 0;
|
|
94
|
+
}
|
|
95
|
+
.test-result.passed {
|
|
96
|
+
background-color: #dff2bf;
|
|
97
|
+
color: #4f8a10;
|
|
98
|
+
}
|
|
99
|
+
.test-result.failed {
|
|
100
|
+
background-color: #ffbaba;
|
|
101
|
+
color: #d8000c;
|
|
102
|
+
}
|
|
103
|
+
.test-result.pending {
|
|
104
|
+
background-color: #ffdf61;
|
|
105
|
+
color: #9f6000;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.test-info {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
}
|
|
112
|
+
.test-suitename {
|
|
113
|
+
width: 20%;
|
|
114
|
+
text-align: left;
|
|
115
|
+
font-weight: bold;
|
|
116
|
+
word-break: break-word;
|
|
117
|
+
}
|
|
118
|
+
.test-title {
|
|
119
|
+
width: 40%;
|
|
120
|
+
text-align: left;
|
|
121
|
+
font-style: italic;
|
|
122
|
+
}
|
|
123
|
+
.test-status {
|
|
124
|
+
width: 20%;
|
|
125
|
+
text-align: right;
|
|
126
|
+
}
|
|
127
|
+
.test-duration {
|
|
128
|
+
width: 10%;
|
|
129
|
+
text-align: right;
|
|
130
|
+
font-size: 0.75rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.failureMessages {
|
|
134
|
+
padding: 0 1rem;
|
|
135
|
+
margin-top: 1rem;
|
|
136
|
+
border-top: 1px dashed #d8000c;
|
|
137
|
+
}
|
|
138
|
+
.failureMessages.suiteFailure {
|
|
139
|
+
border-top: none;
|
|
140
|
+
}
|
|
141
|
+
.failureMsg {
|
|
142
|
+
white-space: pre-wrap;
|
|
143
|
+
white-space: -moz-pre-wrap;
|
|
144
|
+
white-space: -pre-wrap;
|
|
145
|
+
white-space: -o-pre-wrap;
|
|
146
|
+
word-wrap: break-word;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.suite-container {
|
|
150
|
+
margin-bottom: 2rem;
|
|
151
|
+
}
|
|
152
|
+
.suite-container > input[type="checkbox"] {
|
|
153
|
+
position: absolute;
|
|
154
|
+
left: -100vw;
|
|
155
|
+
}
|
|
156
|
+
.suite-container label {
|
|
157
|
+
display: block;
|
|
158
|
+
}
|
|
159
|
+
.suite-container .suite-tests {
|
|
160
|
+
overflow-y: hidden;
|
|
161
|
+
height: 0;
|
|
162
|
+
}
|
|
163
|
+
.suite-container > input[type="checkbox"]:checked ~ .suite-tests {
|
|
164
|
+
height: auto;
|
|
165
|
+
overflow: visible;
|
|
166
|
+
}
|
|
167
|
+
.suite-info {
|
|
168
|
+
padding: 1rem;
|
|
169
|
+
background-color: #eee;
|
|
170
|
+
color: #777;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
margin-bottom: 0.25rem;
|
|
174
|
+
}
|
|
175
|
+
.suite-info:hover {
|
|
176
|
+
background-color: #ddd;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
}
|
|
179
|
+
.suite-info .suite-path {
|
|
180
|
+
word-break: break-all;
|
|
181
|
+
flex-grow: 1;
|
|
182
|
+
font-family: monospace;
|
|
183
|
+
font-size: 1rem;
|
|
184
|
+
}
|
|
185
|
+
.suite-info .suite-time {
|
|
186
|
+
margin-left: 0.5rem;
|
|
187
|
+
padding: 0.2rem 0.3rem;
|
|
188
|
+
font-size: 0.75rem;
|
|
189
|
+
}
|
|
190
|
+
.suite-info .suite-time.warn {
|
|
191
|
+
background-color: #d8000c;
|
|
192
|
+
color: #fff;
|
|
193
|
+
}
|
|
194
|
+
.suite-info:before {
|
|
195
|
+
content: "\2303";
|
|
196
|
+
display: inline-block;
|
|
197
|
+
margin-right: 0.5rem;
|
|
198
|
+
transform: rotate(0deg);
|
|
199
|
+
}
|
|
200
|
+
.suite-container > input[type="checkbox"]:checked ~ label .suite-info:before {
|
|
201
|
+
transform: rotate(180deg);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* CONSOLE LOGS */
|
|
205
|
+
.suite-consolelog {
|
|
206
|
+
margin-bottom: 0.25rem;
|
|
207
|
+
padding: 1rem;
|
|
208
|
+
background-color: #efefef;
|
|
209
|
+
}
|
|
210
|
+
.suite-consolelog-header {
|
|
211
|
+
font-weight: bold;
|
|
212
|
+
}
|
|
213
|
+
.suite-consolelog-item {
|
|
214
|
+
padding: 0.5rem;
|
|
215
|
+
}
|
|
216
|
+
.suite-consolelog-item pre {
|
|
217
|
+
margin: 0.5rem 0;
|
|
218
|
+
white-space: pre-wrap;
|
|
219
|
+
white-space: -moz-pre-wrap;
|
|
220
|
+
white-space: -pre-wrap;
|
|
221
|
+
white-space: -o-pre-wrap;
|
|
222
|
+
word-wrap: break-word;
|
|
223
|
+
}
|
|
224
|
+
.suite-consolelog-item-origin {
|
|
225
|
+
color: #777;
|
|
226
|
+
font-weight: bold;
|
|
227
|
+
}
|
|
228
|
+
.suite-consolelog-item-message {
|
|
229
|
+
color: #000;
|
|
230
|
+
font-size: 1rem;
|
|
231
|
+
padding: 0 0.5rem;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* OBSOLETE SNAPSHOTS */
|
|
235
|
+
.suite-obsolete-snapshots {
|
|
236
|
+
margin-bottom: 0.25rem;
|
|
237
|
+
padding: 1rem;
|
|
238
|
+
background-color: #ffbaba;
|
|
239
|
+
color: #d8000c;
|
|
240
|
+
}
|
|
241
|
+
.suite-obsolete-snapshots-header {
|
|
242
|
+
font-weight: bold;
|
|
243
|
+
}
|
|
244
|
+
.suite-obsolete-snapshots-item {
|
|
245
|
+
padding: 0.5rem;
|
|
246
|
+
}
|
|
247
|
+
.suite-obsolete-snapshots-item pre {
|
|
248
|
+
margin: 0.5rem 0;
|
|
249
|
+
white-space: pre-wrap;
|
|
250
|
+
white-space: -moz-pre-wrap;
|
|
251
|
+
white-space: -pre-wrap;
|
|
252
|
+
white-space: -o-pre-wrap;
|
|
253
|
+
word-wrap: break-word;
|
|
254
|
+
}
|
|
255
|
+
.suite-obsolete-snapshots-item-message {
|
|
256
|
+
color: #000;
|
|
257
|
+
font-size: 1rem;
|
|
258
|
+
padding: 0 0.5rem;
|
|
259
|
+
}
|
|
260
|
+
</style></head><body><div class="jesthtml-content"><header><h1 id="title">Unit Report</h1></header><div id="metadata-container"><div id="timestamp">Started: 2025-09-16 17:51:54</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed ">1 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 (3)</div><div class="summary-passed ">3 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><input id="collapsible-0" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-0"><div 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">0.63s</div></div></label><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.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 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></div></div></body></html>
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
//$Id$//
|
|
2
|
-
import TestUtils from 'react-dom/test-utils';
|
|
3
|
-
import { expect } from '@jest/globals'
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
7
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
8
|
-
// let mockDomain = 'htt' + 'p://zoho.com';
|
|
9
|
-
// const { document } = new JSDOM('').window;
|
|
10
|
-
// global.document = document;
|
|
11
|
-
// global.window = document.defaultView;
|
|
12
|
-
// global.navigator = global.window.navigator;
|
|
13
|
-
// global.localStorage = global.sessionStorage = {
|
|
14
|
-
// getItem(key) {
|
|
15
|
-
// return this[key];
|
|
16
|
-
// },
|
|
17
|
-
// setItem(key, value) {
|
|
18
|
-
// if (value.length > 100) {
|
|
19
|
-
// throw new Error('Data size is too exceeded');
|
|
20
|
-
// }
|
|
21
|
-
// this[key] = value;
|
|
22
|
-
// },
|
|
23
|
-
// removeItem(key) {
|
|
24
|
-
// delete this[key];
|
|
25
|
-
// },
|
|
26
|
-
// clear() {
|
|
27
|
-
// let keys = ['getItem', 'setItem', 'removeItem', 'clear'];
|
|
28
|
-
// for (let key in this) {
|
|
29
|
-
// if (keys.indexOf(key) === -1) {
|
|
30
|
-
// delete this[key];
|
|
31
|
-
// }
|
|
32
|
-
// }
|
|
33
|
-
// }
|
|
34
|
-
// };
|
|
35
|
-
// global.ZE_Init = {};
|
|
36
|
-
// global.String.prototype.contains = function (text) {
|
|
37
|
-
// return this.indexOf(text) != -1;
|
|
38
|
-
// };
|
|
39
|
-
// global.TestUtils = TestUtils;
|
|
40
|
-
// // let xmlReq = XMLHttpRequest;
|
|
41
|
-
// // window.XMLHttpRequest = function () {
|
|
42
|
-
// // let xmlReqCopy = new xmlReq();
|
|
43
|
-
// // let originalOpen = xmlReqCopy.open;
|
|
44
|
-
// // xmlReqCopy.open = function () {
|
|
45
|
-
// // if (arguments[1].indexOf('http') != 0) {
|
|
46
|
-
// // arguments[1] = mockDomain + arguments[1];
|
|
47
|
-
// // }
|
|
48
|
-
// // return originalOpen.apply(this, arguments);
|
|
49
|
-
// // };
|
|
50
|
-
// // return xmlReqCopy;
|
|
51
|
-
// // };
|
|
52
|
-
|
|
53
|
-
// TestUtils.scryRenderedComponentsWithTestid = function (dom, name) {
|
|
54
|
-
// let componentList = TestUtils.findAllInRenderedTree(dom, (i, j) => {
|
|
55
|
-
// if (TestUtils.isDOMComponent(i)) {
|
|
56
|
-
// let val = i.getAttribute('data-id');
|
|
57
|
-
// if (typeof val !== 'undefined' && val == name) {
|
|
58
|
-
// return true;
|
|
59
|
-
// }
|
|
60
|
-
// return false;
|
|
61
|
-
// }
|
|
62
|
-
// });
|
|
63
|
-
// return componentList;
|
|
64
|
-
// };
|
|
65
|
-
|
|
66
|
-
// TestUtils.findRenderedComponentsWithTestid = function (dom, name) {
|
|
67
|
-
// let list = TestUtils.scryRenderedComponentsWithTestid(dom, name);
|
|
68
|
-
// if (list.length !== 1) {
|
|
69
|
-
// throw new Error(
|
|
70
|
-
// `Did not find exactly one match (found: ${list.length}) ` +
|
|
71
|
-
// `for data-id:${name}`
|
|
72
|
-
// );
|
|
73
|
-
// }
|
|
74
|
-
// return list[0];
|
|
75
|
-
// };
|
|
76
|
-
|
|
77
|
-
// global.render = function (Component, props) {
|
|
78
|
-
// const renderedDOM = TestUtils.renderIntoDocument(<Component {...props} />);
|
|
79
|
-
// return {
|
|
80
|
-
// props,
|
|
81
|
-
// renderedDOM
|
|
82
|
-
// };
|
|
83
|
-
// };
|
|
84
|
-
|
|
85
|
-
// global.setup = function (Component, props, state) {
|
|
86
|
-
// let router = {
|
|
87
|
-
// router: {
|
|
88
|
-
// push() { },
|
|
89
|
-
// createHref(ob) {
|
|
90
|
-
// return ob.pathname;
|
|
91
|
-
// },
|
|
92
|
-
// isActive() {
|
|
93
|
-
// return true;
|
|
94
|
-
// },
|
|
95
|
-
// replace() { },
|
|
96
|
-
// go() { },
|
|
97
|
-
// goBack() { },
|
|
98
|
-
// goForward() { },
|
|
99
|
-
// setRouteLeaveHook() { },
|
|
100
|
-
// getState() { }
|
|
101
|
-
// },
|
|
102
|
-
// store: {
|
|
103
|
-
// getState() {
|
|
104
|
-
// return state;
|
|
105
|
-
// }
|
|
106
|
-
// }
|
|
107
|
-
// };
|
|
108
|
-
// // var store = {
|
|
109
|
-
// // store:{
|
|
110
|
-
// // getState:function(){return state;}
|
|
111
|
-
// // }
|
|
112
|
-
// // }
|
|
113
|
-
// var Component = higherComponent(Component, router);
|
|
114
|
-
// const renderedDOM = TestUtils.renderIntoDocument(
|
|
115
|
-
// <Component {...props} />,
|
|
116
|
-
// router
|
|
117
|
-
// );
|
|
118
|
-
// return {
|
|
119
|
-
// props,
|
|
120
|
-
// renderedDOM
|
|
121
|
-
// };
|
|
122
|
-
// };
|
|
123
|
-
|
|
124
|
-
// function higherComponent(ActualComponent, context) {
|
|
125
|
-
// if (context) {
|
|
126
|
-
// class HigherComponent extends React.Component {
|
|
127
|
-
// constructor() {
|
|
128
|
-
// super();
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
// getChildContext() {
|
|
132
|
-
// return context;
|
|
133
|
-
// }
|
|
134
|
-
|
|
135
|
-
// render() {
|
|
136
|
-
// return <ActualComponent {...this.props} />;
|
|
137
|
-
// }
|
|
138
|
-
// }
|
|
139
|
-
|
|
140
|
-
// HigherComponent.childContextTypes = {
|
|
141
|
-
// router: PropTypes.any,
|
|
142
|
-
// store: PropTypes.any
|
|
143
|
-
// };
|
|
144
|
-
|
|
145
|
-
// return HigherComponent;
|
|
146
|
-
// }
|
|
147
|
-
// return ActualComponent;
|
|
148
|
-
// }
|
|
149
|
-
// global.window.matchMedia =
|
|
150
|
-
// window.matchMedia ||
|
|
151
|
-
// function () {
|
|
152
|
-
// return {
|
|
153
|
-
// matches: false,
|
|
154
|
-
// addListener() { },
|
|
155
|
-
// removeListener() { }
|
|
156
|
-
// };
|
|
157
|
-
// };
|
|
158
|
-
// // global.renderHTML = function(comp) {
|
|
159
|
-
// // return ReactDOM.findDOMNode(comp);
|
|
160
|
-
// // };
|
|
161
|
-
|
|
162
|
-
// global.TestUtils = TestUtils;
|
|
163
|
-
// global.getI18NValue = function (inp) {
|
|
164
|
-
// return inp;
|
|
165
|
-
// };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const { spawn } = require('child_process')
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { chromium } = require('@playwright/test');
|
|
4
|
-
const { Logger } = require('../../utils/logger');
|
|
5
|
-
const { getExecutableBinaryPath } = require('../../utils/rootPath');
|
|
6
|
-
|
|
7
|
-
const userArgs = process.argv.slice(3);
|
|
8
|
-
|
|
9
|
-
const playwrightPath = path.resolve(getExecutableBinaryPath('playwright'));
|
|
10
|
-
const command = playwrightPath;
|
|
11
|
-
|
|
12
|
-
const args = ['codegen'].concat(userArgs);
|
|
13
|
-
|
|
14
|
-
function generateCodegen() {
|
|
15
|
-
const childProcess = spawn(command, args, { stdio: 'inherit' });
|
|
16
|
-
|
|
17
|
-
childProcess.on('error', (error) => {
|
|
18
|
-
Logger.log(Logger.FAILURE_TYPE, error);
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
childProcess.on('exit', (code, signal) => {
|
|
22
|
-
Logger.log(Logger.FAILURE_TYPE, `Child Process Exited with Code ${code} and Signal ${signal}`);
|
|
23
|
-
|
|
24
|
-
process.exit();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
process.on('exit', () => {
|
|
28
|
-
Logger.log(Logger.INFO_TYPE, 'Terminating Playwright Process...');
|
|
29
|
-
//childProcess.kill();
|
|
30
|
-
return;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
process.on('SIGINT', () => {
|
|
34
|
-
Logger.log(Logger.INFO_TYPE, 'Cleaning up...');
|
|
35
|
-
//childProcess.kill();
|
|
36
|
-
process.exit();
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Another way to record. Below way will load the url in autheticated state if present
|
|
43
|
-
// function generateCodegen() {
|
|
44
|
-
// (async () => {
|
|
45
|
-
// // Make sure to run headed.
|
|
46
|
-
// const browser = await chromium.launch({ headless: false });
|
|
47
|
-
|
|
48
|
-
// // Setup context however you like.
|
|
49
|
-
// const context = await browser.newContext({ storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json') });
|
|
50
|
-
// await context.route('**/*', route => route.continue());
|
|
51
|
-
|
|
52
|
-
// // Pause the page, and start recording manually.
|
|
53
|
-
// const page = await context.newPage();
|
|
54
|
-
// console.log(userArgs.join(''));
|
|
55
|
-
// await page.goto(`https://${userArgs.join('')}`);
|
|
56
|
-
// await page.pause();
|
|
57
|
-
// })();
|
|
58
|
-
// }
|
|
59
|
-
|
|
60
|
-
module.exports = generateCodegen;
|