无法获得基本的硒 +水豚 + Cucumber 在 Rails 3 上工作
好的,我一直在使用 selenium
等 rails 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
韦尔普,找到答案了。我忽略了安装 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.