diff options
| author | Daniel Schadt <kingdread@gmx.de> | 2026-01-10 17:15:40 +0100 |
|---|---|---|
| committer | Daniel Schadt <kingdread@gmx.de> | 2026-01-10 17:15:40 +0100 |
| commit | e0cd553185383f3ccf94a04220c64f8cbe610a99 (patch) | |
| tree | 35ac8632b1f61745d85ea5d0646459b5a9002747 /tests/playwright/test_basic.py | |
| parent | 3ba5031a74bc0dc7aab16dc8eb349b871c012a1c (diff) | |
| download | fietsboek-e0cd553185383f3ccf94a04220c64f8cbe610a99.tar.gz fietsboek-e0cd553185383f3ccf94a04220c64f8cbe610a99.tar.bz2 fietsboek-e0cd553185383f3ccf94a04220c64f8cbe610a99.zip | |
upload pictures in playwright testcli-tests
We now have them as test assets, so why not use them.
Diffstat (limited to 'tests/playwright/test_basic.py')
| -rw-r--r-- | tests/playwright/test_basic.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/playwright/test_basic.py b/tests/playwright/test_basic.py index 3ae0f58..19ef8ff 100644 --- a/tests/playwright/test_basic.py +++ b/tests/playwright/test_basic.py @@ -4,7 +4,7 @@ import pytest from playwright.sync_api import Page, expect from sqlalchemy import select -from testutils import load_gpx_asset +from testutils import asset_path, load_gpx_asset from fietsboek import models from fietsboek.models.track import Visibility @@ -60,6 +60,10 @@ def test_upload(page: Page, playwright_helper, tmp_path, dbaccess): page.get_by_role("button", name="Add Tag").click() page.get_by_label("Description").fill("Beschreibung der tollen Tour") + page.locator("#imageSelector").set_input_files( + [asset_path("picture01.jpg"), asset_path("picture02.jpg")], + ) + page.locator(".btn", has_text="Upload").click() # Once we have finished the upload, extract the ID of the track and check @@ -72,6 +76,7 @@ def test_upload(page: Page, playwright_helper, tmp_path, dbaccess): assert track.visibility == Visibility.PUBLIC assert track.text_tags() == {"Tolle Tour"} assert track.description == "Beschreibung der tollen Tour" + assert len(track.images) == 2 def test_edit(page: Page, playwright_helper, dbaccess): |
