Skip to content
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

Evaluate Browser params #856

Closed
Tracked by #854
ka3de opened this issue Apr 17, 2023 · 3 comments
Closed
Tracked by #854

Evaluate Browser params #856

ka3de opened this issue Apr 17, 2023 · 3 comments
Assignees
Labels
team/k6browser To distinguish the issue on project boards.

Comments

@ka3de
Copy link
Collaborator

ka3de commented Apr 17, 2023

Look through the existing browser configurable parameters and evaluate:

  1. Which will be useful for the user
  2. Which will work locally and also when connected to a remote browser.
  3. What is the best mean through which specify the parameter (env variable, test script options).

Related: #857

@ka3de ka3de changed the title Look through the existing browser configurable params and evaluate the ones that 1) we definitely think will be useful for the user 2) that will work locally and to a remotely connected browser instance. Evaluate Browser params Apr 17, 2023
@ka3de ka3de self-assigned this Apr 17, 2023
@ka3de ka3de added the team/k6browser To distinguish the issue on project boards. label Apr 17, 2023
@ka3de
Copy link
Collaborator Author

ka3de commented Apr 18, 2023

Browser parameters have been reevaluated with the following criteria:

  • Only the options that have an actual effect in the test execution will be supported as test script options. These are options that can have an impact in the correctness of the test and therefore make sense that are "hardcoded" in the actual script definition.
  • Every option that is "circumstantial" / "environment related" will be supported as environment variable only.
  • Every option that has low value or is currently unimplemented will be removed and not supported by now.

Following this criteria, the proposed browser options modifications are:

Option Description Supported
slowMo Slow down input actions and navigation by the specified time e.g. 500ms. script
timeout Default timeout to use for various actions and navigation. script
headless Show browser GUI or not. env
debug All CDP messages and internal fine grained logs will be logged if set to true. env
args Extra command line arguments to include when launching browser process. env
ignoreDefaultArgs Ignore any of the default arguments included when launching the browser process. env
executablePath Override search for browser executable in favor of specified absolute path. env
cdpWSURL Specifies the CDP WS URL to connect to. If set, k6 browser will try to connect to this WS instead of launching a new browser. env
devtools Open up developer tools in the browser by default. remove
env Environment variables to set before launching the browser process. remove
proxy Specify to set browser's proxy configuration. remove

These decisions apply for the current status of k6 browser and can be changed in the future. Especially "promotions" following the path: not supported -> env supported -> script supported.

CC: @ankur22 , @mdcruz, @inancgumus, @andrewslotin.

@mdcruz
Copy link
Contributor

mdcruz commented Apr 18, 2023

For reference, this is how Playwright defines Global setup and teardown https://playwright.dev/docs/test-global-setup-teardown

@ka3de
Copy link
Collaborator Author

ka3de commented Apr 24, 2023

Based on discussions from #857 , the table defined in the previous comment requires some modifications. Specifically in relation with the timeout and slowMo options:

timeout

Currently the timeout option defined at the browser level applied to two different functionalities:

  • Defined the TO to apply for some "browser initialization" actions, such as TO when launching the browser instnace.
  • Defined the default navigation TO. This one could be overwritten at the browserContext and page levels.

We believe that his double purpose is wrong, as a the use cases are quite different and a single value for both does not make sense. At the same time, though, we still believe that defining a TO for the browser initialization actions provides value and is required. Taking this into account our decisions have been:

  • The browser level timeout option will apply only for the browser initialization actions. Not for the default navigation TO.
  • The browser level timeout option will be moved to be defined as an ENV variable, instead of being defined at the script level.
  • The default navigation TO will be set by our own implementation with an initial sensible value. This value will be able to be overwritten at the browserContext and page levels, as it's currently possible.

slowMo

  • slowMo won't be supported at the browser level, and instead will eventually be moved to the browserContext level.

Final definition

Option Description Supported
timeout Default timeout to use for various browser initialization actions and navigation. env
headless Show browser GUI or not. env
debug All CDP messages and internal fine grained logs will be logged if set to true. env
args Extra command line arguments to include when launching browser process. env
ignoreDefaultArgs Ignore any of the default arguments included when launching the browser process. env
executablePath Override search for browser executable in favor of specified absolute path. env
cdpWSURL Specifies the CDP WS URL to connect to. If set, k6 browser will try to connect to this WS instead of launching a new browser. env
slowMo Slow down input actions and navigation by the specified time e.g. 500ms. removed [*]
devtools Open up developer tools in the browser by default. remove
env Environment variables to set before launching the browser process. remove
proxy Specify to set browser's proxy configuration. remove

[*] Eventuallly moved to browserContext level (see #863).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team/k6browser To distinguish the issue on project boards.
Projects
None yet
Development

No branches or pull requests

2 participants