24 lines
810 B
Python
24 lines
810 B
Python
"""Tests for the login."""
|
|
|
|
from selenium.webdriver.remote.webdriver import WebDriver
|
|
from tests.integration.types import AdminServer
|
|
|
|
from .helpers.auth import login
|
|
from .helpers import wait_helpers
|
|
|
|
def test_login(ui_admin_server: AdminServer, driver: WebDriver) -> None:
|
|
"""Test login."""
|
|
driver = login(ui_admin_server, driver)
|
|
print(driver.current_url)
|
|
assert driver.current_url.endswith("/dashboard")
|
|
|
|
|
|
def test_logout(ui_admin_server: AdminServer, driver: WebDriver) -> None:
|
|
"""Test logout function."""
|
|
admin_url = ui_admin_server[0]
|
|
driver = login(ui_admin_server, driver)
|
|
assert driver.current_url.endswith("/dashboard")
|
|
driver.get(admin_url + "/logout")
|
|
wait_helpers.wait_until_url_contains(driver, "/login")
|
|
assert driver.current_url.endswith("/login")
|