I'm writing some tests in calabash, and trying to use the page function inside a helper class.
I have my steps file
Given /^I am on my page$/ do
mypage = page(MyPage)
MyPageHelper.DoMultiActionStep()
end
And my page file
class MyPage < Calabash::ABase
def my_element_exists
element_exists(MY_ELEMENT_QUERY)
end
end
And my helper file
class MyPageHelper
def self.DoMultiActionStep
mypage = page(MyPage)
mypage.do_action_one
mypage.my_element_exists
end
end
When I run this though I get the error
undefined method 'page' for MyPageHelper:Class (NoMethodError)
The page function works fine in the steps file, but it just seems to have a problem being called from the MyPageHelper class. Is it possible to do this? Is there a using statement that I need to add in?
Thanks!