-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEVX-1176] Set browser proxy via env var (#111)
* Consolidate config Drive all playwright config with a single config file. It sets defaults and merges with customer defined playwright.config.js file (if it exists). * update tests * oops, was supposed to be list reporter * Define junit.xml path once * Define assets path once * Explain why we have to set runCfg.path * style * treat playwright config as src * Don't merge configs just yet. Will need some more exploration to understand more of the side effects. * setup mock cwd and test against it more clearly * config is in src now * Use a more compatible way to set proxy via browser context * also ignore https errors if proxy is set * set proxy on context and launch * update readme instructions * 2 spaces for everything * little note on setting the second proxy
- Loading branch information
Showing
7 changed files
with
82 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ root = true | |
[*] | ||
|
||
indent_style = space | ||
indent_size = 4 | ||
indent_size = 2 | ||
|
||
end_of_line = lf | ||
charset = utf-8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const process = require('process'); | ||
|
||
const defaults = { | ||
use: { | ||
headed: process.env.SAUCE_VM ? true : false, | ||
video: process.env.SAUCE_VM ? 'off' : 'on', | ||
}, | ||
reporter: [ | ||
['list'], | ||
// outputFile is set by playwright-runner.js as an env variable. The runner needs to process it | ||
// so better for it to set the output path | ||
['junit'], | ||
], | ||
}; | ||
|
||
if ('HTTP_PROXY' in process.env && process.env.HTTP_PROXY !== '') { | ||
const proxy = { | ||
server: process.env.HTTP_PROXY, | ||
}; | ||
|
||
defaults.use.contextOptions = { proxy, ignoreHTTPSErrors: true }; | ||
// Need to set the browser launch option as well, it is a hard requirement when testing chromium + windows. | ||
defaults.use.launchOptions = { proxy, ignoreHTTPSErrors: true }; | ||
} | ||
|
||
module.exports = defaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters