diff --git a/tests/test_webui.py b/tests/test_webui.py index e5a451fd..fcd6d33a 100755 --- a/tests/test_webui.py +++ b/tests/test_webui.py @@ -9,31 +9,11 @@ """Glances unitary tests suite for the WebUI.""" -import pytest -from selenium import webdriver -from selenium.webdriver import FirefoxOptions -from selenium.webdriver.firefox.service import Service as FirefoxService - -@pytest.fixture() -def firefox_browser(): - """Init Firefox browser.""" - opts = FirefoxOptions() - opts.add_argument("--headless") - srv = FirefoxService(executable_path="/snap/bin/geckodriver") - driver = webdriver.Firefox(options=opts, service=srv) - - # Yield the WebDriver instance - driver.implicitly_wait(10) - yield driver - - # Close the WebDriver instance - driver.quit() - - -def test_title(firefox_browser): +def test_title(glances_webserver, firefox_browser): """ - Test the title of the Python.org website + Test the title of the Glances home page """ - firefox_browser.get("https://www.python.org") - assert firefox_browser.title == "Welcome to Python.org" + assert glances_webserver is not None + firefox_browser.get("http://localhost:61234") + assert "Glances" in firefox_browser.title