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
12 changes: 12 additions & 0 deletions tests/test_contact.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import re

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.

re non lo usi, puoi toglierlo, vale anche per tests/test_student_id.py


from playwright.sync_api import Page, expect


def test_contact_email(page: Page) -> None:
# arrange
page.goto("/contact")
contact_email = page.get_by_test_id("contact-email")
expect(contact_email).to_be_visible()
expect(contact_email).to_have_text("student.office@example.com")

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.

c'è una riga vuota in più a fine file, qui e in tests/test_student_id.py

23 changes: 23 additions & 0 deletions tests/test_student_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import re

from playwright.sync_api import Page, expect


def test_student_id(page: Page) -> None:

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.

la PR parte dalla main del tuo fork, la prossima volta puoi creare una branch per ogni esercizio, così la main resta uguale a quella del repo

# arrange
page.goto("/login")
page.get_by_label("Username").fill("mario")
page.get_by_label("Password").fill("password123")

# act
page.get_by_role("button", name="Log in").click()

# assert
expect(page.get_by_role("heading", name="Welcome, Mario")).to_be_visible()

page.goto("/profile")

student_id = page.get_by_test_id("profile-student-id")
expect(student_id).to_be_visible()
expect(student_id).to_have_text("1000012345")

Loading