This would be ideal, if it weren't deprecated. Prior to submitting my original post, I did try to follow the suggestion from the docs to create a new browser context, but it appears that the @elastic/synthetics
setup creates an initial browser context and runs in that context. In creating a new context, what happened was that it opened a new window that everything ran in, but nothing validated in. If you have a pattern for doing this, it would certainly be an acceptable item, especially if I could configure this in a beforeAll()
.
anther solution that will require a pull request is we can apply params to config file just like we do for lightweight yaml with that you will be able to use params in config file like this
playwrightOptions: { ignoreHTTPSErrors: false, httpCredentials: { username: '${username}', password: '${password}', }, },
do you think it will be useful?
If it were to be done like this, I would think that something similar to monitor.use({});
would be more helpful...like a playwrightOptions.use({})
.
At the moment, setting the httpCredentials: {}
from environment variables at startup is working for me. And it does resolve the issue where the params values as defined in Synthetics seem to be visible to ANYBODY with access to synthetics, which doesn't seem to be that secure to me.