Skip to content

Commit

Permalink
fix negative tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s.pirohov committed Jul 22, 2023
1 parent 15bc493 commit d643b34
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests_negative/test_browsers_not_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import pytest
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.edge.service import Service as EdgeService
from selenium.webdriver.firefox.service import Service as FFService

from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
Expand All @@ -22,25 +25,25 @@ def test_brave_not_installed():
option.binary_location = binary_location
driver_path = ChromeDriverManager(chrome_type=ChromeType.BRAVE).install()
with pytest.raises(WebDriverException):
webdriver.Chrome(driver_path, options=option)
webdriver.Chrome(service=ChromeService(driver_path), options=option)


@pytest.mark.skip(reason="it is not stable on CI")
def test_chrome_not_installed():
driver_path = ChromeDriverManager().install()
with pytest.raises(WebDriverException):
webdriver.Chrome(driver_path)
webdriver.Chrome(service=ChromeService(driver_path))


@pytest.mark.skip(reason="it is not stable on CI")
def test_firefox_not_installed():
driver_path = GeckoDriverManager().install()
with pytest.raises(WebDriverException):
webdriver.Firefox(executable_path=driver_path)
webdriver.Firefox(service=FFService(driver_path))


@pytest.mark.skip(reason="it is not stable on CI")
def test_msedge_not_installed():
driver_path = EdgeChromiumDriverManager().install()
with pytest.raises(WebDriverException):
webdriver.Edge(driver_path)
webdriver.Edge(service=EdgeService(driver_path))

0 comments on commit d643b34

Please sign in to comment.