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
Promote `work_packages/table/hierarchy/hierarchy_indent_spec.rb` to cuprite
Aaron Contreras6dc714f97229
diff --git a/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb b/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rbindex 8d1fd8ec6a8..7803954a870 100644--- a/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb+++ b/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb@@ -1,44 +1,41 @@require 'spec_helper'-RSpec.describe 'Work Package table hierarchy and sorting', js: true do- let(:user) { create(:admin) }- let(:project) { create(:project) }+RSpec.describe 'Work Package table hierarchy and sorting', :js, :with_cuprite do+ shared_let(:project) { create(:project) }let(:wp_table) { Pages::WorkPackagesTable.new(project) }let(:hierarchy) { Components::WorkPackages::Hierarchies.new }let(:representation) { Components::WorkPackages::DisplayRepresentation.new }let(:sort_by) { Components::WorkPackages::SortBy.new }- let!(:wp_root) do+ shared_let(:wp_root) docreate(:work_package,project:,subject: 'Parent')end- let!(:wp_child1) do+ shared_let(:wp_child1) docreate(:work_package,project:,parent: wp_root,subject: 'WP child 1')end- let!(:wp_child2) do+ shared_let(:wp_child2) docreate(:work_package,project:,parent: wp_root,subject: 'WP child 2')end- let!(:wp_child3) do+ shared_let(:wp_child3) docreate(:work_package,project:,parent: wp_root,subject: 'WP child 3')end- before do- login_as(user)- end+ shared_current_user { create(:admin) }it 'can indent hierarchies' dowp_table.visit!@@ -62,11 +59,10 @@ RSpec.describe 'Work Package table hierarchy and sorting', js: true do# Remove first childhierarchy.outdent! wp_child1+ wait_for_network_idlehierarchy.expect_hierarchy_at(wp_root, wp_child2)hierarchy.expect_leaf_at(wp_child1, wp_child3)- sleep 1-wp_child1.reloadexpect(wp_child1.parent).to be_nil@@ -96,27 +92,23 @@ RSpec.describe 'Work Package table hierarchy and sorting', js: true dosubject = wp_table.edit_field(wp_child3, :subject)subject.update 'First edit'+ wait_for_network_idlewp_table.expect_and_dismiss_toaster message: 'Successful update.'- # Wait a bit before moving- sleep 2-# Indent last childhierarchy.indent! wp_child3+ wait_for_network_idlewp_table.expect_and_dismiss_toaster message: 'Successful update.'# Expect changedhierarchy.expect_hierarchy_at(wp_root, wp_child2)hierarchy.expect_leaf_at(wp_child1, wp_child3)- # Wait a bit again- sleep 2-subject = wp_table.edit_field(wp_child3, :subject)subject.update 'Second edit'+ wait_for_network_idlewp_table.expect_and_dismiss_toaster message: 'Successful update.'- sleep 2wp_child3.reloadexpect(wp_child3.subject).to eq 'Second edit'expect(wp_child3.parent).to eq wp_child2