@zohodesk/testinglibrary 0.0.72-n20-experimental → 0.0.73-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.
@@ -12,5 +12,9 @@ class ReporterConstants {
12
12
  static DEFAULT_REPORTER_PATH = `${_configConstants.default.TEST_SLICE_FOLDER}/${stage}/test-results/playwright-test-results.json`;
13
13
  static LAST_RUN_REPORTER_PATH = `${_configConstants.default.TEST_SLICE_FOLDER}/${stage}/test-results/.last-run.json`;
14
14
  static DEFAULT_UNIT_TEST_REPORTER_PATH = `${_configConstants.default.TEST_SLICE_FOLDER}/unit-test/unit_reports/report.html`;
15
+ static PROJECT_FAILURE_REASON_MAP = {
16
+ 'setup': 'Login case failure',
17
+ 'smokeTest': 'Smoke test failure'
18
+ };
15
19
  }
16
20
  exports.default = ReporterConstants;
@@ -53,6 +53,7 @@ function getDefaultConfig() {
53
53
  testIdAttribute: 'data-testid',
54
54
  additionalPages: {},
55
55
  featureFilesFolder: 'feature-files',
56
+ stepDefinitionsFolder: 'steps',
56
57
  testSetup: {},
57
58
  editionOrder: ['Free', 'Express', 'Standard', 'Professional', 'Enterprise']
58
59
  };
@@ -107,6 +108,7 @@ function combineDefaultConfigWithUserConfig(userConfiguration) {
107
108
  * @property {number} testTimeout: time in milliseconds which the test should fail. Can be overridden per-scenario by tagging the scenario with `@timeout_<seconds>` (e.g. `@timeout_180`). `@timeout_0` disables the timeout. Browser scaling (Firefox 2x, Safari 4x) is preserved.
108
109
  * @property {Object} additionalPages: custom pages configuration
109
110
  * @property {string} featureFilesFolder: folder name under which feature-files will be placed. Default is feature-files
111
+ * @property {string} stepDefinitionsFolder: folder name under which step implementations will be placed. Default is steps
110
112
  * @property {viewportConfig} viewport: viewport configuration for the browser. Default is { width: 1280, height: 720 }
111
113
  * @property {string} testIdAttribute: Change the default data-testid attribute. configure what attribute to search while calling getByTestId
112
114
  * @property {Array} editionOrder: Order in the form of larger editions in the back. Edition with the most privelages should be last
@@ -12,6 +12,7 @@ var _readConfigFile = require("../readConfigFile");
12
12
  var _logger = require("../../../utils/logger");
13
13
  var _configFileNameProvider = require("../helpers/configFileNameProvider");
14
14
  var _mergeAbortedTests = _interopRequireDefault(require("../reporter/helpers/mergeAbortedTests"));
15
+ var _reporterConstants = _interopRequireDefault(require("../constants/reporterConstants"));
15
16
  // Traverse the suite tree upward until we reach the project-level suite
16
17
  function getProjectName(test) {
17
18
  let suite = test.parent;
@@ -38,8 +39,7 @@ class JSONSummaryReporter {
38
39
  this.status = 'unknown';
39
40
  this.startedAt = 0;
40
41
  this._open = (0, _readConfigFile.generateConfigFromFile)().openReportOn;
41
- this._setupFailed = false;
42
- this._smokeTestFailed = false;
42
+ this.failedProject = null;
43
43
  }
44
44
  onBegin() {
45
45
  this.startedAt = Date.now();
@@ -90,12 +90,10 @@ class JSONSummaryReporter {
90
90
  }
91
91
  this[status].push(fileName);
92
92
  const isFailure = result.status !== 'passed' && result.status !== 'skipped';
93
- if (isFailure) {
93
+ if (isFailure && !this.failedProject) {
94
94
  const projectName = getProjectName(test);
95
- if (projectName === 'setup') {
96
- this._setupFailed = true;
97
- } else if (projectName === 'smokeTest') {
98
- this._smokeTestFailed = true;
95
+ if (projectName) {
96
+ this.failedProject = projectName;
99
97
  }
100
98
  }
101
99
  }
@@ -138,10 +136,8 @@ class JSONSummaryReporter {
138
136
  // Reflect setup failures in the final report status
139
137
  this.status = "failed";
140
138
  }
141
- if (this._setupFailed) {
142
- this.failureReason = 'Login case failure';
143
- } else if (this._smokeTestFailed) {
144
- this.failureReason = 'Smoke test failure';
139
+ if (this.failedProject && _reporterConstants.default.PROJECT_FAILURE_REASON_MAP[this.failedProject]) {
140
+ this.failureReason = _reporterConstants.default.PROJECT_FAILURE_REASON_MAP[this.failedProject];
145
141
  }
146
142
 
147
143
  // fs.writeFileSync('./summary.json', JSON.stringify(this, null, ' '));
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.0.72-n20-experimental",
3
+ "version": "0.0.73-n20-experimental",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zohodesk/testinglibrary",
9
- "version": "0.0.72-n20-experimental",
9
+ "version": "0.0.73-n20-experimental",
10
10
  "hasInstallScript": true,
11
11
  "license": "ISC",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.0.72-n20-experimental",
3
+ "version": "0.0.73-n20-experimental",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node bin/postinstall.js",