Skip to content

Commit

Permalink
change output color of debug to gray
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Feb 15, 2023
1 parent c851685 commit ddc3e75
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ All notable changes to this project will be documented in this file.
### Changed

- Results are now sent as "batch" request to TestRail at the end of the file. This safes API requests by only sending 1 request for a spec file (excluding screenshot requests).
- Changed the output color of debug texts to gray.

## [2.5.0]

### Added
Expand Down
30 changes: 15 additions & 15 deletions src/Reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ class Reporter {
this.baseURL = details.config.baseUrl;

ColorConsole.success(' Starting TestRail Integration v' + packageData.version);
ColorConsole.debug(' ....................................................');
ColorConsole.debug(' Cypress: ' + this.cypressVersion);
ColorConsole.debug(' Browser: ' + this.browser);
ColorConsole.debug(' System: ' + this.system);
ColorConsole.debug(' Base URL: ' + this.baseURL);
ColorConsole.debug(' TestRail Domain: ' + this.domain);
ColorConsole.info(' ....................................................');
ColorConsole.info(' Cypress: ' + this.cypressVersion);
ColorConsole.info(' Browser: ' + this.browser);
ColorConsole.info(' System: ' + this.system);
ColorConsole.info(' Base URL: ' + this.baseURL);
ColorConsole.info(' TestRail Domain: ' + this.domain);

if (this.modeCreateRun) {
ColorConsole.debug(' TestRail Mode: Create Run');
ColorConsole.debug(' TestRail Project ID: ' + this.projectId);
ColorConsole.debug(' TestRail Milestone ID: ' + this.milestoneId);
ColorConsole.debug(' TestRail Suite ID: ' + this.suiteId);
ColorConsole.debug(' TestRail Run Name: ' + this.runName);
ColorConsole.info(' TestRail Mode: Create Run');
ColorConsole.info(' TestRail Project ID: ' + this.projectId);
ColorConsole.info(' TestRail Milestone ID: ' + this.milestoneId);
ColorConsole.info(' TestRail Suite ID: ' + this.suiteId);
ColorConsole.info(' TestRail Run Name: ' + this.runName);
} else {
ColorConsole.debug(' TestRail Mode: Use existing Run');
ColorConsole.debug(' TestRail Run ID: ' + this.runId);
ColorConsole.info(' TestRail Mode: Use existing Run');
ColorConsole.info(' TestRail Run ID: ' + this.runId);
}

ColorConsole.debug(' Screenshots: ' + this.screenshotsEnabled);
ColorConsole.info(' Screenshots: ' + this.screenshotsEnabled);

// if we don't have a runID, then we need to create one
if (this.runId === '') {
Expand Down Expand Up @@ -125,7 +125,7 @@ class Reporter {
// run created
this.runId = runId;
/* eslint-disable no-console */
console.log(' New TestRail Run: R' + this.runId);
ColorConsole.debug(' New TestRail Run: R' + this.runId);
});
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/services/ColorConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ class ColorConsole {
* @param text
*/
static debug(text) {
/* eslint-disable no-console */
console.log('\x1b[90m', text, '\x1b[0m');
}

/**
*
* @param text
*/
static info(text) {
/* eslint-disable no-console */
console.log('\x1b[1m', text, '\x1b[0m');
}
Expand Down

0 comments on commit ddc3e75

Please sign in to comment.