Skip to content

Commit 2ee1d31

Browse files
Test: add helper methods for report filtering and date range selection
Signed-off-by: Audrea Cook <[email protected]>
1 parent d08c82f commit 2ee1d31

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/system/reports/index_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,17 @@
108108
click_on "Download Report"
109109
expect(page).to have_text("Downloading Report")
110110
end
111+
def select_report_filter_option(select_id, option)
112+
expect(page).to have_select(select_id, with_options: [option])
113+
find("##{select_id}").select(option)
114+
end
115+
116+
def set_report_date_range(start_date:, end_date:)
117+
fill_in "report_start_date", with: start_date
118+
fill_in "report_end_date", with: end_date
119+
end
120+
121+
def choose_report_radio_option(field_name, value)
122+
find("input[name=\"report[#{field_name}]\"][value=\"#{value}\"]", visible: :all).click
111123
end
112124
end

0 commit comments

Comments
 (0)