Reputation: 47
Why can't I load a PageObject file in the rails console? I tried and got the following.
require "/Users/karanbirtoor/src/my_app/test/page_objects/admin_page.rb"
LoadError: cannot load such file -- selenium_helper
from /Users/karanbirtoor/.rvm/gems/ruby-1.9.3-p484@my_app_rails3/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require'
Upvotes: 0
Views: 212
Reputation: 18037
You're probably just not getting the objects you need required beforehand. Your AdminPage object seems to include SeleniumHelper, which isn't yet required/defined in your rails console's environment. I'm betting the Selenium gem is only required in the test environment (based on its location in your Gemfile). Plus you likely have other requires happening in your test_helper.rb file.
Try this:
> rails console -e test
Then, in console
> require_relative "test/test_helper"
> require_relative "test/page_objects/admin_page"
> AdminPage
Upvotes: 1