-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Reduce boilerplate for browser tests #3310
Comments
Yup, this. Also, for browser-only tests, it is a hassle to write all the scenarios boilerplate.
In case a user configures both, what would happen? Right now, if you configure scenarios and then VUs, it will fail to run; we should probably mimic that behavior. About the proposal: Would it make sense to keep the browser section? export const options = {
browser: {
type: 'chromium',
},
} The main benefit I see is that I can use the same block with/without scenarios and don't have to learn anything new. Also, even if atm we only support browser type, maybe in the future, we move more things in that block (e.g. headless). |
I think we need to be careful which fields we add to the browser options object. If we allowed the setting of In this issue are we also proposing a solution without the |
Totally fair. But the env var is also a terrible DX -> Maybe this one should be a flag?
IMO, it is all part of the same convo. |
I liked @dgzlopes's suggestion: it aligns well with the scenario option definition, and users won't have to learn a new syntax. This part always stays the same, even with or without scenarios: browser: {
type: 'chromium',
}
Even if it's not for headless, we can put |
In addition to the previous suggestion, it could also support: export const options = {
browser: true
} This configuration should use all the default settings for browser testing. |
Currently, as of
v0.46.0
, browser tests require thebrowser.type
option to be set. This can only be defined in a scenario definition such as:Which implies that this is the minimum required [boilerplate] code for a test to be able to use the browser module.
This is OK for a long test, or for tests that already make use of scenarios. But for shorter tests, and especially for "beginner" tests this implies an entry barrier for getting started with the product. E.g.: Requires the users to hassle with scenarios definition, including executor definition, which are more advanced features.
Therefore from the @grafana/k6-browser team we would like to understand and sync on which are the possible options to improve this and reduce the required boilerplate for browser tests.
Without any knowledge in the code implications a possible improvement would be to:
-u
for VUs):The text was updated successfully, but these errors were encountered: