-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feat: add browser check validations (frontend) #869
Conversation
Bumps [fast-loops](https://github.com/robinweser/fast-loops) from 1.1.3 to 1.1.4. - [Commits](https://github.com/robinweser/fast-loops/commits) --- updated-dependencies: - dependency-name: fast-loops dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
945efbf
to
ccb8d20
Compare
@ckbedwell regarding tests, I'd rather add them after porting your form refactor changes into this branch as you implemented a test framework that I think will facilitate writing them here. Let me know if you disagree though. |
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.
Super minor comment but otherwise this is great work! I've tried to break it and haven't managed yet. 👏👏👏
Not for this PR but I did notice the validation gets triggered like four or five times on a single character press but it doesn't make any discernible UX impact.
Also not for this PR but I know acorn is relatively big so at some point in the future we can look at lazy loading it as it is only needed for a very specific part of the application.
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.
🔥🔥🔥
* feat: initial browser check setup * Feat: add browser check validations (frontend) (#869) * chore(deps): bump fast-loops from 1.1.3 to 1.1.4 (#858) Bumps [fast-loops](https://github.com/robinweser/fast-loops) from 1.1.3 to 1.1.4. - [Commits](https://github.com/robinweser/fast-loops/commits) --- updated-dependencies: - dependency-name: fast-loops dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: add acorn for script parsing * feat: parse script and allow to extract options / import statements * feat: add script validations to its own file * feat: apply browser and script validations to form * chore: fix acorn version --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: add hover/focus-visible interaction to form sidebar buttons (#871) * fix: fix rendering of scripted checks (#872) * feat: add support for browser checks with new form approach * fix: fix rendering browser checks * fix: display browser checks in its own group * fix: include correct form elements in browser checks * feat: add browser check tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Virginia Cepeda <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Virginia Cepeda <[email protected]>
Using the
acorn
library, the script from both the browser and scripted checks is parsed to make sure that it contains thebrowser
import (fromk6/browser
) for browser checks, and validate that it is not present in scripted checks.It also validates the script exports the
options
configuration in browser checks.Frontend part of #864
Browser:
Valid scripts
Not importing browser from
k6/browser
Not exporting options
Scripted check:
Valid script:
Importing browser: