im having some issue trying to create a reusable step definition using siteprism let say feature file is
Given that im on the site
Then i should see a "stack over" text
And i should see a "ask" text
And i should see a "question" text
then on my step definition will be
I want to have arg1 to be dynamic and this logic will check if its true
Then (/^i should see a "(.*?)" text$/) do |arg1|
@common_page = CommonLib.new
@ref = arg1.gsub(/\s+/,'')
expect(@common_page.*@ref*.text).to eq (arg1)
end
Then on my page def will be
class CommonLib < siteprism::page
element :stackover, "#text_header"
element :ask, "#text_ask"
element :question, "#text_question"
the issue im having is this expect(@common_page.@ref.text).to eq (arg1)
the mapping is wrong @ref need to use the data it got like 'stackover', 'ask' and 'question' and map in the CommonLib page def