@supatest/wdio-appium-reporter 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6839 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +137 -0
- package/dist/index.d.ts +137 -0
- package/dist/index.js +6834 -0
- package/dist/index.js.map +1 -0
- package/package.json +87 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import WDIOReporter, { RunnerStats, SuiteStats, HookStats, TestStats, AfterCommandArgs } from '@wdio/reporter';
|
|
2
|
+
|
|
3
|
+
type ErrorCategory = "RUN_CREATE" | "TEST_SUBMISSION" | "ATTACHMENT_SIGN" | "ATTACHMENT_UPLOAD" | "FILE_READ" | "RUN_COMPLETE";
|
|
4
|
+
type ReporterError = {
|
|
5
|
+
category: ErrorCategory;
|
|
6
|
+
message: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
testTitle?: string;
|
|
9
|
+
attachmentName?: string;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
originalError?: string;
|
|
13
|
+
};
|
|
14
|
+
type ErrorSummary = {
|
|
15
|
+
totalErrors: number;
|
|
16
|
+
byCategory: Record<ErrorCategory, number>;
|
|
17
|
+
errors: ReporterError[];
|
|
18
|
+
};
|
|
19
|
+
type BaseReporterOptions = {
|
|
20
|
+
projectId: string;
|
|
21
|
+
apiKey: string;
|
|
22
|
+
apiUrl?: string;
|
|
23
|
+
uploadAssets?: boolean;
|
|
24
|
+
maxConcurrentUploads?: number;
|
|
25
|
+
retryAttempts?: number;
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
dryRun?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare class ErrorCollector {
|
|
31
|
+
private errors;
|
|
32
|
+
recordError(category: ErrorCategory, message: string, context?: {
|
|
33
|
+
testId?: string;
|
|
34
|
+
testTitle?: string;
|
|
35
|
+
attachmentName?: string;
|
|
36
|
+
filePath?: string;
|
|
37
|
+
error?: unknown;
|
|
38
|
+
}): void;
|
|
39
|
+
getSummary(): ErrorSummary;
|
|
40
|
+
hasErrors(): boolean;
|
|
41
|
+
formatSummary(): string;
|
|
42
|
+
private getCategoryIcon;
|
|
43
|
+
private getCategoryLabel;
|
|
44
|
+
private formatError;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type ReporterOptions = BaseReporterOptions & {
|
|
48
|
+
screenshotDir?: string;
|
|
49
|
+
videoDir?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare class SupatestAppiumReporter extends WDIOReporter {
|
|
53
|
+
private readonly reporterOptions;
|
|
54
|
+
private client;
|
|
55
|
+
private uploader;
|
|
56
|
+
private errorCollector;
|
|
57
|
+
private runId?;
|
|
58
|
+
private uploadQueue;
|
|
59
|
+
private uploadLimit;
|
|
60
|
+
private startedAt?;
|
|
61
|
+
private firstTestStartTime?;
|
|
62
|
+
private firstFailureTime?;
|
|
63
|
+
private testsProcessed;
|
|
64
|
+
private disabled;
|
|
65
|
+
private rootDir;
|
|
66
|
+
private stepIdCounter;
|
|
67
|
+
private suiteStack;
|
|
68
|
+
private currentRunner?;
|
|
69
|
+
private currentHooks;
|
|
70
|
+
private screenshotPaths;
|
|
71
|
+
private recordingPaths;
|
|
72
|
+
private currentTestUid?;
|
|
73
|
+
private tempFiles;
|
|
74
|
+
private initPromise?;
|
|
75
|
+
private initComplete;
|
|
76
|
+
private pendingUploadCount;
|
|
77
|
+
private runCompletePromise?;
|
|
78
|
+
private runComplete;
|
|
79
|
+
private unregisterInterruptHandler?;
|
|
80
|
+
private testsForVideoUpload;
|
|
81
|
+
constructor(options: Partial<ReporterOptions> & Record<string, any>);
|
|
82
|
+
onRunnerStart(runner: RunnerStats): void;
|
|
83
|
+
private initializeRun;
|
|
84
|
+
onSuiteStart(suite: SuiteStats): void;
|
|
85
|
+
onSuiteEnd(_suite: SuiteStats): void;
|
|
86
|
+
onHookStart(_hook: HookStats): void;
|
|
87
|
+
onHookEnd(hook: HookStats): void;
|
|
88
|
+
onTestStart(test: TestStats): void;
|
|
89
|
+
onTestPass(test: TestStats): void;
|
|
90
|
+
onTestFail(test: TestStats): void;
|
|
91
|
+
onTestSkip(test: TestStats): void;
|
|
92
|
+
/**
|
|
93
|
+
* Track Appium-specific commands:
|
|
94
|
+
* - saveScreenshot → file path (standard)
|
|
95
|
+
* - /screenshot endpoint → base64 PNG from takeScreenshot() → save to temp file
|
|
96
|
+
* - stopRecordingScreen → base64 MP4 → save to temp file
|
|
97
|
+
*/
|
|
98
|
+
onAfterCommand(command: AfterCommandArgs): void;
|
|
99
|
+
private trackScreenshot;
|
|
100
|
+
private trackRecording;
|
|
101
|
+
/**
|
|
102
|
+
* Save a base64-encoded buffer to a temp file and return its path.
|
|
103
|
+
*/
|
|
104
|
+
private saveBase64Temp;
|
|
105
|
+
private processTest;
|
|
106
|
+
private processTestResult;
|
|
107
|
+
private buildTestPayload;
|
|
108
|
+
private buildSteps;
|
|
109
|
+
private getHookCategory;
|
|
110
|
+
private serializeErrors;
|
|
111
|
+
private serializeError;
|
|
112
|
+
private uploadAttachments;
|
|
113
|
+
private uploadAttachmentFiles;
|
|
114
|
+
private waitForAndUploadVideos;
|
|
115
|
+
onRunnerEnd(runner: RunnerStats): void;
|
|
116
|
+
private completeRun;
|
|
117
|
+
get isSynchronised(): boolean;
|
|
118
|
+
private extractCapabilities;
|
|
119
|
+
private getAppiumVersion;
|
|
120
|
+
private getFramework;
|
|
121
|
+
private getEnvironmentInfo;
|
|
122
|
+
private computeSummary;
|
|
123
|
+
private mapRunStatus;
|
|
124
|
+
private getTestId;
|
|
125
|
+
private getResultId;
|
|
126
|
+
private parseTestMetadata;
|
|
127
|
+
private getSuitePath;
|
|
128
|
+
private getSpecFile;
|
|
129
|
+
private extractTags;
|
|
130
|
+
private getTestOutcome;
|
|
131
|
+
private findScreenshotsForTest;
|
|
132
|
+
private findVideosForTest;
|
|
133
|
+
private cleanupTempFiles;
|
|
134
|
+
private getGitInfo;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { type ErrorCategory, ErrorCollector, type ErrorSummary, type ReporterOptions, SupatestAppiumReporter as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import WDIOReporter, { RunnerStats, SuiteStats, HookStats, TestStats, AfterCommandArgs } from '@wdio/reporter';
|
|
2
|
+
|
|
3
|
+
type ErrorCategory = "RUN_CREATE" | "TEST_SUBMISSION" | "ATTACHMENT_SIGN" | "ATTACHMENT_UPLOAD" | "FILE_READ" | "RUN_COMPLETE";
|
|
4
|
+
type ReporterError = {
|
|
5
|
+
category: ErrorCategory;
|
|
6
|
+
message: string;
|
|
7
|
+
testId?: string;
|
|
8
|
+
testTitle?: string;
|
|
9
|
+
attachmentName?: string;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
originalError?: string;
|
|
13
|
+
};
|
|
14
|
+
type ErrorSummary = {
|
|
15
|
+
totalErrors: number;
|
|
16
|
+
byCategory: Record<ErrorCategory, number>;
|
|
17
|
+
errors: ReporterError[];
|
|
18
|
+
};
|
|
19
|
+
type BaseReporterOptions = {
|
|
20
|
+
projectId: string;
|
|
21
|
+
apiKey: string;
|
|
22
|
+
apiUrl?: string;
|
|
23
|
+
uploadAssets?: boolean;
|
|
24
|
+
maxConcurrentUploads?: number;
|
|
25
|
+
retryAttempts?: number;
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
dryRun?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare class ErrorCollector {
|
|
31
|
+
private errors;
|
|
32
|
+
recordError(category: ErrorCategory, message: string, context?: {
|
|
33
|
+
testId?: string;
|
|
34
|
+
testTitle?: string;
|
|
35
|
+
attachmentName?: string;
|
|
36
|
+
filePath?: string;
|
|
37
|
+
error?: unknown;
|
|
38
|
+
}): void;
|
|
39
|
+
getSummary(): ErrorSummary;
|
|
40
|
+
hasErrors(): boolean;
|
|
41
|
+
formatSummary(): string;
|
|
42
|
+
private getCategoryIcon;
|
|
43
|
+
private getCategoryLabel;
|
|
44
|
+
private formatError;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type ReporterOptions = BaseReporterOptions & {
|
|
48
|
+
screenshotDir?: string;
|
|
49
|
+
videoDir?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare class SupatestAppiumReporter extends WDIOReporter {
|
|
53
|
+
private readonly reporterOptions;
|
|
54
|
+
private client;
|
|
55
|
+
private uploader;
|
|
56
|
+
private errorCollector;
|
|
57
|
+
private runId?;
|
|
58
|
+
private uploadQueue;
|
|
59
|
+
private uploadLimit;
|
|
60
|
+
private startedAt?;
|
|
61
|
+
private firstTestStartTime?;
|
|
62
|
+
private firstFailureTime?;
|
|
63
|
+
private testsProcessed;
|
|
64
|
+
private disabled;
|
|
65
|
+
private rootDir;
|
|
66
|
+
private stepIdCounter;
|
|
67
|
+
private suiteStack;
|
|
68
|
+
private currentRunner?;
|
|
69
|
+
private currentHooks;
|
|
70
|
+
private screenshotPaths;
|
|
71
|
+
private recordingPaths;
|
|
72
|
+
private currentTestUid?;
|
|
73
|
+
private tempFiles;
|
|
74
|
+
private initPromise?;
|
|
75
|
+
private initComplete;
|
|
76
|
+
private pendingUploadCount;
|
|
77
|
+
private runCompletePromise?;
|
|
78
|
+
private runComplete;
|
|
79
|
+
private unregisterInterruptHandler?;
|
|
80
|
+
private testsForVideoUpload;
|
|
81
|
+
constructor(options: Partial<ReporterOptions> & Record<string, any>);
|
|
82
|
+
onRunnerStart(runner: RunnerStats): void;
|
|
83
|
+
private initializeRun;
|
|
84
|
+
onSuiteStart(suite: SuiteStats): void;
|
|
85
|
+
onSuiteEnd(_suite: SuiteStats): void;
|
|
86
|
+
onHookStart(_hook: HookStats): void;
|
|
87
|
+
onHookEnd(hook: HookStats): void;
|
|
88
|
+
onTestStart(test: TestStats): void;
|
|
89
|
+
onTestPass(test: TestStats): void;
|
|
90
|
+
onTestFail(test: TestStats): void;
|
|
91
|
+
onTestSkip(test: TestStats): void;
|
|
92
|
+
/**
|
|
93
|
+
* Track Appium-specific commands:
|
|
94
|
+
* - saveScreenshot → file path (standard)
|
|
95
|
+
* - /screenshot endpoint → base64 PNG from takeScreenshot() → save to temp file
|
|
96
|
+
* - stopRecordingScreen → base64 MP4 → save to temp file
|
|
97
|
+
*/
|
|
98
|
+
onAfterCommand(command: AfterCommandArgs): void;
|
|
99
|
+
private trackScreenshot;
|
|
100
|
+
private trackRecording;
|
|
101
|
+
/**
|
|
102
|
+
* Save a base64-encoded buffer to a temp file and return its path.
|
|
103
|
+
*/
|
|
104
|
+
private saveBase64Temp;
|
|
105
|
+
private processTest;
|
|
106
|
+
private processTestResult;
|
|
107
|
+
private buildTestPayload;
|
|
108
|
+
private buildSteps;
|
|
109
|
+
private getHookCategory;
|
|
110
|
+
private serializeErrors;
|
|
111
|
+
private serializeError;
|
|
112
|
+
private uploadAttachments;
|
|
113
|
+
private uploadAttachmentFiles;
|
|
114
|
+
private waitForAndUploadVideos;
|
|
115
|
+
onRunnerEnd(runner: RunnerStats): void;
|
|
116
|
+
private completeRun;
|
|
117
|
+
get isSynchronised(): boolean;
|
|
118
|
+
private extractCapabilities;
|
|
119
|
+
private getAppiumVersion;
|
|
120
|
+
private getFramework;
|
|
121
|
+
private getEnvironmentInfo;
|
|
122
|
+
private computeSummary;
|
|
123
|
+
private mapRunStatus;
|
|
124
|
+
private getTestId;
|
|
125
|
+
private getResultId;
|
|
126
|
+
private parseTestMetadata;
|
|
127
|
+
private getSuitePath;
|
|
128
|
+
private getSpecFile;
|
|
129
|
+
private extractTags;
|
|
130
|
+
private getTestOutcome;
|
|
131
|
+
private findScreenshotsForTest;
|
|
132
|
+
private findVideosForTest;
|
|
133
|
+
private cleanupTempFiles;
|
|
134
|
+
private getGitInfo;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { type ErrorCategory, ErrorCollector, type ErrorSummary, type ReporterOptions, SupatestAppiumReporter as default };
|