Skip to content

Commit

Permalink
NTR: make testrail status configs more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Jan 2, 2024
1 parent 1b483c7 commit 63ec71e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Reporter {
this.closeRun = configService.shouldCloseRun();
this.foundCaseIds = [];

this.statusConverter = new CypressStatusConverter(configService.getStatusPassed(), configService.getStatusFailed(), configService.getStatusSkipped());
this.statusConverter = new CypressStatusConverter(configService.getTestRailStatusPassed(), configService.getTestRailStatusFailed(), configService.getTestRailStatusSkipped());

this.customComment = customComment !== undefined && customComment !== null ? customComment : '';

Expand Down
12 changes: 9 additions & 3 deletions src/services/ConfigService.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,26 +429,32 @@ class ConfigService {
}

/**
* Gets the matching statusID for passed inside TestRail
* TODO, make sure to allow a custom configuration.
*
* @returns {number}
*/
getStatusPassed() {
getTestRailStatusPassed() {
return 1;
}

/**
* Gets the matching statusID for failed inside TestRail
* TODO, make sure to allow a custom configuration.
*
* @returns {number}
*/
getStatusFailed() {
getTestRailStatusFailed() {
return 5;
}

/**
* Gets the matching statusID for skipped inside TestRail
* TODO, make sure to allow a custom configuration.
*
* @returns {number}
*/
getStatusSkipped() {
getTestRailStatusSkipped() {
return 2;
}
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Jest/services/ConfigService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,17 +659,17 @@ describe('hasRunID', () => {
});


test('getStatusPassed', () => {
test('getTestRailStatusPassed', () => {
const config = new ConfigService(null);
expect(config.getStatusPassed()).toBe(1);
expect(config.getTestRailStatusPassed()).toBe(1);
});

test('getStatusSkipped', () => {
test('getTestRailStatusSkipped', () => {
const config = new ConfigService(null);
expect(config.getStatusSkipped()).toBe(2);
expect(config.getTestRailStatusSkipped()).toBe(2);
});

test('getStatusFailed', () => {
test('getTestRailStatusFailed', () => {
const config = new ConfigService(null);
expect(config.getStatusFailed()).toBe(5);
expect(config.getTestRailStatusFailed()).toBe(5);
});

0 comments on commit 63ec71e

Please sign in to comment.