playwright-slack-report 1.1.17 → 1.1.20

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/README.md CHANGED
@@ -168,6 +168,12 @@ Instructs the reporter to show the failure details in a thread instead of the ma
168
168
 
169
169
  ![Show failures in threads](./assets/threads.png)
170
170
 
171
+ ### **proxy** (optional)
172
+ String representation of your proxy server.
173
+ *Example*:
174
+
175
+ `proxy: "http://proxy.mycompany.com:8080",`
176
+
171
177
  ### **meta** (default: empty array)
172
178
  The meta data to be sent to Slack. This is useful for providing additional context to your test run.
173
179
 
@@ -11,6 +11,7 @@ declare class SlackReporter implements Reporter {
11
11
  private slackLogLevel;
12
12
  private slackOAuthToken;
13
13
  private disableUnfurl;
14
+ private proxy;
14
15
  private suite;
15
16
  logs: string[];
16
17
  onBegin(fullConfig: FullConfig, suite: Suite): void;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const web_api_1 = require("@slack/web-api");
4
+ const https_proxy_agent_1 = require("https-proxy-agent");
4
5
  const ResultsParser_1 = require("./ResultsParser");
5
6
  const SlackClient_1 = require("./SlackClient");
6
7
  class SlackReporter {
@@ -15,6 +16,7 @@ class SlackReporter {
15
16
  slackLogLevel;
16
17
  slackOAuthToken;
17
18
  disableUnfurl;
19
+ proxy;
18
20
  suite;
19
21
  logs = [];
20
22
  onBegin(fullConfig, suite) {
@@ -32,6 +34,7 @@ class SlackReporter {
32
34
  this.disableUnfurl = slackReporterConfig.disableUnfurl || false;
33
35
  this.showInThread = slackReporterConfig.showInThread || false;
34
36
  this.slackLogLevel = slackReporterConfig.slackLogLevel || web_api_1.LogLevel.DEBUG;
37
+ this.proxy = slackReporterConfig.proxy || undefined;
35
38
  }
36
39
  this.resultsParser = new ResultsParser_1.default();
37
40
  }
@@ -54,8 +57,10 @@ class SlackReporter {
54
57
  this.log('⏩ Slack reporter - no failures found');
55
58
  return;
56
59
  }
60
+ const agent = this.proxy ? new https_proxy_agent_1.HttpsProxyAgent(this.proxy) : undefined;
57
61
  const slackClient = new SlackClient_1.default(new web_api_1.WebClient(this.slackOAuthToken || process.env.SLACK_BOT_USER_OAUTH_TOKEN, {
58
62
  logLevel: this.slackLogLevel || web_api_1.LogLevel.DEBUG,
63
+ agent,
59
64
  }));
60
65
  const result = await slackClient.sendMessage({
61
66
  options: {
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@slack/web-api": "^6.8.1"
3
+ "@slack/web-api": "^6.8.1",
4
+ "https-proxy-agent": "^7.0.1"
4
5
  },
5
6
  "devDependencies": {
6
7
  "@playwright/test": "^1.23.3",
@@ -27,7 +28,7 @@
27
28
  "lint": "npx eslint . --ext .ts"
28
29
  },
29
30
  "name": "playwright-slack-report",
30
- "version": "1.1.17",
31
+ "version": "1.1.20",
31
32
  "main": "index.js",
32
33
  "types": "dist/index.d.ts",
33
34
  "repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",