-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix fill method in injection script #4809
New issue
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
base: master
Are you sure you want to change the base?
Conversation
This fill function was failing to fill the input text field. It would seem that it was returning to early, when it should have continued onto the end of the function and returned "needsinput".
Is this something that can be tested? Like, with a unit test, I mean 🤔 |
I did try, and i wasn't able to get it to not work before the fix! Very strange. I'll give it another go though 👍 |
@joanlopez I've added an integration test in 9a35675. It fails without the fix and passes with the fix. Turned out to be an issue due how react works. |
It relies on a react based website.
9a35675
to
8700afc
Compare
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a "quick-win" could be copy-pasting these files locally, right? 🤔 So, this way we don't rely on an external server, to be available. Reproducing the issue (if React-specific) with a subset of the library might more challenging, tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but it will be nice if we do not have to import 2 react dependancies from a third party to test this.
What?
Preventing an early exit in the fill method in the injection script to actually allow the keyboard to enter the value into the input element.
Why?
This fill function was failing to fill the input text field. It would seem that it was returning to early, when it should have continued onto the end of the function and returned "needsinput".
Test script
Without the fix this script was unable to enter the username in the input element. After the fix it does:
Checklist
make check
) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)