Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Set date with datepicker in project spec

Oliver Günther318c76cc2753
diff --git a/spec/support/pages/projects/index.rb b/spec/support/pages/projects/index.rb
index c10f9a283a7..88109dc9398 100644
--- a/spec/support/pages/projects/index.rb
+++ b/spec/support/pages/projects/index.rb
@@ -103,13 +103,20 @@ module Pages
def set_created_at_filter(human_operator, values)
case human_operator
when 'on', 'less than days ago', 'more than days ago', 'days ago'
- fill_in 'value', with: values.first
+ set_date 'on-date-value-created_at', values.first
when 'between'
- fill_in 'from_value', with: values.first
- fill_in 'to_value', with: values.second
+ set_date 'between-dates-from-value-created_at', values.first
+ set_date 'between-dates-to-value-created_at', values.second
end
end
+ def set_date(id, date_string)
+ datepicker = Components::Datepicker.new
+ find_by_id(id).click
+ datepicker.set_date(date_string)
+ datepicker.save!
+ end
+
def set_custom_field_filter(selected_filter, human_operator, values)
if selected_filter[:'filter-type'] == 'list_optional'
if values.size == 1