Closed devversion closed 6 years ago
In general I do expect users to bring in the third_party browser archives on their own.
That said, if you just want to add an additional argument to an existing browser configuration, you can do this with the custom_browser rule:
create a metadata size.json file with the following contents: { "capabilities": {"goog:chromeOptions": {"args": ["--window-size=1024,768"]}}}
Create a custom_browser rule in the BUILD file: custom_browser( name = "my-size-chromium-native", browser = "@io_bazel_rules_webtesting//browsers:chromium-native", metadata = "size.json", }
Thanks for the quick response! - That would be actually a nice solution. Where is the custom_browser
rule defined? It sounds like this rule should be present somewhere?
this was my initial approach
browser(
name = "chromium-browser",
# Extended metadata from the webtesting rules. Since our tests most of the time try
# to measure element boundaries, we need an explicit browser screen resolution.
# https://github.com/bazelbuild/rules_webtesting/blob/master/browsers/BUILD.bazel#L44
metadata = "chromium-config.json",
deps = [
# No access to @io_bazel_rules_webtesting//third_party
]
)
Oops, I haven't added custom_browser to the open source project yet. However, using the metadata file I suggested and putting @io_bazel_rules_webtesting//browsers:chromium-native in the deps of a browser rule should work.
I guess that works. Thanks for the help! Very appreciated
Hey, I realize that there is no official documentation (yet). Though, we want to overwrite the chromium browser by specifying another launch argument.
--window-size=1024,768
I've tried creating my own target that uses the
browser
rule. Unfortunately I cannot just refer to/third_party/chromium
because those are marked as internal.It feels a bit odd if people would need to bring in the whole browser archive on their own, if they just want to overwrite a browser metadata/configuration.
Would it be possible to expose the
third_party
browser archives? or better, is there any official & better solution?