diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 91f0362..0000000 Binary files a/.DS_Store and /dev/null differ 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 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` 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", 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; }; 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};