Skip to content

Commit

Permalink
Test moving E2E tests to one file
Browse files Browse the repository at this point in the history
  • Loading branch information
uittenbroekrobbert committed Jun 25, 2024
1 parent f14197a commit fba6313
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 34 deletions.
33 changes: 0 additions & 33 deletions tests/e2e/test_change_lang.py

This file was deleted.

34 changes: 33 additions & 1 deletion tests/e2e/test_move_task.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
from playwright.sync_api import Page, expect
from playwright.sync_api import Cookie, Page, expect

from tests.constants import all_statusses, default_task
from tests.database_test_utils import DatabaseTestUtils


def test_change_language(browser: Page) -> Cookie | None:
# TODO: (Christopher) figure out what we want to do with
# pyright complaining about accessing dict values, which
# we ingnore now.
def get_lang_cookie(browser: Page):
for cookie in browser.context.cookies():
if cookie["name"] == "lang": # type: ignore
return cookie
return None

browser.goto("/pages/")

# Upon opening make sure no cookie is set.
lang_cookie = get_lang_cookie(browser)
assert lang_cookie is None

browser.click("#langselect-nl")
expect(browser.locator("#langselect-nl.selected")).to_be_visible()
lang_cookie = get_lang_cookie(browser)
assert lang_cookie["value"] == "nl" # type: ignore

browser.click("#langselect-fy")
expect(browser.locator("#langselect-fy.selected")).to_be_visible()
lang_cookie = get_lang_cookie(browser)
assert lang_cookie["value"] == "fy" # type: ignore

browser.click("#langselect-en")
expect(browser.locator("#langselect-en.selected")).to_be_visible()
lang_cookie = get_lang_cookie(browser)
assert lang_cookie["value"] == "en" # type: ignore


def test_move_task_to_column(browser: Page, db: DatabaseTestUtils) -> None:
"""
Test moving a task in the browser to another column and verify that after a reload
Expand Down

0 comments on commit fba6313

Please sign in to comment.