Skip to content

Commit 7c77ba7

Browse files
added error handling during trace attach (#115)
* added error handling during trace attach * added node 22
1 parent 2f3a615 commit 7c77ba7

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
Before submitting this PR, please ensure that you have completed the following:
1+
## Description
2+
3+
Please describe your changes and any new features you're introducing, or issues you're fixing.
24

35
- [ ] Updated the CHANGELOG.md.
46
- [ ] Checked that there aren't other open pull requests for the same issue/update.
57
- [ ] Checked that your contribution follows the project's contribution guidelines.
68
- [ ] Added corresponding unit/E2E tests
79
- [ ] Unit and E2E pass
810

9-
## Description
10-
11-
Please describe your changes and any new features you're introducing, or issues you're fixing.
12-
1311
### Related Issues
1412

1513
Please link any related issues or bug reports that this PR will address.
16-
17-
---
18-
19-
Thank you for your contribution!

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
registry-url: https://registry.npmjs.org/
1919
- run: npm ci
2020
- run: npm run build

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
test:
1010
strategy:
1111
matrix:
12-
version: [ 18, 20 ]
12+
version: [ 18, 20, 22 ]
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1010
:pencil: - chore
1111
:microscope: - experimental
1212

13-
## [Unreleased]
13+
## [0.46.2]
14+
- :beetle: added error handling during trace attach
1415
- :pencil: updated dependencies
1516

1617
## [0.46.1]

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/steps-playwright",
3-
"version": "0.46.1",
3+
"version": "0.46.2",
44
"description": "steps to interact with playwright",
55
"main": "./index.js",
66
"scripts": {
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/qavajs/steps-playwright#readme",
3030
"devDependencies": {
31-
"@cucumber/cucumber": "^10.6.0",
31+
"@cucumber/cucumber": "^10.7.0",
3232
"@qavajs/cli": "^0.37.0",
3333
"@qavajs/console-formatter": "^0.7.2",
3434
"@qavajs/html-formatter": "^0.15.4",

src/utils/tracingManager.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ class TracingManager {
2020
async stop(driverConfig: any, world: any, scenario: any) {
2121
if (saveTrace(config.driverConfig, scenario)) {
2222
const path = traceArchive(config.driverConfig, scenario);
23-
await context.tracing.stopChunk({ path });
24-
if (driverConfig?.trace.attach) {
25-
const zipBuffer: Buffer = await readFile(path);
26-
world.attach(zipBuffer.toString('base64'), 'base64:application/zip');
23+
try {
24+
await context.tracing.stopChunk({ path });
25+
if (driverConfig?.trace.attach) {
26+
const zipBuffer: Buffer = await readFile(path);
27+
world.attach(zipBuffer.toString('base64'), 'base64:application/zip');
28+
}
29+
} catch (err) {
30+
console.warn('Trace was not recorded');
2731
}
2832
}
2933
}

0 commit comments

Comments
 (0)