cakephp simpletest webtester 延迟/睡眠功能

发布于 2024-08-03 05:27:44 字数 101 浏览 1 评论 0原文

我正在使用 simpletest 来集成测试我的网站。我需要告诉内部浏览器等待一定的时间(当页面重定向时),然后执行assertText。

有没有简单的方法可以做到这一点?

I am using simpletest to integration test my websites. I need to tell the internal browser to wait for a certain amount of time (while the page redirects), then do assertText.

Is there an easy way to do this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小女人ら 2024-08-10 05:27:44

没有“简单”的方法可以减慢来自 CakeTest 环境的重定向。

为此,您需要进入 SimpleTest 库并在那里进行修改。

以下是所涉及的类的想法:

cake_web_test_case -> web_test_case (web_tester.php) ->; simple_browser (browser.php) ->; simple_user_agent (user_agent.php)

如果您想减慢重定向速度,我建议打开 /vendors/simpletest/user_agent.php 并编辑“function &_fetchWhileRedirected”。只需在 do..while 语句中添加 sleep() ,它就会减慢重定向速度。

希望这有帮助。

There is no "easy" way to slow down the redirects from the CakeTest environment.

To do this, you will need to go into the SimpleTest library and make modifications there.

Here is an idea of the classes involved:

cake_web_test_case -> web_test_case (web_tester.php) -> simple_browser (browser.php) -> simple_user_agent (user_agent.php)

If you want to slow down redirects, I would suggest opening /vendors/simpletest/user_agent.php and edit "function &_fetchWhileRedirected". Just add a sleep() in the do..while statement and it should slow down the redirects.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文