@browsermation/test 0.0.63-beta.16 → 0.0.63-beta.18
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/reporter/reporter.d.ts +1 -0
- package/dist/reporter.js +10 -5
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export default class BrowsermationReporter implements Reporter {
|
|
|
14
14
|
getLatestCommitMessage(): Promise<string>;
|
|
15
15
|
gitRemoteOriginUrl(): Promise<string>;
|
|
16
16
|
sendData(data: Record<string, any>): Promise<any>;
|
|
17
|
+
getProjectSuite(parent: Suite): Suite;
|
|
17
18
|
/**
|
|
18
19
|
* onBegin() is called once with a root suite that contains all other suites and tests. Learn more about suites hierarchy.
|
|
19
20
|
*
|
package/dist/reporter.js
CHANGED
|
@@ -143,6 +143,13 @@ var BrowsermationReporter = class {
|
|
|
143
143
|
console.error("Error sending data to Browsermation:", error);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
getProjectSuite(parent) {
|
|
147
|
+
let currentSuite = parent;
|
|
148
|
+
while (currentSuite.parent && currentSuite.type !== "project") {
|
|
149
|
+
currentSuite = currentSuite.parent;
|
|
150
|
+
}
|
|
151
|
+
return currentSuite;
|
|
152
|
+
}
|
|
146
153
|
/**
|
|
147
154
|
* onBegin() is called once with a root suite that contains all other suites and tests. Learn more about suites hierarchy.
|
|
148
155
|
*
|
|
@@ -162,10 +169,7 @@ var BrowsermationReporter = class {
|
|
|
162
169
|
git_remote_origin_url: await this.gitRemoteOriginUrl(),
|
|
163
170
|
totalTests: suite.allTests().length,
|
|
164
171
|
playwright_version: _config.version,
|
|
165
|
-
node_version: process.version
|
|
166
|
-
project_name: suite.project().name,
|
|
167
|
-
suite_title: suite.title,
|
|
168
|
-
suite_type: suite.type
|
|
172
|
+
node_version: process.version
|
|
169
173
|
};
|
|
170
174
|
this.log(`${JSON.stringify(data)}
|
|
171
175
|
`);
|
|
@@ -201,7 +205,8 @@ var BrowsermationReporter = class {
|
|
|
201
205
|
cpus: (0, import_node_os.cpus)().length,
|
|
202
206
|
project: test.parent.project.name,
|
|
203
207
|
cpu_architecture: process.arch,
|
|
204
|
-
retries: test.retries
|
|
208
|
+
retries: test.retries,
|
|
209
|
+
project_title: this.getProjectSuite(test.parent)?.project?.name
|
|
205
210
|
};
|
|
206
211
|
this.log(`${JSON.stringify(data)}
|
|
207
212
|
`);
|