From fa4e0f63e3240ece4f2fc9cc5ed9c6d33ce792a4 Mon Sep 17 00:00:00 2001 From: Vlad Boltrukanis Date: Mon, 17 Oct 2022 21:02:21 +0300 Subject: [PATCH 1/5] ref: remove console logs --- src/lib/Api.ts | 4 ---- src/lib/ZebAgent.ts | 1 - 2 files changed, 5 deletions(-) diff --git a/src/lib/Api.ts b/src/lib/Api.ts index 7d1a64c..92e6566 100644 --- a/src/lib/Api.ts +++ b/src/lib/Api.ts @@ -45,8 +45,6 @@ export default class Api { } } catch (e) { if (attempt === this._maxAttempts) { - console.log(`Payload: ${JSON.stringify(options.payload)}`); - console.log(e.response.data); } else { await this.post( { @@ -96,8 +94,6 @@ export default class Api { } } catch (e) { if (attempt === this._maxAttempts) { - console.log(`Payload: ${JSON.stringify(options.payload)}`); - console.log(e.response.data); return; } else { await this.put( diff --git a/src/lib/ZebAgent.ts b/src/lib/ZebAgent.ts index 9f96e74..1c5fa9a 100644 --- a/src/lib/ZebAgent.ts +++ b/src/lib/ZebAgent.ts @@ -332,7 +332,6 @@ export default class ZebAgent { _getFileSizeInBytes = (filename) => { const stats = fs.statSync(filename); const fileSizeInBytes = stats.size; - console.log('size', fileSizeInBytes); return fileSizeInBytes; }; From 0eee98e19dda69973432793e17a3b395d80f75f8 Mon Sep 17 00:00:00 2001 From: Vlad Boltrukanis Date: Mon, 17 Oct 2022 21:02:27 +0300 Subject: [PATCH 2/5] feat: add ability to do logging --- src/lib/ZebEmitter.ts | 3 +++ src/lib/ZebrunnerReporter.ts | 7 +++++++ src/lib/constants.ts | 1 + 3 files changed, 11 insertions(+) diff --git a/src/lib/ZebEmitter.ts b/src/lib/ZebEmitter.ts index f56c176..0ec6c00 100644 --- a/src/lib/ZebEmitter.ts +++ b/src/lib/ZebEmitter.ts @@ -11,4 +11,7 @@ export const ZebEmitter = { setMaintainer: (maintainer): void => { sendEventToReporter(tcmEvents.SET_MAINTAINER, maintainer); }, + log: (logMessage): void => { + sendEventToReporter(tcmEvents.LOG, logMessage); + } }; diff --git a/src/lib/ZebrunnerReporter.ts b/src/lib/ZebrunnerReporter.ts index c292984..7bb37df 100644 --- a/src/lib/ZebrunnerReporter.ts +++ b/src/lib/ZebrunnerReporter.ts @@ -143,6 +143,13 @@ class ZebrunnerReporter implements Reporter { if (type === tcmEvents.SET_MAINTAINER) { test.maintainer = data; } + + if (type === tcmEvents.LOG) { + result.steps.push({ + title: data, + startTime: new Date().getTime(), + }); + } } async onEnd() { diff --git a/src/lib/constants.ts b/src/lib/constants.ts index ac3dd0d..048014b 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -29,6 +29,7 @@ const tcmEvents = { TCM_RUN_OPTIONS: 'TCM_RUN_OPTIONS', TCM_TEST_OPTIONS: 'TCM_TEST_OPTIONS', SET_MAINTAINER: 'SET_MAINTAINER', + LOG: 'LOG', }; export {xrayLabels, testRailLabels, zephyrLabels, tcmEvents}; From ce4fdbe61f1e20bfd86ec611c378c83b5f34a19d Mon Sep 17 00:00:00 2001 From: Vlad Boltrukanis Date: Mon, 17 Oct 2022 21:02:30 +0300 Subject: [PATCH 3/5] fix: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87802cd..25b64bf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This agent was originally developed by [Ryan Rosello](https://github.com/ryanros Run the following: -`@zebrunner/javascript-agent-playwright -D` +`npm i @zebrunner/javascript-agent-playwright -D` It is currently possible to provide the configuration via: - `Environment variables` From fce9cd4546d5acc255db2a8fa27fcbe72a156db1 Mon Sep 17 00:00:00 2001 From: Vladislav Boltrukanis Date: Mon, 17 Oct 2022 21:19:31 +0300 Subject: [PATCH 4/5] update .gitignore --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 91f0362850ec97e2d6cde1a3f15afa5b079304a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ5Iwu5S@)3WCTShkSHj8gkIYMhTk5zA2my(>-tx1gb;L_&g!D0OMwL>(fE&=_0W=r$O~xizdMo?W1^bDYz1 zHth~ZMLut2tK%;!!1r#8GFsv{q5Ay`-`?x-yhzjGtQf){eH`5!?ms>pH*?0{=FHD3 z&q*6I5C!-T3mW-P&~3JkRJl*?UV^J9%Pnn>3jCG=*t6N99f#Vh0;+&2uu_2E4>1~JB3L@KuMTwf z2mlP>wuUjECAcOQOax1Zh`@|11-eorM-1c2;g2OR5iA|Lax!xGFv4u)gkmf^=8tVU znZ%*?s(>osD-gKL4)6c{uh0K}kzT0+s=&Wez=Y`_?O{o>w>B2Xdu@z%ipIuyrNdPT j26ih(E^oyLXx8A5c>qiVONa2l^h3bPpq(o4qY8WiR1|2A diff --git a/.gitignore b/.gitignore index c933848..3a4e850 100644 --- a/.gitignore +++ b/.gitignore @@ -88,4 +88,6 @@ dist playwright-report/ test-results/ build/ -results.json \ No newline at end of file +results.json +.DS_Store +package-lock.json From bf17895b8e265ef848feb68044b385093d903a5e Mon Sep 17 00:00:00 2001 From: Vladislav Boltrukanis Date: Mon, 17 Oct 2022 21:26:24 +0300 Subject: [PATCH 5/5] fix: move dotenv from devdeps to deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f6cbd7..51860c5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ }, "devDependencies": { "@playwright/test": "^1.18.1", - "dotenv": "^14.3.2", "playwright": "^1.18.1", "prettier": "^2.5.1", "typescript": "^4.5.5" @@ -23,6 +22,7 @@ "fluent-ffmpeg": "^2.1.2", "form-data": "^4.0.0", "ua-parser-js": "^1.0.2", + "dotenv": "^14.3.2", "uuid": "^8.3.2" }, "homepage": "https://github.com/zebrunner/javascript-agent-playwright#readme",