wdio-test-ledger-service 9.2.8 → 9.2.9
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/package.json +1 -1
- package/src/index.js +11 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -425,7 +425,11 @@ class TestLedgerLauncher {
|
|
|
425
425
|
}))
|
|
426
426
|
};
|
|
427
427
|
|
|
428
|
-
const
|
|
428
|
+
const url = `${this.getApiUrl()}/artifacts/presigned-upload`;
|
|
429
|
+
|
|
430
|
+
fs.writeFileSync(`${this.options.reporterOutputDir}/trio-presigned-request.txt`, `URL: ${url}\nPayload: ${JSON.stringify(payload, null, 2)}`, { encoding: 'utf-8' });
|
|
431
|
+
|
|
432
|
+
const response = await fetch(url, {
|
|
429
433
|
method : 'POST',
|
|
430
434
|
headers : {
|
|
431
435
|
'Content-Type' : 'application/json',
|
|
@@ -434,6 +438,12 @@ class TestLedgerLauncher {
|
|
|
434
438
|
body : JSON.stringify(payload)
|
|
435
439
|
});
|
|
436
440
|
|
|
441
|
+
if (!response.ok) {
|
|
442
|
+
const text = await response.text();
|
|
443
|
+
fs.writeFileSync(`${this.options.reporterOutputDir}/trio-presigned-failed.txt`, `Status: ${response.status} ${response.statusText}\nURL: ${url}\nResponse: ${text.substring(0, 2000)}`, { encoding: 'utf-8' });
|
|
444
|
+
throw new Error(`Presigned URL request failed: HTTP ${response.status}`);
|
|
445
|
+
}
|
|
446
|
+
|
|
437
447
|
return response.json();
|
|
438
448
|
}
|
|
439
449
|
|