mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-19 04:49:15 +00:00
New design uses lowercase for component title
and specify clicking inside the dropdown
This commit is contained in:
@@ -3,13 +3,19 @@
|
||||
module AdminHelper
|
||||
def toggle_columns(*labels)
|
||||
# open dropdown
|
||||
find("div#columns-dropdown", text: "COLUMNS").click
|
||||
# case insensitive search for "Columns" text
|
||||
find("div#columns-dropdown", text: /columns/i).click
|
||||
|
||||
labels.each do |label|
|
||||
find("div#columns-dropdown div.menu div.menu_item", text: label).click
|
||||
within "div#columns-dropdown" do
|
||||
labels.each do |label|
|
||||
# Convert label to case-insensitive regexp if not one already
|
||||
label = /#{label}/i unless label.is_a?(Regexp)
|
||||
|
||||
find("div.menu div.menu_item", text: /#{label}/i).click
|
||||
end
|
||||
end
|
||||
|
||||
# close dropdown
|
||||
find("div#columns-dropdown", text: "COLUMNS").click
|
||||
find("div#columns-dropdown", text: /columns/i).click
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user