Skip to content

Commit

Permalink
fix: wait for attachment upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianOsipiuk committed Jun 11, 2021
1 parent d3225ac commit 933f04d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class TestcafeTestrailReporter {
);
const { value: tests } = await throwOnApiError(testrailAPI.getTests(runId));

uploadScreenshots({
await uploadScreenshots({
config: this.config,
tests,
results,
Expand All @@ -289,7 +289,7 @@ class TestcafeTestrailReporter {
testrailAPI,
});

uploadVideos({
await uploadVideos({
config: this.config,
tests,
results,
Expand Down
18 changes: 8 additions & 10 deletions src/utils/upload-screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { TestRail, AddResultForCase, Test, Result } from "testrail-js-api";
import { throwOnApiError } from "../utils";
import type { Config, Screenshot } from "../types";

type UploadScreenshots = (options: {
export const uploadScreenshots = async ({
config,
tests,
results,
resultsToPush,
screenshots,
testrailAPI,
}: {
config: Config;
tests: Test[];
results: Result[];
Expand All @@ -12,15 +19,6 @@ type UploadScreenshots = (options: {
[key: string]: Screenshot[];
};
testrailAPI: TestRail;
}) => void;

export const uploadScreenshots: UploadScreenshots = async ({
config,
tests,
results,
resultsToPush,
screenshots,
testrailAPI,
}) => {
if (config.uploadScreenshots) {
console.log("[TestRail] Uploading screenshots...");
Expand Down
18 changes: 8 additions & 10 deletions src/utils/upload-videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { TestRail, AddResultForCase, Test, Result } from "testrail-js-api";
import { throwOnApiError } from "../utils";
import type { Config, Video } from "../types";

type UploadVideos = (options: {
export const uploadVideos = async ({
config,
tests,
results,
resultsToPush,
videos,
testrailAPI,
}: {
config: Config;
tests: Test[];
results: Result[];
Expand All @@ -12,15 +19,6 @@ type UploadVideos = (options: {
[key: string]: Video[];
};
testrailAPI: TestRail;
}) => void;

export const uploadVideos: UploadVideos = async ({
config,
tests,
results,
resultsToPush,
videos,
testrailAPI,
}) => {
if (config.uploadVideos) {
console.log("[TestRail] Uploading videos...");
Expand Down

0 comments on commit 933f04d

Please sign in to comment.