无法获得基本的硒 +水豚 + Cucumber 在 Rails 3 上工作

发布于 2024-10-04 02:01:08 字数 809 浏览 0 评论 0原文

好的,我一直在使用 seleniumrails 2 项目,我已经工作了一段时间了。当我将应用程序移至 Rails 3 时决定重构,我一直在尝试使用 cucumber 和 capybara 建立一个非常基本的 Rails 3 项目,然后运行测试与硒。 (我使用 selenium 是因为我知道我的一些功能测试要求我使用 selenium 才能使正确的 javascript 交互工作。)

我简单地设置了一切,安装了所有 gem,运行了 黄瓜安装程序与--水豚 - 整个九码。然而,当我在测试中包含 @selenium 时,我得到:

When I go to the home page     # features/step_definitions/web_steps.rb:23
  Selenium is not a module (TypeError)
  ./features/step_definitions/web_steps.rb:24:in `/^(?:|I )go to (.+)$/'
  features/access.feature:10:in `When I go to the home page'

为什么我收到这个 Selenium is not a module 错误?我知道这意味着它没有加载,但我已经重复了三遍我的步骤,但不明白为什么会出现这种情况。有人知道我应该检查什么吗?

再说一遍,这是 Rails 3。我在这个项目中使用的是 ruby​​ 1.9.2。

谢谢

Ok, I've been using selenium, etc for rails 2 projects, I've been working on for a while. Deciding to refactor AS I move the app to Rails 3, I've been trying to set up a very basic Rails 3 project with cucumber and capybara, and then run a test with selenium. (I'm using selenium because I know for a fact that some of my feature tests required me to use selenium to get the proper javascript interactions to work.)

I set things up plain jane, have all the gems installed, ran the cucumber installer with the --capybara - the whole nine yards. Yet when I include @selenium in a test I get:

When I go to the home page     # features/step_definitions/web_steps.rb:23
  Selenium is not a module (TypeError)
  ./features/step_definitions/web_steps.rb:24:in `/^(?:|I )go to (.+)$/'
  features/access.feature:10:in `When I go to the home page'

Why am I getting this Selenium is not a module error? I know it means it's not loaded, but I've gone back over my steps three times and can't figure out why this is coming up. Anyone have leads on what I should be checking?

Again, this is rails 3. I'm on ruby 1.9.2 with this project.

Thanks

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

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

发布评论

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

评论(1

我很OK 2024-10-11 02:01:08

韦尔普,找到答案了。我忽略了安装 selenium-client gem 并在 env.rb 中需要 selenium/client 。

现在好多了。只是需要休息一天来思考一下。

Welp, found the answer. I had neglected to install selenium-client gem and require selenium/client in the env.rb.

All better now. Just needed a day off to think it through.

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