1
- import time
2
-
3
1
import pytest
4
2
from playwright .sync_api import Page , expect
5
3
16
14
17
15
@pytest .mark .parametrize ("url" , routes )
18
16
def test_destination (
19
- page : Page ,
20
- url : str ,
17
+ page : Page ,
18
+ url : str ,
21
19
) -> None :
22
20
"""Test that the destinations page loads with seeded data"""
23
21
# Create a destination
24
22
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
26
24
assert response .url .endswith (f"/{ url } /" ) # Load the index.html
27
25
28
26
29
27
@pytest .mark .parametrize (
30
28
"title, url" ,
31
29
(
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/" ),
36
34
),
37
35
)
38
36
def test_headers_in_language (page : Page , title : str , url : str ) -> None :
@@ -57,10 +55,10 @@ def test_switching_lang_es_about(page: Page) -> None:
57
55
@pytest .mark .parametrize (
58
56
"title, url" ,
59
57
(
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/" ),
64
62
),
65
63
)
66
64
def test_headers_in_sw (page : Page , title : str , url : str ) -> None :
@@ -85,11 +83,11 @@ def test_switching_lang_sw_about(page: Page) -> None:
85
83
@pytest .mark .parametrize (
86
84
"title, url" ,
87
85
(
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/" ),
93
91
),
94
92
)
95
93
def test_bpdevs_title_en (page : Page , title : str , url : str ) -> None :
0 commit comments