-
Notifications
You must be signed in to change notification settings - Fork 19
Add browser_launch_opts config option #149
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
12bb360
Add browser_launch_opts config option
srcrip c8c2dac
Fix misleading test comment
srcrip c3afa2e
Add stronger test proving browser_launch_opts flags work
srcrip 7937ff6
Use pop! since NimbleOptions provides default
srcrip fec6545
Use keyword_list type since Keyword.merge is used
srcrip 545e311
Remove this alltogether
srcrip f200633
Use evaluate
srcrip ce0730f
Revert README changes
srcrip 1683010
Format
ftes 3563ac9
Skip for websocket
ftes 05c1dc4
Merge branch 'main' into add-browser-launch-opts
ftes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| defmodule PhoenixTest.Playwright.BrowserLaunchOptsTest do | ||
| @moduledoc """ | ||
| Tests that browser_launch_opts are passed through to Playwright. | ||
| """ | ||
|
|
||
| use PhoenixTest.Playwright.Case, | ||
| async: true, | ||
| browser_pool: false, | ||
| browser_launch_opts: [args: ["--disable-background-networking"]] | ||
ftes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| test "launches browser with custom launch opts", %{conn: conn} do | ||
| # Verifies that browser_launch_opts is accepted by the config and doesn't | ||
| # break browser launching. The args are passed through to Playwright. | ||
| conn | ||
| |> visit("/pw/live") | ||
| |> assert_has("h1") | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| defmodule PhoenixTest.Playwright.ConfigTest do | ||
ftes marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| use ExUnit.Case, async: true | ||
|
|
||
| alias PhoenixTest.Playwright.Config | ||
|
|
||
| describe "browser_launch_opts" do | ||
| test "accepts keyword list" do | ||
| config = Config.validate!(browser_launch_opts: [args: ["--disable-gpu"]]) | ||
| assert config[:browser_launch_opts] == [args: ["--disable-gpu"]] | ||
| end | ||
|
|
||
| test "accepts map" do | ||
| config = Config.validate!(browser_launch_opts: %{args: ["--disable-gpu"]}) | ||
| assert config[:browser_launch_opts] == %{args: ["--disable-gpu"]} | ||
| end | ||
|
|
||
| test "defaults to empty list" do | ||
| config = Config.validate!([]) | ||
| assert config[:browser_launch_opts] == [] | ||
| end | ||
|
|
||
| test "is included in setup_all_keys" do | ||
| assert :browser_launch_opts in Config.setup_all_keys() | ||
| end | ||
| end | ||
| end | ||
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.
Uh oh!
There was an error while loading. Please reload this page.