@zohodesk/testinglibrary 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "@zohodesk/testinglibrary",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "./src/index.js",
6
- "scripts": {
7
- "postinstall": "node bin/postinstall.js",
8
- "test": "echo \"Error: no test specified\" && exit 1"
9
- },
10
- "keywords": [],
11
- "author": "",
12
- "license": "ISC",
13
- "dependencies": {
14
- "@babel/preset-env": "^7.22.9",
15
- "@babel/preset-react": "^7.22.5",
16
- "@playwright/test": "^1.37.1",
17
- "@testing-library/jest-dom": "^5.11.9",
18
- "@testing-library/react": "^11.2.7",
19
- "@testing-library/react-hooks": "^7.0.2",
20
- "babel-jest": "^29.6.2",
21
- "babel-plugin-transform-dynamic-import": "^2.1.0",
22
- "jest": "^29.6.2",
23
- "jest-environment-jsdom": "^29.6.2",
24
- "msw": "^1.2.3",
25
- "react": "16.13.1",
26
- "react-dom": "16.13.1"
27
- },
28
- "bin": {
29
- "ZDTestingFramework": "./bin/cli.js"
30
- }
31
- }
1
+ {
2
+ "name": "@zohodesk/testinglibrary",
3
+ "version": "0.0.2",
4
+ "description": "",
5
+ "main": "./src/index.js",
6
+ "scripts": {
7
+ "postinstall": "node bin/postinstall.js",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "@babel/preset-env": "^7.22.9",
15
+ "@babel/preset-react": "^7.22.5",
16
+ "@playwright/test": "^1.37.1",
17
+ "@testing-library/jest-dom": "^5.11.9",
18
+ "@testing-library/react": "^11.2.7",
19
+ "@testing-library/react-hooks": "^7.0.2",
20
+ "babel-jest": "^29.6.2",
21
+ "babel-plugin-transform-dynamic-import": "^2.1.0",
22
+ "jest": "^29.6.2",
23
+ "jest-environment-jsdom": "^29.6.2",
24
+ "msw": "^1.2.3",
25
+ "react": "16.13.1",
26
+ "react-dom": "16.13.1"
27
+ },
28
+ "bin": {
29
+ "ZDTestingFramework": "./bin/cli.js"
30
+ }
31
+ }
@@ -1,112 +1,112 @@
1
- // @ts-check
2
- const { defineConfig, devices } = require('@playwright/test');
3
- const path = require('path');
4
- const numCPUs = require('os').cpus().length;
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({
16
- testDir: path.join(path.resolve(process.cwd()), 'uat'),
17
- outputDir: path.join(process.cwd(), 'test-results'),
18
- /* Run tests in files in parallel */
19
- 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
- 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
- reporter: [['html', { outputFolder: path.join(process.cwd(), 'playwright-report'), open: "always" }]],
28
- timeout: 60 * 1000,
29
- expect: {
30
- timeout: 5 * 1000,
31
- },
32
-
33
- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
34
- 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
- trace: 'on',
40
- video: {
41
- mode: 'on',
42
- size: { width: 640, height: 480 }
43
- }
44
- },
45
-
46
- /* Configure projects for major browsers */
47
- projects: [
48
- { name: 'setup', testMatch: /.*\.setup\.js/ },
49
- {
50
- name: 'chromium',
51
- use: {
52
- ...devices['Desktop Chrome'],
53
- storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
54
- },
55
- dependencies: ['setup'],
56
- },
57
-
58
- {
59
- name: 'firefox',
60
- timeout: 4 * 60 * 1000,
61
- expect: {
62
- timeout: 80 * 1000,
63
- },
64
- use: {
65
- ...devices['Desktop Firefox'],
66
- storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
67
- },
68
- dependencies: ['setup'],
69
- },
70
-
71
- {
72
- name: 'webkit',
73
- timeout: 2 * 60 * 1000,
74
- expect: {
75
- timeout: 80 * 1000,
76
- },
77
- use: {
78
- ...devices['Desktop Safari'],
79
- storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
80
- },
81
- dependencies: ['setup'],
82
- },
83
-
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
- ],
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
- });
112
-
1
+ // @ts-check
2
+ const { defineConfig, devices } = require('@playwright/test');
3
+ const path = require('path');
4
+ const numCPUs = require('os').cpus().length;
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({
16
+ testDir: path.join(path.resolve(process.cwd()), 'uat'),
17
+ outputDir: path.join(process.cwd(), 'test-results'),
18
+ /* Run tests in files in parallel */
19
+ 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
+ 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
+ reporter: [['html', { outputFolder: path.join(process.cwd(), 'playwright-report'), open: "always" }]],
28
+ timeout: 60 * 1000,
29
+ expect: {
30
+ timeout: 5 * 1000,
31
+ },
32
+
33
+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
34
+ 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
+ trace: 'on',
40
+ video: {
41
+ mode: 'on',
42
+ size: { width: 640, height: 480 }
43
+ }
44
+ },
45
+
46
+ /* Configure projects for major browsers */
47
+ projects: [
48
+ { name: 'setup', testMatch: /.*\.setup\.js/ },
49
+ {
50
+ name: 'chromium',
51
+ use: {
52
+ ...devices['Desktop Chrome'],
53
+ storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
54
+ },
55
+ dependencies: ['setup'],
56
+ },
57
+
58
+ {
59
+ name: 'firefox',
60
+ timeout: 4 * 60 * 1000,
61
+ expect: {
62
+ timeout: 80 * 1000,
63
+ },
64
+ use: {
65
+ ...devices['Desktop Firefox'],
66
+ storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
67
+ },
68
+ dependencies: ['setup'],
69
+ },
70
+
71
+ {
72
+ name: 'webkit',
73
+ timeout: 2 * 60 * 1000,
74
+ expect: {
75
+ timeout: 80 * 1000,
76
+ },
77
+ use: {
78
+ ...devices['Desktop Safari'],
79
+ storageState: path.resolve(process.cwd(), 'playwright/.auth/user.json')
80
+ },
81
+ dependencies: ['setup'],
82
+ },
83
+
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
+ ],
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
+ });
112
+
@@ -1,9 +1,9 @@
1
- const babelJest = require('babel-jest');
2
-
3
- module.exports = babelJest.createTransformer({
4
- presets: [
5
- require.resolve('@babel/preset-env'),
6
- require.resolve('@babel/preset-react')
7
- ],
8
- plugins: [require.resolve('babel-plugin-transform-dynamic-import')]
9
- });
1
+ const babelJest = require('babel-jest');
2
+
3
+ module.exports = babelJest.createTransformer({
4
+ presets: [
5
+ require.resolve('@babel/preset-env'),
6
+ require.resolve('@babel/preset-react')
7
+ ],
8
+ plugins: [require.resolve('babel-plugin-transform-dynamic-import')]
9
+ });
@@ -1,45 +1,44 @@
1
- // import { run } from 'jest';
2
-
3
- // function createJestRunner() {
4
- // let config = require('../configs/jest.config');
5
-
6
- // let argv = process.argv.slice(2);
7
-
8
- // argv.push('--config', JSON.stringify(config(folder)), '--no-cache');
9
- // run(argv);
10
- // }
11
-
12
-
13
- // export default createJestRunner;
14
-
15
- const { spawn } = require('child_process');
16
- const path = require('path');
17
- const getFilePathWithExtension = require('../../../utils/getFilePath');
18
- const { getBinPath } = require('../../../utils/rootPath');
19
-
20
- const jestPath = path.resolve(getBinPath(), getFilePathWithExtension('jest'));
21
-
22
- // Command and arguments for npx playwright test
23
- const command = jestPath;
24
- const args = ['--config', require.resolve('../../../../jest.config.js')];
25
-
26
-
27
- function createJestRunner() {
28
- // Spawn the child process
29
-
30
- const childProcess = spawn(command, args, { stdio: 'inherit' });
31
-
32
-
33
- // Handling the 'exit' event of the child process
34
- // childProcess.on('exit', (code, signal) => {
35
- // console.log(`Child process exited with code ${code} and signal ${signal}`);
36
- // });
37
-
38
- // // Handling any error that occurs while spawning the child process
39
- // childProcess.on('error', (err) => {
40
- // console.error(`Error while spawning child process: ${err.message}`);
41
- // });
42
- }
43
-
44
-
45
- module.exports = createJestRunner;
1
+ // import { run } from 'jest';
2
+
3
+ // function createJestRunner() {
4
+ // let config = require('../configs/jest.config');
5
+
6
+ // let argv = process.argv.slice(2);
7
+
8
+ // argv.push('--config', JSON.stringify(config(folder)), '--no-cache');
9
+ // run(argv);
10
+ // }
11
+
12
+
13
+ // export default createJestRunner;
14
+
15
+ const { spawn } = require('child_process');
16
+ const path = require('path');
17
+ const { getExecutableBinaryPath } = require('../../../utils/rootPath');
18
+
19
+ const jestPath = path.resolve(getExecutableBinaryPath('jest'));
20
+
21
+ // Command and arguments for npx playwright test
22
+ const command = jestPath;
23
+ const args = ['--config', require.resolve('../../../../jest.config.js')];
24
+
25
+
26
+ function createJestRunner() {
27
+ // Spawn the child process
28
+
29
+ const childProcess = spawn(command, args, { stdio: 'inherit' });
30
+
31
+
32
+ // Handling the 'exit' event of the child process
33
+ // childProcess.on('exit', (code, signal) => {
34
+ // console.log(`Child process exited with code ${code} and signal ${signal}`);
35
+ // });
36
+
37
+ // // Handling any error that occurs while spawning the child process
38
+ // childProcess.on('error', (err) => {
39
+ // console.error(`Error while spawning child process: ${err.message}`);
40
+ // });
41
+ }
42
+
43
+
44
+ module.exports = createJestRunner;