Skip to content

Commit

Permalink
Create first Home test
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Feb 13, 2024
1 parent 6ca66fd commit 0ebdead
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/tests/home_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import re
from playwright.sync_api import Page, expect

def test_home_loads_in_english(page: Page):
page.goto("http://localhost:8000/")

page.get_by_role("heading", name="Welcome to Jandig").click()


def test_example(page: Page) -> None:
page.goto("http://localhost:8000/")
page.locator(".trigger-lang-modal").click()
page.get_by_label("pt-br").check()
page.get_by_role("button", name="Ok").click()
expect(page).to_have_url("http://localhost:8000/")

expect(page.get_by_role("heading")).to_have_text("Bem vindo ao Jandig")
page.locator(".trigger-lang-modal").click()
page.get_by_label("en-us").check()
page.get_by_role("button", name="Ok").click()
expect(page).to_have_url("http://localhost:8000/")
expect(page.get_by_role("heading")).to_have_text("Welcome to Jandig")

0 comments on commit 0ebdead

Please sign in to comment.