Skip to content

Commit

Permalink
Merge pull request #14 from niklasschaeffer/add-build-url
Browse files Browse the repository at this point in the history
Adds the necessary buildUrl to the reporter
  • Loading branch information
Ma11hewThomas authored Jul 24, 2024
2 parents bb9a289 + f42902e commit 07f6437
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/generate-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface ReporterConfigOptions {
osVersion?: string | undefined
buildName?: string | undefined
buildNumber?: string | undefined
buildUrl?: string | undefined
}

class GenerateCtrfReport extends WDIOReporter {
Expand Down Expand Up @@ -54,6 +55,7 @@ class GenerateCtrfReport extends WDIOReporter {
osVersion: reporterOptions?.osVersion ?? undefined,
buildName: reporterOptions?.buildName ?? undefined,
buildNumber: reporterOptions?.buildNumber ?? undefined,
buildUrl: reporterOptions?.buildUrl ?? undefined,
}
this.ctrfReport = {
results: {
Expand Down Expand Up @@ -214,6 +216,9 @@ class GenerateCtrfReport extends WDIOReporter {
if (reporterConfigOptions.buildNumber !== undefined) {
this.ctrfEnvironment.buildNumber = reporterConfigOptions.buildNumber
}
if (reporterConfigOptions.buildUrl !== undefined) {
this.ctrfEnvironment.buildUrl = reporterConfigOptions.buildUrl
}
}

hasEnvironmentDetails(environment: CtrfEnvironment): boolean {
Expand Down
1 change: 1 addition & 0 deletions types/ctrf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface CtrfEnvironment {
osVersion?: string
buildName?: string
buildNumber?: string
buildUrl?: string
extra?: Record<string, any>
}

Expand Down

0 comments on commit 07f6437

Please sign in to comment.