1
+ import time
2
+
1
3
import pytest
2
4
from playwright .sync_api import Page , expect
3
5
12
14
("events" ),
13
15
]
14
16
17
+ # Add a delay to each test to help with playwright race conditions
18
+ @pytest .fixture (autouse = True )
19
+ def slow_down_tests ():
20
+ yield
21
+ time .sleep (2 )
22
+
15
23
16
24
@pytest .mark .parametrize ("url" , routes )
17
25
def test_destination (
18
- page : Page ,
19
- url : str ,
26
+ page : Page ,
27
+ url : str ,
20
28
) -> None :
21
29
"""Test that the destinations page loads with seeded data"""
22
30
# Create a destination
@@ -28,11 +36,11 @@ def test_destination(
28
36
@pytest .mark .parametrize (
29
37
"title, url" ,
30
38
(
31
- ("Acerca de" , "/es/about/" ),
32
- ("Inicio" , "/es/" ),
33
- ("Eventos" , "/es/events/" ),
34
- ("Comunidad" , "/es/community/" ),
35
- ("Conferencias" , "/es/conferences/" ),
39
+ ("Acerca de" , "/es/about/" ),
40
+ ("Inicio" , "/es/" ),
41
+ ("Eventos" , "/es/events/" ),
42
+ ("Comunidad" , "/es/community/" ),
43
+ ("Conferencias" , "/es/conferences/" ),
36
44
),
37
45
)
38
46
def test_headers_in_language (page : Page , title : str , url : str ) -> None :
@@ -57,11 +65,11 @@ def test_switching_lang_es_about(page: Page) -> None:
57
65
@pytest .mark .parametrize (
58
66
"title, url" ,
59
67
(
60
- ("Kutuhusu" , "/sw/about/" ),
61
- ("Nyumbani" , "/sw/" ),
62
- ("Matukio" , "/sw/events/" ),
63
- ("Jumuiya" , "/sw/community/" ),
64
- ("Mikutano" , "/sw/conferences/" ),
68
+ ("Kutuhusu" , "/sw/about/" ),
69
+ ("Nyumbani" , "/sw/" ),
70
+ ("Matukio" , "/sw/events/" ),
71
+ ("Jumuiya" , "/sw/community/" ),
72
+ ("Mikutano" , "/sw/conferences/" ),
65
73
),
66
74
)
67
75
def test_headers_in_sw (page : Page , title : str , url : str ) -> None :
@@ -86,12 +94,12 @@ def test_switching_lang_sw_about(page: Page) -> None:
86
94
@pytest .mark .parametrize (
87
95
"title, url" ,
88
96
(
89
- ("Black Python Devs | Home" , "/" ),
90
- ("Black Python Devs | Blog" , "/blog" ),
91
- ("Black Python Devs | About Us" , "/about/" ),
92
- ("Black Python Devs | Events" , "/events/" ),
93
- ("Black Python Devs | Conferences" , "/conferences/" ),
94
- ("Black Python Devs | Community" , "/community/" ),
97
+ ("Black Python Devs | Home" , "/" ),
98
+ ("Black Python Devs | Blog" , "/blog" ),
99
+ ("Black Python Devs | About Us" , "/about/" ),
100
+ ("Black Python Devs | Events" , "/events/" ),
101
+ ("Black Python Devs | Conferences" , "/conferences/" ),
102
+ ("Black Python Devs | Community" , "/community/" ),
95
103
),
96
104
)
97
105
def test_bpdevs_title_en (page : Page , title : str , url : str ) -> None :
0 commit comments