mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Re-introduce ability to handle basic authentication in smoke tests.
This commit is contained in:
@ -53,6 +53,15 @@ const path = require('path');
|
|||||||
|
|
||||||
page.on('console', msg => console.log(`PAGE LOG: ${msg.text}`));
|
page.on('console', msg => console.log(`PAGE LOG: ${msg.text}`));
|
||||||
|
|
||||||
|
if (process.env.AUTH_USER && process.env.AUTH_PASSWORD) {
|
||||||
|
await exec("basic authentication", () => {
|
||||||
|
return page.authenticate({
|
||||||
|
username: process.env.AUTH_USER,
|
||||||
|
password: process.env.AUTH_PASSWORD
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await exec("go to site", () => {
|
await exec("go to site", () => {
|
||||||
return page.goto(url);
|
return page.goto(url);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user