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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Get tests running by waiting for the controller to be loaded before starting to change things. Further some selectors have been fixed
Henriette Darge19dacbae6b74
diff --git a/app/components/work_packages/date_picker/dialog_content_component.html.erb b/app/components/work_packages/date_picker/dialog_content_component.html.erbindex 07abe2992cd..a847b3656ad 100644--- a/app/components/work_packages/date_picker/dialog_content_component.html.erb+++ b/app/components/work_packages/date_picker/dialog_content_component.html.erb@@ -55,13 +55,15 @@collection.with_component(Primer::Alpha::Dialog::Footer.new) docomponent_collection do |footer|- footer.with_component(Primer::ButtonComponent.new(data: { action: "work-packages--date-picker--preview#cancel" })) do+ footer.with_component(Primer::ButtonComponent.new(data: { action: "work-packages--date-picker--preview#cancel" },+ test_selector: "op-datepicker-modal--action")) doI18n.t("button_cancel")endfooter.with_component(Primer::ButtonComponent.new(scheme: :primary,type: :submit,form: DIALOG_FORM_ID,+ test_selector: "op-datepicker-modal--action",disabled: !schedulable?)) doI18n.t("button_save")enddiff --git a/spec/support/components/datepicker/datepicker.rb b/spec/support/components/datepicker/datepicker.rbindex 01ef8d1f311..73de18bbcc5 100644--- a/spec/support/components/datepicker/datepicker.rb+++ b/spec/support/components/datepicker/datepicker.rb@@ -45,10 +45,15 @@ module Componentsdef expect_visibleexpect(container).to have_css(".flatpickr-calendar .flatpickr-current-month", wait: 10)++ # For whatever reason, the stimulus controller in the WorkPackage Datepicker needs some time to be loaded.+ # So please, do not remove this line.+ wait_for_network_idleenddef expect_not_visibleexpect(container).to have_no_css(".flatpickr-calendar .flatpickr-current-month", wait: 10)+ wait_for_network_idleend##diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rbindex b54d31319c5..f04c1596244 100644--- a/spec/support/components/datepicker/work_package_datepicker.rb+++ b/spec/support/components/datepicker/work_package_datepicker.rb@@ -20,28 +20,23 @@ module Components### Expect durationdef expect_duration(value)- value =- if value.is_a?(Regexp)- value- elsif value.nil? || value == ""- ""- else- I18n.t("js.units.day", count: value)- end+ if value.nil? || value == ""+ value = ""+ endexpect(container).to have_field("work_package[duration]", with: value, wait: 10)enddef milestone_date_field- container.find_field "date"+ container.find_field "work_package[start_date]"enddef start_date_field- container.find_field "startDate"+ container.find_field "work_package[start_date]"enddef due_date_field- container.find_field "endDate"+ container.find_field "work_package[due_date]"enddef focus_milestone_date@@ -147,10 +142,6 @@ module Componentscontainer.find_field "scheduling", visible: :allend- def ignore_non_working_days_input- container.find_field "weekdays_only", visible: :all- end-def expect_ignore_non_working_days_disabledexpect(container).to have_field("weekdays_only", disabled: true)end