How to know what I can do with step_definitions?

17 views
Skip to first unread message

Brant Merryman

unread,
Mar 12, 2015, 5:26:13 PM3/12/15
to frank-...@googlegroups.com
Hi. I'm wanting to test a MacOS X app under Yosemite using Frank.

Is there a reference anywhere that shows how to perform operations appropriate for a Mac app?

For example, changing the value of a control, determining what window is the front window, etc? Is there anyplace where there might be a set of example frank cucumber tests for Mac? I am seeing examples that say things like:


When /^I navigate to "(.*?)"$/ do |tab_name|
touch "view:'UITabBarButton' marked:'#{tab_name}'"
end


But when I substitute something like this and the simulate_click does not work, but if I leave out 'NSMenuItem' it opens the preferences. Is there a good way to determine why this is and maybe a reference that says what you can and can't do?

When(/^I choose Preferences menu item$/) do
simulate_click "view: 'NSMenuItem' marked:'Preferences…'"
end

Michael Buckley

unread,
Mar 12, 2015, 10:40:12 PM3/12/15
to frank-...@googlegroups.com
Hi, there's a bit of documentation at http://www.testingwithfrank.com/mac.html but you can get more information by reading rubydoc documentation that comes installed with Frank, and is available on the Web at http://www.rubydoc.info/gems/frank-cucumber

Specifically, you want to look at the *Helper classes.

As for your specific menu problem, the problem is that you have a space between "view:" and "'NSMenuItem'". This should work for you.

simulate_click "view:'NSMenuItem' marked:'Preferences…'"

--
You received this message because you are subscribed to the Google Groups "Frank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to frank-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages