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

fix more tests

Klaus Zandersbcf9c87af549
diff --git a/modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb b/modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb
index 4c51943a37c..4c0aeb1264a 100644
--- a/modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb
+++ b/modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb
@@ -100,7 +100,7 @@ RSpec.describe "My spent time widget with a negative time zone", :js,
aggregate_failures("when clicking a day, time entry day is set to the day clicked (Thursday)") do
find(".fc-day-thu .te-calendar--add-entry", visible: false).click
- time_logging_modal.has_field_with_value "spentOn", thursday.iso8601
+ time_logging_modal.has_field_with_value "spent_on", thursday.iso8601
end
end
end
diff --git a/modules/reporting/spec/features/support/components/cost_reports_base_table.rb b/modules/reporting/spec/features/support/components/cost_reports_base_table.rb
index 71a9c05cea2..965aab2b636 100644
--- a/modules/reporting/spec/features/support/components/cost_reports_base_table.rb
+++ b/modules/reporting/spec/features/support/components/cost_reports_base_table.rb
@@ -64,13 +64,15 @@ module Components
time_logging_modal.is_visible true
time_logging_modal.change_hours(hours)
- # time_logging_modal.activity_input_disabled_because_work_package_missing? false
+ time_logging_modal.activity_input_disabled_because_work_package_missing? false
time_logging_modal.submit
- SeleniumHubWaiter.wait
- # TODO: ensure page reload ... should happen automatically and does so in the browser
- page.refresh
+ if using_cuprite?
+ wait_for_reload
+ else
+ sleep 1
+ end
expect_action_icon "edit", row
expect_value l_hours(hours), row
@@ -90,9 +92,13 @@ module Components
def delete_entry(row)
SeleniumHubWaiter.wait
- page.find("#{row_selector(row)} .icon-delete").click
- page.driver.browser.switch_to.alert.accept
+ if using_cuprite?
+ accept_confirm { page.find("#{row_selector(row)} .icon-delete").click }
+ else
+ page.find("#{row_selector(row)} .icon-delete").click
+ page.driver.browser.switch_to.alert.accept
+ end
end
private
diff --git a/modules/reporting/spec/features/update_entries_spec.rb b/modules/reporting/spec/features/update_entries_spec.rb
index 15322f32c0a..ceb318a6efa 100644
--- a/modules/reporting/spec/features/update_entries_spec.rb
+++ b/modules/reporting/spec/features/update_entries_spec.rb
@@ -30,7 +30,7 @@ require "spec_helper"
require_relative "support/pages/cost_report_page"
require_relative "support/components/cost_reports_base_table"
-RSpec.describe "Updating entries within the cost report", :js, :selenium do
+RSpec.describe "Updating entries within the cost report", :js do
let(:project) { create(:project) }
let(:user) { create(:admin, member_with_permissions: { project => %i[work_package_assigned] }) }
let(:work_package) { create(:work_package, project:) }
diff --git a/spec/features/support/components/time_logging_modal.rb b/spec/features/support/components/time_logging_modal.rb
index d3d33c90927..99df8baf158 100644
--- a/spec/features/support/components/time_logging_modal.rb
+++ b/spec/features/support/components/time_logging_modal.rb
@@ -64,9 +64,8 @@ module Components
end
def has_field_with_value(field, value)
- puts "*" * 100, modal_container.native["innerHTML"], "*" * 100
within modal_container do
- expect(page).to have_field "input#time_entry_#{field}", with: value, visible: :all
+ expect(page).to have_field "time_entry_#{field}", with: value, visible: :all
end
end
@@ -117,10 +116,14 @@ module Components
def activity_input_disabled_because_work_package_missing?(missing)
if missing
- expect(modal_container).to have_field "input#time_entry_activity_id:disabled",
- with: I18n.t("placeholder_activity_select_work_package_first")
+ expect(modal_container).to have_field "time_entry_activity_id",
+ with: I18n.t("placeholder_activity_select_work_package_first"),
+ visible: :all,
+ disabled: true
else
- expect(modal_container).to have_field "input#time_entry_activity_id:enabled", visible: :all
+ expect(modal_container).to have_field "time_entry_activity_id",
+ visible: :all,
+ disabled: false
end
end