Skip to content

Commit

Permalink
[ci][py] Enabled browser tests
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Nov 14, 2024
1 parent 1492a3a commit 6819795
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ jobs:
- browser: safari
os: macos
- browser: chrome
os: macos
os: ubuntu
- browser: edge
os: ubuntu
- browser: firefox
os: ubuntu
with:
name: Integration Tests (${{ matrix.browser }}, ${{ matrix.os }})
browser: ${{ matrix.browser }}
Expand Down
27 changes: 16 additions & 11 deletions py/test/selenium/webdriver/marionette/mn_options_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ def test_we_can_pass_options(self, driver, pages):
class TestUnit:
def test_ctor(self):
opts = Options()
assert opts._binary is None
assert not opts._preferences
assert opts.binary_location == ""
assert opts._preferences == {"remote.active-protocols": 3}
assert opts._profile is None
assert not opts._arguments
assert isinstance(opts.log, Log)

def test_binary(self):
opts = Options()
assert opts.binary is None
assert opts.binary_location == ""

other_binary = FirefoxBinary()
assert other_binary != opts.binary
assert other_binary != opts.binary_location
opts.binary = other_binary
assert other_binary == opts.binary
assert other_binary._start_cmd == opts.binary_location

path = "/path/to/binary"
opts.binary = path
Expand All @@ -63,16 +63,16 @@ def test_binary(self):

def test_prefs(self):
opts = Options()
assert len(opts.preferences) == 0
assert len(opts.preferences) == 1
assert isinstance(opts.preferences, dict)

opts.set_preference("spam", "ham")
assert len(opts.preferences) == 1
opts.set_preference("eggs", True)
assert len(opts.preferences) == 2
opts.set_preference("eggs", True)
assert len(opts.preferences) == 3
opts.set_preference("spam", "spam")
assert len(opts.preferences) == 2
assert opts.preferences == {"spam": "spam", "eggs": True}
assert len(opts.preferences) == 3
assert opts.preferences == {"eggs": True, "remote.active-protocols": 3, "spam": "spam"}

def test_profile(self, tmpdir_factory):
opts = Options()
Expand All @@ -99,7 +99,12 @@ def test_arguments(self):
def test_to_capabilities(self):
opts = Options()
firefox_caps = DesiredCapabilities.FIREFOX.copy()
firefox_caps.update({"pageLoadStrategy": PageLoadStrategy.normal})
firefox_caps.update(
{
"pageLoadStrategy": PageLoadStrategy.normal,
"moz:firefoxOptions": {"prefs": {"remote.active-protocols": 3}},
}
)
assert opts.to_capabilities() == firefox_caps

profile = FirefoxProfile()
Expand Down

0 comments on commit 6819795

Please sign in to comment.