Sha256: a518043a7f3569f5553b25951f28b2f1da42375b7f3b6034f0be2d2a8a3ab014
Contents?: true
Size: 1.09 KB
Versions: 36
Compression:
Stored size: 1.09 KB
Contents
Then /^there should be a main menu$/ do main_menu.should_not be_nil end Then /^the main menu should contain "([^\"]*)" entries$/ do |entries| entries = entries.split(",").map {|e| e.strip } items = main_menu.get_items.to_a items.should_not be_empty texts = items.map {|item| item.get_text } entries.all? {|e| texts.include?(e)}.should be_true end Then /^the "([^\"]*)" menu should contain a "([^\"]*)" entry$/ do |menu_text, entry_text| items = main_menu.get_items.to_a menu = items.detect {|i| i.text == menu_text} items = menu.get_menu.get_items.to_a menu_texts = items.map{|i| i.text.split("\t").first} menu_texts.detect {|t| t == entry_text}.should_not be_nil end Then /^the menu item "([^\"]*)\|([^\"]*)" should be (active|inactive)$/ do |menu_name, menu_item, active| items = main_menu.get_items.to_a menu = items.detect {|i| i.text == menu_name} items = menu.get_menu.get_items.to_a item = items.detect {|i| i.text.split("\t").first == menu_item } case active when "active" item.enabled.should be_true when "inactive" item.enabled.should be_false end end
Version data entries
36 entries across 36 versions & 1 rubygems