Skip to content

Commit

Permalink
Update tests for own participation species list
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkohei13 committed Jan 17, 2025
1 parent 07c84cf commit 78142cf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests-playwright/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,25 @@ def test_add_edit_participation(browser):
# Back to editing the participation
page.click("#subnavi a")

# Access data download page
# Start listening for a download
# Access own species list
page.click("text=Omat lajit taulukkona")
assert "Olet havainnut 3 lajia" in page.content()
assert "valkorisakasryh" in page.content()

# Access data download
with page.expect_download() as download_info:
# Trigger the download by navigating to the URL or clicking the download link
page.click("text=Omat lajit taulukkona")
page.click("text=Omat lajit CSV-tiedostona")

# Retrieve the download object from the `expect_download` context
download = download_info.value

# Verify the file extension if needed (e.g., ".tsv")
assert download.suggested_filename.endswith(".tsv")

# Back to editing the participation
page.click("#subnavi a")

# Remove taxon in different ways
page.fill("#MX_71896", "") # Editing field directly
page.click('span.clear_date[data-clear-for="MX_72622"]') # Clicking the clear button
Expand Down

0 comments on commit 78142cf

Please sign in to comment.