fix: wait for JS chunks on quickpizza login pages + use getByRole#1580
Merged
fix: wait for JS chunks on quickpizza login pages + use getByRole#1580
Conversation
Script size changes
Totals
|
This comment was marked as outdated.
This comment was marked as outdated.
7b6f973 to
45b4337
Compare
45b4337 to
38b9dfe
Compare
38b9dfe to
76c2da7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The example scripts that interact with the quickpizza page currently do not work, as they do not wait for all the JS chunks to load. This failure could be seen in a regular browser by loading the page with the JS console open and immediately submitting the form, resulting in
Uncaught (in promise) TypeError: error loading dynamically imported module: https://quickpizza.grafana.com/_app/immutable/entry/app.Dx_ShQrU.jsbeing logged.Also, opinion, but I think the examples should recommend using a11y-first locators such as
getByRolewith a role + label, rather than IDs from the DOM.Special notes for your reviewer:
I'm slightly confused by why there are four near-identical versions of this snippet. I think the snippet in
constants.tscould easily replace thefillform.js+browser_fill_form.jssnippets (the latter of which seems not to be used anywhere), though I could understand wanting to keepkeyboard.jsaround as an example of using.type.