Laravel 黄昏断言 404 错误 [英] Laravel dusk asserting for 404 errors

查看:46
本文介绍了Laravel 黄昏断言 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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.com/laravel/dusk/issues/422
https://github.com/facebook/php-webdriver/issues/470

这篇关于Laravel 黄昏断言 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆