Skip to content

Commit

Permalink
Convert session details property to a stringified value
Browse files Browse the repository at this point in the history
  • Loading branch information
rconner46 committed Jul 30, 2024
1 parent 25b95c7 commit 2a19d32
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 10 deletions.
7 changes: 6 additions & 1 deletion dist/index.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions dist/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.min.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/public-api/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface TestRunAutoResultDto {
testCycleId: number;
status: TestRunAutoResultStatus;
failureReason?: string;
sessionDetailsJson?: object;
sessionDetailsJson?: SessionDetails;
startTime?: Date;
endTime?: Date;
}
Expand All @@ -14,3 +14,14 @@ export enum TestRunAutoResultStatus {
CANCELED = 'CANCELED',
ERROR = 'ERROR',
}

export interface SessionDetails {
value: {
deviceName: string;
orientation: string;
platformName: string;
platformVersion: string;
browserName: string;
browserVersion: string;
};
}
7 changes: 6 additions & 1 deletion src/public-api/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ export class PublicApi {
try {
return await this.client.post<void>(
`v2/test-case-results/${testCaseId}/submit`,
info
{
...info,
// override the sessionDetailsJson property with the
// stringified version that the server expects
sessionDetailsJson: JSON.stringify(info.sessionDetailsJson),
}
);
} finally {
this.callsInFlight -= 1;
Expand Down

0 comments on commit 2a19d32

Please sign in to comment.