问题描述
限时送ChatGPT账号..我正在尝试使用 laravel dusk 来测试 404 not found 错误.特别是在加载图像时.阅读 laravel dusk 文档后,我发现没有任何断言可以帮助我测试是否发生 404 异常.
I'm trying to use laravel dusk to test for 404 not found error. Specifically when loading an image. After reading the laravel dusk documentation I've found no asserts that could help me test if a 404 exception occurs.
是否有一种很好的方法可以让浏览器测试了解资源是否加载失败或根本不可能?
Is there a good way of getting a browser test to know whether a resource has failed loading or is it simply not possible?
推荐答案
故意无法访问 HTTP 状态代码:
There is intentionally no way to access HTTP status codes:
https://github/laravel/dusk/issues/422
https://github/facebook/php-webdriver/issues/470
这篇关于Laravel 黄昏断言 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论