Yes, it would be possible. You could:
- Get the path "page1> page2> page3" from the Cucumber step
- Split the path on the "> "
- Iterate through the path to:
- Get the href from the yml file
- Click on that link
For example, this might look like:
Then /i navigate to ".*": ".*"/ do |page_name, path|
path.split('> ').each do |page|
# Determine which link to click (assuming that the yml file gives you respective hrefs)
href = get_link_from_yml(page) # (You will need to create this method)
# Click the link
@browser.link(:href => href).click
end
end