1- import time
2-
31import pytest
42from playwright .sync_api import Page , expect
53
1614
1715@pytest .mark .parametrize ("url" , routes )
1816def test_destination (
19- page : Page ,
20- url : str ,
17+ page : Page ,
18+ url : str ,
2119) -> None :
2220 """Test that the destinations page loads with seeded data"""
2321 # Create a destination
2422 response = page .goto (f"{ live_server_url } /{ url } " )
25- page . on ( "response" , lambda response : expect ( response .status ). to_equal ( 200 ))
23+ assert response .status == 200
2624 assert response .url .endswith (f"/{ url } /" ) # Load the index.html
2725
2826
2927@pytest .mark .parametrize (
3028 "title, url" ,
3129 (
32- ("Acerca de" , "/es/about/" ),
33- ("Inicio" , "/es/" ),
34- ("Eventos" , "/es/events/" ),
35- ("Comunidad" , "/es/community/" ),
30+ ("Acerca de" , "/es/about/" ),
31+ ("Inicio" , "/es/" ),
32+ ("Eventos" , "/es/events/" ),
33+ ("Comunidad" , "/es/community/" ),
3634 ),
3735)
3836def test_headers_in_language (page : Page , title : str , url : str ) -> None :
@@ -57,10 +55,10 @@ def test_switching_lang_es_about(page: Page) -> None:
5755@pytest .mark .parametrize (
5856 "title, url" ,
5957 (
60- ("Kutuhusu" , "/sw/about/" ),
61- ("Nyumbani" , "/sw/" ),
62- ("Matukio" , "/sw/events/" ),
63- ("Jumuiya" , "/sw/community/" ),
58+ ("Kutuhusu" , "/sw/about/" ),
59+ ("Nyumbani" , "/sw/" ),
60+ ("Matukio" , "/sw/events/" ),
61+ ("Jumuiya" , "/sw/community/" ),
6462 ),
6563)
6664def test_headers_in_sw (page : Page , title : str , url : str ) -> None :
@@ -85,11 +83,11 @@ def test_switching_lang_sw_about(page: Page) -> None:
8583@pytest .mark .parametrize (
8684 "title, url" ,
8785 (
88- ("Black Python Devs | Home" , "/" ),
89- ("Black Python Devs | Blog" , "/blog" ),
90- ("Black Python Devs | About Us" , "/about/" ),
91- ("Black Python Devs | Events" , "/events/" ),
92- ("Black Python Devs | Community" , "/community/" ),
86+ ("Black Python Devs | Home" , "/" ),
87+ ("Black Python Devs | Blog" , "/blog" ),
88+ ("Black Python Devs | About Us" , "/about/" ),
89+ ("Black Python Devs | Events" , "/events/" ),
90+ ("Black Python Devs | Community" , "/community/" ),
9391 ),
9492)
9593def test_bpdevs_title_en (page : Page , title : str , url : str ) -> None :
0 commit comments