Skip to content

Commit

Permalink
fix: flaky and retries
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma11hewThomas committed Apr 20, 2024
1 parent 983675c commit db192a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ The test object in the report includes the following [CTRF properties](https://c
| `tags` | Array of Strings | Optional | The tags retrieved from the test name |
| `type` | String | Optional | The type of test (e.g., `api`, `e2e`). |
| `filepath` | String | Optional | The file path where the test is located in the project. |
| `retry` | Number | Optional | The number of retries attempted for the test. |
| `flake` | Boolean | Optional | Indicates whether the test result is flaky. |
| `retries` | Number | Optional | The number of retries attempted for the test. |
| `flaky` | Boolean | Optional | Indicates whether the test result is flaky. |
| `browser` | String | Optional | The browser used for the test. |
| `screenshot` | String | Optional | A base64 encoded screenshot taken during the test. |

Expand Down
4 changes: 2 additions & 2 deletions src/generate-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ class GenerateCtrfReport implements Reporter {
test.tags = this.extractTagsFromTitle(testCase.title)
test.type = this.reporterConfigOptions.testType ?? 'e2e'
test.filePath = testCase.location.file
test.retry = testResult.retry
test.flake = testResult.status === 'passed' && testResult.retry > 0
test.retries = testResult.retries

Check failure on line 171 in src/generate-report.ts

View workflow job for this annotation

GitHub Actions / build

Property 'retries' does not exist on type 'TestResult'.
test.flaky = testResult.status === 'passed' && testResult.retries > 0

Check failure on line 172 in src/generate-report.ts

View workflow job for this annotation

GitHub Actions / build

Property 'retries' does not exist on type 'TestResult'.
if (this.reporterConfigOptions.screenshot === true) {
test.screenshot = this.extractScreenshotBase64(testResult)
}
Expand Down
4 changes: 2 additions & 2 deletions types/ctrf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export interface CtrfTest {
tags?: string[]
type?: string
filePath?: string
retry?: number
flake?: boolean
retries?: number
flaky?: boolean
attempts?: CtrfTest[]
browser?: string
device?: string
Expand Down

0 comments on commit db192a5

Please sign in to comment.