-
Using pytest/seleniumbase, I've added a custom pytest option "--check-links" , just not sure where to plugin sb.assert_no_404_errors() so that its executed after each page load. Similar to:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @webmoskal,
I could potentially improve on that so that it automatically does line-spacing automatically, as seen above. The original has everything on one line. |
Beta Was this translation helpful? Give feedback.
-
Thanks for a super quick response. Was wondering in general, in case I want to also inject Axe (accessibility test tool) for every page load. |
Beta Was this translation helpful? Give feedback.
-
@webmoskal Looks like going to https://fonts.gstatic.com directly does return a 404 error, but since it's a preconnect, there's probably something that doesn't have the browser directly go there without the rest of the URL, or something like that. I'll update the |
Beta Was this translation helpful? Give feedback.
-
@webmoskal See https://github.com/seleniumbase/SeleniumBase/releases/tag/v1.66.10 for improvements to |
Beta Was this translation helpful? Give feedback.
Hi @webmoskal,
--check-js
also detects broken links, and it does it in a way that's must faster thanself.assert_to_404_errors()
. That's why it wasn't implemented in the same way, but more for specific pages within tests to speed things up. Here's a sample output from using--check-js
on https://seleniumbase.io/other/broken_page.html: