@@ -6,15 +6,15 @@ Learn how to generate reports for JavaScript frameworks like Cypress, Playwright
66
77``` javascript
88const job = await client .createReport ({
9- name: " My Fancy Playwright Job!" ,
9+ name: ' My Fancy Playwright Job!' ,
1010 passed: true ,
1111 startTime: new Date ().toISOString (),
1212 endTime: new Date ().toISOString (),
13- browserName: " Chrome" ,
14- browserVersion: " 105" ,
15- framework: " playwright" , // alternatives: cypress, playwright, testcafe
16- frameworkVersion: " 1.25.0" ,
17- platformName: " Windows 11"
13+ browserName: ' Chrome' ,
14+ browserVersion: ' 105' ,
15+ framework: ' playwright' , // alternatives: cypress, playwright, testcafe
16+ frameworkVersion: ' 1.25.0' ,
17+ platformName: ' Windows 11' ,
1818});
1919
2020console .log (job .id ); // the job ID
@@ -60,16 +60,16 @@ In order to view your test results in the SauceLabs web app, you must upload a t
6060 "metadata" : {}
6161}
6262```
63+
6364To upload ` sauce-test-report.json ` :
6465
6566``` javascript
66- const uploads = await client .uploadAssets (
67- job .id ,
68- [{
69- filename: " sauce-test-report.json" ,
70- data: fs .createReadStream (" sauce-test-report.json" )
71- }]
72- );
67+ const uploads = await client .uploadAssets (job .id , [
68+ {
69+ filename: ' sauce-test-report.json' ,
70+ data: fs .createReadStream (' sauce-test-report.json' ),
71+ },
72+ ]);
7373// Upon success, the array `uploads.uploaded` will equal in length to the number of assets you intended to upload.
7474// Individual assets that fail to upload will be reported via `uploads.errors`.
7575```
0 commit comments