Created
January 15, 2014 11:28
-
-
Save jmoody/8434632 to your computer and use it in GitHub Desktop.
example of ruby module and cucumber world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this might be too deep a module | |
# 3 is usually the max depth, but in x-platform | |
# i like to mirror the directory structure | |
# you can do what ever you like | |
module YourProjectName | |
module iOS | |
module Helpers | |
module Utils | |
def global_error_messages_view_selector | |
"view class:'GlobalErrorMessagesView" | |
end | |
def assert_validation_error_message(validation_error_message) | |
if element_exists(global_error_messages_view_selector) | |
query(global_error_messages_view_selector + " label marked:#{validation_error_message}") | |
end | |
end | |
end | |
end | |
end | |
# add this to the cucumber World object | |
World(YourProjectName:iOS:Utils) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment