aboutsummaryrefslogtreecommitdiff
path: root/tests/playwright/test_profiles.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-04-13 20:12:32 +0200
committerDaniel Schadt <kingdread@gmx.de>2023-04-13 20:12:32 +0200
commitbe05f4d4e1729714ffb4c3c37b5dcedcd7c79c26 (patch)
treed1d444cbcb934b85dc59a7e8e18568614a8e2610 /tests/playwright/test_profiles.py
parentc6ba50be205763342992fdddad6ca59755051dd9 (diff)
parent5b051b9f97892784d281556db3d5f8b01671568d (diff)
downloadfietsboek-be05f4d4e1729714ffb4c3c37b5dcedcd7c79c26.tar.gz
fietsboek-be05f4d4e1729714ffb4c3c37b5dcedcd7c79c26.tar.bz2
fietsboek-be05f4d4e1729714ffb4c3c37b5dcedcd7c79c26.zip
Merge branch 'profiles'
Diffstat (limited to 'tests/playwright/test_profiles.py')
-rw-r--r--tests/playwright/test_profiles.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/playwright/test_profiles.py b/tests/playwright/test_profiles.py
new file mode 100644
index 0000000..7e5fb3c
--- /dev/null
+++ b/tests/playwright/test_profiles.py
@@ -0,0 +1,25 @@
+from playwright.sync_api import Page, expect
+
+
+def test_forbidden(page: Page, playwright_helper):
+ john = playwright_helper.john_doe()
+
+ with page.expect_response(lambda resp: resp.status == 403):
+ page.goto(f"/user/{john.id}")
+
+
+def test_profile(page: Page, playwright_helper):
+ playwright_helper.login()
+
+ page.goto("/")
+ page.get_by_role("button", name="User").click()
+ page.get_by_role("link", name="Profile").click()
+
+ expect(page.locator("#profileLength")).to_have_text("0 km")
+ expect(page.locator("#profileUphill")).to_have_text("0 m")
+ expect(page.locator("#profileDownhill")).to_have_text("0 m")
+ expect(page.locator("#profileMovingTime")).to_have_text("0:00:00")
+ expect(page.locator("#profileStoppedTime")).to_have_text("0:00:00")
+ expect(page.locator("#profileMaxSpeed")).to_have_text("0 km/h")
+ expect(page.locator("#profileAvgSpeed")).to_have_text("0 km/h")
+ expect(page.locator("#profileNumberOfTracks")).to_have_text("0")