I have a module which i have included into my main class:
module GenericPage
def check_url=(page)
puts(page)
end
end
I create a new instance of my class, which I am calling in Cucumber
require_relative '../../../support/helper_methods'
class FindYourDealerPage
include GenericPage
def initialize(browser)
@browser = browser
end
def search_location=(location)
@browser.text_field(:id, 'findDealerSearchField').set(location)
@browser.send_keys :tab, :enter
end
Cucumber:
Given /^I am on the find your dealer page$/ do
@browser.goto 'www.google.com'
@dealer.check_url('www.google.com')
@dealer = FindYourDealerPage.new(@browser)
end
When /^I select a desired preference$/ do
end
Then /^my filtered selection should be submitted$/ do
end
When this is run I get an error NoMethodError: undefined method
check_url' for nil:NilClass` where am I going wrong, forget what is in the method for the moment I just would like to know why I receive this error