Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/contact_email.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from playwright.sync_api import Page, expect

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest esegue solo i file che si chiamano test_*.py, quindi questo scenario non parte mai, puoi rinominarlo in tests/test_contact_email.py

from pytest_bdd import given, parsers, scenarios, then

scenarios("features/contact.feature")


@given("I am on the contact page")
def open_contact_page(page: Page) -> None:
page.goto("/contact")


@then(parsers.parse('I see the contact email "{email}"'))
def verify_contact_email(page: Page, email: str) -> None:
contact_email = page.get_by_test_id("contact-email")

expect(contact_email).to_have_text(email)
expect(contact_email).to_have_attribute("href", f"mailto:{email}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manca il newline a fine file, anche in tests/features/contact.feature

5 changes: 5 additions & 0 deletions tests/features/contact.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Contact information

Scenario: View the student office email
Given I am on the contact page
Then I see the contact email "student.office@example.com"
Loading