We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
browserContext.addInitScript differs in behaviour depending on type of script, e.g. if you pass in a string vs a non string.
browserContext.addInitScript
v1.4.3
NA
This works as intended so Math.random is overridden and will always return 0:
Math.random
const browserContext = browser.newContext(); browserContext.addInitScript("Math.random = function(){return 0}");
This will not work as intended so Math.random isn't overridden and returns a random number:
const browserContext = browser.newContext(); browserContext.addInitScript(Math.random = function(){return 0});
The behaviour should be the same, and match what currently happens when a string function is passed in.
The behaviour differs.
The content you are editing has changed. Please copy your edits and refresh the page.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Brief summary
browserContext.addInitScript
differs in behaviour depending on type of script, e.g. if you pass in a string vs a non string.xk6-browser version
v1.4.3
OS
NA
Chrome version
NA
Docker version and image (if applicable)
NA
Steps to reproduce the problem
This works as intended so
Math.random
is overridden and will always return 0:This will not work as intended so
Math.random
isn't overridden and returns a random number:Expected behaviour
The behaviour should be the same, and match what currently happens when a string function is passed in.
Actual behaviour
The behaviour differs.
Tasks
The text was updated successfully, but these errors were encountered: