Add the ability to set custom Chromium args. And update downloads. #846
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.
Add the ability to set custom Chromium args. And update downloads.
Add custom Chromium args with:
--chromium-arg="ARG,ARG"
.-- (As demonstrated, this can be a comma-separated list)
-- If there's already a specific command-line option for the custom argument that you want to include, you should use the built-in option instead in order to maximize SeleniumBase compatibility. (See help_docs/customizing_test_runs.md and seleniumbase/plugins/pytest_plugin.py for examples of command-line args.) You can also type:
sbase options
on the command-line for a list of the most popular command-line options to use with SeleniumBase.Have
get_downloads_folder()
return the./downloaded_files/
path.-- Note: SeleniumBase has always set the custom downloads folder to be
./downloaded_files/
from the location where tests are launched, however, Chromium Guest Mode (non-headless) does not allow the changing of the default system downloads folder, which is where files go when a browser click initiates a file download. This can be an issue if using BOTH Guest Mode AND clicking to download files, because then those files won't be in SeleniumBase's isolated environment. The good news is thatdownload_file(file_url)
will still always use the custom./downloaded_files/
folder because only browser click-initiated downloads are impacted (and only for headed Guest Mode, IE, and Safari tests). Soget_downloads_folder()
will point to the SeleniumBase custom path one, andget_browser_downloads_folder()
will point to the location where click-initiated browser downloads go. For most browsers (non-guest Chrome, Edge, Firefox) those methods will return the same location (./downloaded_files/
). However, Guest Mode Chrome, Safari, and IE (where the system downloads folder can't be changed) will have two download locations, based on how your test downloads the file. (See examples/test_download_files.py and examples/test_shadow_dom.py for example tests that download files.)