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

attempt to fix flickering spec

ulferts08135aa9c8b5
diff --git a/spec/features/activities/work_package/activities_spec.rb b/spec/features/activities/work_package/activities_spec.rb
index 4e31ea3f652..63bc8f34b49 100644
--- a/spec/features/activities/work_package/activities_spec.rb
+++ b/spec/features/activities/work_package/activities_spec.rb
@@ -582,15 +582,18 @@ RSpec.describe "Work package activity", :js, :with_cuprite do
end
context "when the work package has comments and changesets" do
- before do
- # for some reason the journal is set to the "Anonymous"
- # although the work_package is created by the admin
- # so we need to update the journal to the admin manually to simulate the real world case
- work_package.journals.first.update!(user: admin)
-
- create(:work_package_journal, user: admin, notes: "First comment by admin", journable: work_package, version: 2)
- create(:work_package_journal, user: admin, notes: "Second comment by admin", journable: work_package, version: 3)
+ let(:work_package) do
+ create(:work_package,
+ project:,
+ author: admin,
+ journals: {
+ 5.days.ago => { user: admin },
+ 4.days.ago => { user: admin, notes: "First comment by admin" },
+ 3.days.ago => { user: admin, notes: "Second comment by admin" }
+ }).tap(&:reload)
+ end
+ before do
wp_page.visit!
wp_page.wait_for_activity_tab
end
diff --git a/spec/support/components/work_packages/activities.rb b/spec/support/components/work_packages/activities.rb
index bf555ded007..ceedb06759b 100644
--- a/spec/support/components/work_packages/activities.rb
+++ b/spec/support/components/work_packages/activities.rb
@@ -281,7 +281,10 @@ module Components
check_internal_comment_checkbox if internal
- page.find_test_selector("op-submit-work-package-journal-form").click if save
+ if save
+ page.find_test_selector("op-submit-work-package-journal-form").click
+ wait_for_network_idle
+ end
end
if save
diff --git a/spec/support/pages/work_packages/abstract_work_package.rb b/spec/support/pages/work_packages/abstract_work_package.rb
index aa62bd707c7..06daa745463 100644
--- a/spec/support/pages/work_packages/abstract_work_package.rb
+++ b/spec/support/pages/work_packages/abstract_work_package.rb
@@ -97,6 +97,7 @@ module Pages
end
def wait_for_activity_tab
+ wait_for_network_idle
wait_for { page }.to have_test_selector("op-wp-activity-tab")
# ensure stimulus controller is mounted
expect(page).to have_css('[data-stimulus-controller-connected="true"]')