@@ -129,6 +129,7 @@ def test_bpdevs_title_en(page_url: tuple[Page, str], title: str, url: str) -> No
129
129
expect (page ).to_have_title (f"Black Python Devs | { title } " )
130
130
131
131
axe = Axe ()
132
+ # results = axe.run(page)
132
133
results = axe .run (page , options = {"runOnly" : ["wcag2a" , "wcag2aa" ]})
133
134
134
135
assert (
@@ -143,6 +144,7 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None:
143
144
expect (
mailto ).
to_have_attribute (
"href" ,
"mailto:[email protected] " )
144
145
145
146
axe = Axe ()
147
+ # results = axe.run(page)
146
148
results = axe .run (page , options = {"runOnly" : ["wcag2a" , "wcag2aa" ]})
147
149
148
150
assert (
@@ -189,20 +191,20 @@ def test_page_blog_posts(
189
191
page , live_server_url = page_url
190
192
entry_stem , frontmatter = post
191
193
url = f"{ live_server_url } /{ entry_stem } /"
192
- page .goto (url )
194
+
195
+ # try:
196
+ # Increased timeout and added wait_until="networkidle"
197
+ page .goto (url , timeout = 60000 , wait_until = "networkidle" )
198
+
199
+ # More robust waiting for the meta description
193
200
page .wait_for_selector (
194
- 'meta[name="description"]' ,
195
- timeout = 5000 ,
196
- state = "attached" ,
197
- )
198
- assert (
199
- page .locator ('meta[name="description"]' ).get_attribute ("content" )
200
- == frontmatter ["description" ]
201
- )
201
+ 'meta[name="description"]' ,
202
+ timeout = 10000 ,
203
+ state = "attached" ,
204
+ )
205
+
202
206
203
207
axe = Axe ()
204
208
results = axe .run (page , options = {"runOnly" : ["wcag2a" , "wcag2aa" ]})
205
209
206
- assert (
207
- len (results ["violations" ]) == 0
208
- ), f"Accessibility violations found: { results ['violations' ]} "
210
+ assert (len (results ["violations" ]) == 0 ), f"Accessibility violations found: { results ['violations' ]} "
0 commit comments