Re-introduce ability to handle basic authentication in smoke tests.
This commit is contained in:
parent
73912ebc12
commit
af1e2865f7
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue