Rails、Cucumber:外部重定向到另一个域

发布于 2024-09-27 10:51:58 字数 572 浏览 0 评论 0原文

我有黄瓜功能

...
Given I am on my domain page
When I press "send data to external domain"
Then I should be on the externel domain page
...

在生产和开发环境中“我的域页面”(www.example.com/mydomainpage)将用户重定向到“外部域页面”(www.externaldomain.com/page)。但是在测试环境中,cucumber 切断了 url 的域部分:

Redirected to http://www.externaldomain.com/page
Completed 302 Found in 17895ms


Started GET "/page" for 127.0.0.1 at 2010-10-11 19:06:48 +0400
  SQL (72.0ms)  ROLLBACK

是否可以设置 cucumber 重定向到各种域,而不仅仅是当前服务器域?

PS 黄瓜 + 水豚 + Rails + Rspec

I have cucumber feature

...
Given I am on my domain page
When I press "send data to external domain"
Then I should be on the externel domain page
...

In production and development enviroments "My domain page" (www.example.com/mydomainpage) redirects user to "external domain page" (www.externaldomain.com/page). But in test enviroment cucumber cut off domain part of url:

Redirected to http://www.externaldomain.com/page
Completed 302 Found in 17895ms


Started GET "/page" for 127.0.0.1 at 2010-10-11 19:06:48 +0400
  SQL (72.0ms)  ROLLBACK

Is it possible to set up cucumber to redirect to various domain, not only current server domain?

P.S. Cucumber + Capybara + Rails + Rspec

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

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

发布评论

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

评论(1

客…行舟 2024-10-04 10:51:58

有很多方法可以做到这一点(Selenium、Culerity 等)。最好的方法是使用 capybara-mechanize,这是具有远程请求支持的 Capybara 的 RackTest 驱动程序。这是非常酷的工具!

There are many ways to do such thing (Selenium, Culerity and etc...). Best way is using capybara-mechanize, the RackTest driver for Capybara with remote request support. This is very cool tool!

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