Skip to content

Commit 3b2505c

Browse files
committed
fix: Proxy for a11y
1 parent 721b5ed commit 3b2505c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

bin/accessibility-automation/helper.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const glob = require('glob');
99
const helper = require('../helpers/helper');
1010
const { CYPRESS_V10_AND_ABOVE_CONFIG_FILE_EXTENSIONS } = require('../helpers/constants');
1111
const supportFileContentMap = {}
12+
const HttpsProxyAgent = require('https-proxy-agent');
1213

1314
exports.checkAccessibilityPlatform = (user_config) => {
1415
let accessibility = false;
@@ -152,6 +153,13 @@ const nodeRequest = (type, url, data, config) => {
152153
data: data
153154
};
154155

156+
if(process.env.HTTP_PROXY){
157+
options.httpsAgent = new HttpsProxyAgent(process.env.HTTP_PROXY);
158+
159+
} else if (process.env.HTTPS_PROXY){
160+
options.config.httpAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
161+
}
162+
155163
axios(options).then(response => {
156164
if(!(response.status == 201 || response.status == 200)) {
157165
logger.info("response.status in nodeRequest", response.status);

bin/testObservability/crashReporter/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33
const axios = require('axios');
44
const https = require('https');
5+
const HttpsProxyAgent = require('https-proxy-agent');
56

67
const logger = require("../../helpers/logger").winstonLogger;
78
const utils = require('../../helpers/utils');
@@ -155,6 +156,13 @@ class CrashReporter {
155156
agent: httpsKeepAliveAgent
156157
};
157158

159+
if(process.env.HTTP_PROXY){
160+
options.httpsAgent = new HttpsProxyAgent(process.env.HTTP_PROXY);
161+
162+
} else if (process.env.HTTPS_PROXY){
163+
options.config.httpAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
164+
}
165+
158166
axios(options)
159167
.then(response => {
160168
if(response.status != 200) {

bin/testObservability/helper/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { spawn, execSync } = require('child_process');
99
const glob = require('glob');
1010
const util = require('util');
1111
const axios = require('axios');
12-
12+
const HttpsProxyAgent = require('https-proxy-agent');
1313

1414
const { runOptions } = require('../../helpers/runnerArgs')
1515

0 commit comments

Comments
 (0)