@zohodesk/testinglibrary 0.4.71-n18-experimental → 0.4.72-n18-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/.gitlab-ci.yml CHANGED
@@ -146,4 +146,18 @@ uatconfigmodule:
146
146
  paths:
147
147
  - examples/uat/playwright-report
148
148
 
149
+ uat-smoketest:
150
+ stage: uat
151
+ script:
152
+ - cd examples
153
+ - npm install $(npm pack ../../testing-framework | tail -1)
154
+ - output=$(npm run uat-smoketest)
155
+ - echo "$output"
156
+ - node ../ValidateUATReport.js examples
157
+
158
+ artifacts:
159
+ when: always
160
+ paths:
161
+ - examples/uat/playwright-report
162
+
149
163
 
@@ -9,6 +9,8 @@ var _auth = require("../helpers/auth");
9
9
  var _readConfigFile = require("../readConfigFile");
10
10
  /* eslint-disable global-require */
11
11
 
12
+ //import { additionProfiles } from '../helpers/additionalProfiles';
13
+
12
14
  function getTagInputFromSelectedTags(tags, inputString) {
13
15
  const selectedTag = [...tags].reverse().find(tag => tag.startsWith(inputString));
14
16
  let tagInput = null;
@@ -18,7 +20,7 @@ function getTagInputFromSelectedTags(tags, inputString) {
18
20
  return tagInput;
19
21
  }
20
22
  function getCustomAccountDetails(tags) {
21
- const tagsTobeFiltered = ['@profile', '@edition', '@beta', '@portal'];
23
+ const tagsTobeFiltered = ['@profile', '@edition', '@beta', '@portal', '@additional_profile'];
22
24
  const filteredTags = tags.filter(tag => tagsTobeFiltered.some(prefix => tag.startsWith(prefix)));
23
25
  if (filteredTags && filteredTags.length > 0) {
24
26
  const portalInfo = getTagInputFromSelectedTags(filteredTags, '@portal');
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.additionProfiles = additionProfiles;
7
+ var _getUsers = require("./auth/getUsers");
8
+ function additionProfiles(tags, editionInfo, betaFeature, portalInfo) {
9
+ const additionalProfileTags = tags.filter(tag => tag.startsWith('@additional_profile_'));
10
+ let additionalProfileActors = [];
11
+ if (additionalProfileTags.length > 0 && editionInfo) {
12
+ additionalProfileActors = additionalProfileTags.map(tag => {
13
+ const additionalProfile = tag.replace('@additional_profile_', '');
14
+ return (0, _getUsers.getUserForSelectedEditionAndProfile)(editionInfo, additionalProfile, betaFeature, portalInfo);
15
+ });
16
+ }
17
+ return additionalProfileActors;
18
+ }
@@ -10,7 +10,6 @@ var _fileMutex = _interopRequireDefault(require("../fileMutex"));
10
10
  var _fileMutexConfig = require("../../constants/fileMutexConfig");
11
11
  var _checkAuthCookies = require("./checkAuthCookies");
12
12
  var _checkAuthDirectory = require("../checkAuthDirectory");
13
- var _fs = require("fs");
14
13
  /* eslint-disable no-console */
15
14
 
16
15
  async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
@@ -12,6 +12,7 @@ var _configUtils = require("./config-utils");
12
12
  const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
13
13
  const {
14
14
  browsers,
15
+ isSmokeTest,
15
16
  trace,
16
17
  video,
17
18
  isAuthMode,
@@ -31,6 +32,7 @@ const {
31
32
  const projects = (0, _configUtils.getProjects)({
32
33
  browsers,
33
34
  isAuthMode,
35
+ isSmokeTest,
34
36
  authFilePath,
35
37
  expectTimeout,
36
38
  testTimeout,
@@ -61,7 +63,21 @@ if (customReporter) {
61
63
  *
62
64
  * @returns {import('@playwright/test').PlaywrightTestConfig}
63
65
  */
66
+
64
67
  function getPlaywrightConfig() {
68
+ const commonConfig = {
69
+ storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
70
+ };
71
+ const dependencies = isAuthMode ? ['setup'] : [];
72
+ const smokeTestProject = isSmokeTest ? {
73
+ name: 'smokeTest',
74
+ testMatch: /.*\.smokeTest\.js/,
75
+ testDir: _path.default.join(process.cwd(), 'uat'),
76
+ use: {
77
+ ...commonConfig
78
+ },
79
+ dependencies: dependencies
80
+ } : {};
65
81
  const playwrightConfig = {
66
82
  testDir,
67
83
  globalTimeout: globalTimeout || 3600000,
@@ -78,11 +94,11 @@ function getPlaywrightConfig() {
78
94
  testMatch: /.*\.setup\.js/,
79
95
  testDir: _path.default.join(process.cwd(), 'uat'),
80
96
  teardown: 'cleanup'
81
- }, {
97
+ }, smokeTestProject, {
82
98
  name: 'cleanup',
83
99
  testMatch: /.*\.teardown\.js/,
84
100
  testDir: _path.default.join(process.cwd(), 'uat')
85
- }, ...projects] : [...projects],
101
+ }, ...projects] : [...projects, smokeTestProject],
86
102
  ...uatConfig
87
103
  };
88
104
  return playwrightConfig;
@@ -19,9 +19,11 @@ var _fileUtils = require("../../../utils/fileUtils");
19
19
  ** Playwright project configuration
20
20
  * @returns {import('@playwright/test').Project}
21
21
  */
22
+
22
23
  function getBrowserConfig({
23
24
  browserName,
24
25
  isAuthMode,
26
+ isSmokeTest,
25
27
  authFilePath,
26
28
  expectTimeout,
27
29
  testTimeout,
@@ -32,7 +34,8 @@ function getBrowserConfig({
32
34
  viewport,
33
35
  storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
34
36
  };
35
- const dependencies = isAuthMode ? ['setup'] : [];
37
+ // Determine dependencies based on the mode and smoke test status
38
+ const dependencies = isSmokeTest ? isAuthMode ? ['setup', 'smokeTest'] : ['smokeTest'] : isAuthMode ? ['setup'] : [];
36
39
  if (browser === 'chrome') {
37
40
  return {
38
41
  name: _browserTypes.BROWSER_PROJECT_MAPPING.CHROME,
@@ -99,6 +102,7 @@ function getBrowserConfig({
99
102
  function getProjects({
100
103
  browsers,
101
104
  isAuthMode,
105
+ isSmokeTest,
102
106
  authFilePath,
103
107
  expectTimeout,
104
108
  testTimeout,
@@ -107,6 +111,7 @@ function getProjects({
107
111
  return browsers.map(browserName => getBrowserConfig({
108
112
  browserName,
109
113
  isAuthMode,
114
+ isSmokeTest,
110
115
  authFilePath,
111
116
  expectTimeout,
112
117
  testTimeout,
@@ -60,7 +60,22 @@ class CustomJsonReporter {
60
60
  const extracted = suite.suites.map(suite => extractMergedSuite(this.report.config.rootDir, suite, this.testResultsById));
61
61
  this.report.suites.push(...extracted);
62
62
  });
63
- _fs.default.writeFileSync(this.outputFile, JSON.stringify(this.report, null, 2));
63
+ const writableStream = _fs.default.createWriteStream(this.outputFile);
64
+ writableStream.write('{\n');
65
+ writableStream.write(` "config": ${JSON.stringify(this.report.config, null, 2)},\n`);
66
+ writableStream.write(' "suites": [\n');
67
+ for (let i = 0; i < this.report.suites.length; i++) {
68
+ const suite = this.report.suites[i];
69
+ let suiteStr = JSON.stringify(suite, null, 2).split('\n').map(line => ' ' + line).join('\n');
70
+ if (i < this.report.suites.length - 1) {
71
+ suiteStr += ',';
72
+ }
73
+ suiteStr += '\n';
74
+ writableStream.write(suiteStr);
75
+ }
76
+ writableStream.write(' ]\n');
77
+ writableStream.write('}\n');
78
+ writableStream.end();
64
79
  console.log(`Custom JSON report written to: ${this.outputFile}`);
65
80
  }
66
81
  }
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.4.71-n18-experimental",
3
+ "version": "0.4.72-n18-experimental",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zohodesk/testinglibrary",
9
- "version": "0.4.71-n18-experimental",
9
+ "version": "0.4.72-n18-experimental",
10
10
  "hasInstallScript": true,
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@babel/code-frame": "7.27.1",
14
14
  "@babel/preset-react": "7.22.5",
15
15
  "@cucumber/cucumber": "11.3.0",
16
- "@playwright/test": "1.53.1",
16
+ "@playwright/test": "1.53.2",
17
17
  "@reportportal/agent-js-playwright": "5.1.11",
18
18
  "@testing-library/jest-dom": "5.11.9",
19
19
  "@testing-library/react": "11.2.7",
@@ -24,7 +24,7 @@
24
24
  "jest": "29.6.2",
25
25
  "jest-environment-jsdom": "29.6.2",
26
26
  "msw": "1.2.3",
27
- "playwright": "1.53.1",
27
+ "playwright": "1.53.2",
28
28
  "playwright-bdd": "8.3.1",
29
29
  "supports-color": "8.1.1"
30
30
  },
@@ -3087,12 +3087,12 @@
3087
3087
  }
3088
3088
  },
3089
3089
  "node_modules/@playwright/test": {
3090
- "version": "1.53.1",
3091
- "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.1.tgz",
3092
- "integrity": "sha512-Z4c23LHV0muZ8hfv4jw6HngPJkbbtZxTkxPNIg7cJcTc9C28N/p2q7g3JZS2SiKBBHJ3uM1dgDye66bB7LEk5w==",
3090
+ "version": "1.53.2",
3091
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.2.tgz",
3092
+ "integrity": "sha512-tEB2U5z74ebBeyfGNZ3Jfg29AnW+5HlWhvHtb/Mqco9pFdZU1ZLNdVb2UtB5CvmiilNr2ZfVH/qMmAROG/XTzw==",
3093
3093
  "license": "Apache-2.0",
3094
3094
  "dependencies": {
3095
- "playwright": "1.53.1"
3095
+ "playwright": "1.53.2"
3096
3096
  },
3097
3097
  "bin": {
3098
3098
  "playwright": "cli.js"
@@ -8655,12 +8655,12 @@
8655
8655
  }
8656
8656
  },
8657
8657
  "node_modules/playwright": {
8658
- "version": "1.53.1",
8659
- "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.1.tgz",
8660
- "integrity": "sha512-LJ13YLr/ocweuwxyGf1XNFWIU4M2zUSo149Qbp+A4cpwDjsxRPj7k6H25LBrEHiEwxvRbD8HdwvQmRMSvquhYw==",
8658
+ "version": "1.53.2",
8659
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.2.tgz",
8660
+ "integrity": "sha512-6K/qQxVFuVQhRQhFsVZ9fGeatxirtrpPgxzBYWyZLEXJzqYwuL4fuNmfOfD5et1tJE4GScKyPNeLhZeRwuTU3A==",
8661
8661
  "license": "Apache-2.0",
8662
8662
  "dependencies": {
8663
- "playwright-core": "1.53.1"
8663
+ "playwright-core": "1.53.2"
8664
8664
  },
8665
8665
  "bin": {
8666
8666
  "playwright": "cli.js"
@@ -8812,9 +8812,9 @@
8812
8812
  }
8813
8813
  },
8814
8814
  "node_modules/playwright-core": {
8815
- "version": "1.53.1",
8816
- "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.1.tgz",
8817
- "integrity": "sha512-Z46Oq7tLAyT0lGoFx4DOuB1IA9D1TPj0QkYxpPVUnGDqHHvDpCftu1J2hM2PiWsNMoZh8+LQaarAWcDfPBc6zg==",
8815
+ "version": "1.53.2",
8816
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.2.tgz",
8817
+ "integrity": "sha512-ox/OytMy+2w1jcYEYlOo1Hhp8hZkLCximMTUTMBXjGUA1KoFfiSZ+DU+3a739jsPY0yoKH2TFy9S2fsJas8yAw==",
8818
8818
  "license": "Apache-2.0",
8819
8819
  "bin": {
8820
8820
  "playwright-core": "cli.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.4.71-n18-experimental",
3
+ "version": "0.4.72-n18-experimental",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@
24
24
  "@babel/code-frame": "7.27.1",
25
25
  "@babel/preset-react": "7.22.5",
26
26
  "@cucumber/cucumber": "11.3.0",
27
- "@playwright/test": "1.53.1",
27
+ "@playwright/test": "1.53.2",
28
28
  "@reportportal/agent-js-playwright": "5.1.11",
29
29
  "@testing-library/jest-dom": "5.11.9",
30
30
  "@testing-library/react": "11.2.7",
@@ -35,7 +35,7 @@
35
35
  "jest": "29.6.2",
36
36
  "jest-environment-jsdom": "29.6.2",
37
37
  "msw": "1.2.3",
38
- "playwright": "1.53.1",
38
+ "playwright": "1.53.2",
39
39
  "supports-color": "8.1.1",
40
40
  "playwright-bdd": "8.3.1"
41
41
  },