|
| 1 | +export enum ApiAssertMessages { |
| 2 | + errorNotRaised = 'Error was not raised!', |
| 3 | + errorIsWrong = 'Error message is wrong!', |
| 4 | + idMissed = 'id is missed!', |
| 5 | + nameWrong = 'name is wrong!', |
| 6 | + projecIdWrong = 'project_id is wrong!', |
| 7 | + suiteMissed = 'suite is missed!', |
| 8 | + idWrong = 'id is wrong!', |
| 9 | + startTimeMissed = 'start_time is missed!', |
| 10 | + startTimeWrong = 'start_time is wrong!', |
| 11 | + finishTimeWrong = 'finish_time is wrong!', |
| 12 | + startDateMissed = 'start_date is missed!', |
| 13 | + finalResultIdWrong = 'final_result_id is wrong!', |
| 14 | + testIdWrong = 'test_id is wrong!', |
| 15 | +} |
| 16 | + |
| 17 | +class ApiResponseErrors { |
| 18 | + public missedId = `You should specify 'id'!`; |
| 19 | + public missedIdOrName = `You should specify 'id' or/and 'name' suite parameters!`; |
| 20 | + public missedProjectId = `You should specify 'project_id'!`; |
| 21 | + public missedBuildName = `You should specify 'build_name'!`; |
| 22 | + public missedSuiteId = `You should specify 'test_suite_id'`; |
| 23 | + public missedTestId = `You should specify 'test_id'`; |
| 24 | + public missedTestRunId = `You should specify 'test_run_id'`; |
| 25 | + public missedFinalResultId = `You should specify 'final_result_id' - Failed: 1, Passed: 2, Not Executed: 3, Pending: 5.`; |
| 26 | + // tslint:disable-next-line: quotemark |
| 27 | + public missedSuites = "You should specify 'suites' array with single suite like `[{id: test_suite_id}]`"; |
| 28 | + public anonymousNotAllowedToViewTestSuites = this.anonymousNotAllowedToView('Test Suites'); |
| 29 | + public anonymousNotAllowedToViewTests = this.anonymousNotAllowedToView('Tests'); |
| 30 | + public anonymousNotAllowedToViewTestResults = this.anonymousNotAllowedToView('Test Results'); |
| 31 | + public anonymousNotAllowedToCreateTestRun = this.anonymousNotAllowedToCreate('Test Run'); |
| 32 | + public entityWithIdDoesNotExist = (id: number) => `Entity with specified '${id}' id does not exist!`; |
| 33 | + |
| 34 | + private anonymousNotAllowedToView(entity: string) { |
| 35 | + return `[Permissions anonymous]: Account is not allowed to view ${entity}`; |
| 36 | + } |
| 37 | + |
| 38 | + private anonymousNotAllowedToCreate(entity: string) { |
| 39 | + return `[Permissions anonymous]: Account is not allowed to create ${entity}`; |
| 40 | + } |
| 41 | +} |
| 42 | +export const apiResponseErrors = new ApiResponseErrors(); |
0 commit comments