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

Adapt tests

Oliver Güntherb0639e2ae7bd
diff --git a/modules/overviews/app/components/overviews/project_custom_fields/side_panel_component.html.erb b/modules/overviews/app/components/overviews/project_custom_fields/side_panel_component.html.erb
index 2eecef3a612..be6b76198ad 100644
--- a/modules/overviews/app/components/overviews/project_custom_fields/side_panel_component.html.erb
+++ b/modules/overviews/app/components/overviews/project_custom_fields/side_panel_component.html.erb
@@ -4,7 +4,7 @@
render(
Primer::OpenProject::SidePanel.new(
spacious: true,
- test_selector: "project-custom-fields-sidebar-async-content"
+ test_selector: "project-custom-fields-sidebar"
)
) do |panel|
available_project_custom_fields_grouped_by_section.each do |project_custom_field_section, project_custom_fields|
diff --git a/modules/overviews/spec/features/navigation_spec.rb b/modules/overviews/spec/features/navigation_spec.rb
index 3d96b0108bd..b2acfddf9e6 100644
--- a/modules/overviews/spec/features/navigation_spec.rb
+++ b/modules/overviews/spec/features/navigation_spec.rb
@@ -46,7 +46,7 @@ RSpec.describe "Navigate to overview", :js do
visit project_path(project)
within "#menu-sidebar" do
- click_link "Overview"
+ click_link "Project home"
end
within "#content" do
diff --git a/modules/overviews/spec/support/pages/overview.rb b/modules/overviews/spec/support/pages/overview.rb
index 3ad58c2cdac..e62e80ee71b 100644
--- a/modules/overviews/spec/support/pages/overview.rb
+++ b/modules/overviews/spec/support/pages/overview.rb
@@ -39,7 +39,7 @@ module Pages
end
def path
- project_overview_path(project)
+ dashboard_project_overview_path(project)
end
end
end
diff --git a/spec/features/projects/attribute_help_texts_spec.rb b/spec/features/projects/attribute_help_texts_spec.rb
index 79ebfa7061d..ca358777568 100644
--- a/spec/features/projects/attribute_help_texts_spec.rb
+++ b/spec/features/projects/attribute_help_texts_spec.rb
@@ -77,7 +77,7 @@ RSpec.describe "Project attribute help texts", :js do
visit project_path(project)
within "#menu-sidebar" do
- click_link_or_button "Overview"
+ click_link_or_button "Project home"
end
wait_for_network_idle
@@ -88,7 +88,12 @@ RSpec.describe "Project attribute help texts", :js do
visit project_path(project)
within "#menu-sidebar" do
- click_link_or_button "Overview"
+ click_link_or_button "Project home"
+ end
+ wait_for_network_idle
+
+ within_test_selector "overview-tabs" do
+ click_on "Dashboard"
end
wait_for_network_idle
diff --git a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
index e26ff82becc..63cb11e1948 100644
--- a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
+++ b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
@@ -43,9 +43,7 @@ RSpec.describe "Show project custom fields on project overview page", :js do
it "does show the project attributes sidebar" do
overview_page.visit_page
- within ".op-grid-page" do
- expect(page).to have_css("#project-custom-fields-sidebar")
- end
+ expect(page).to have_test_selector "project-custom-fields-sidebar"
end
describe "with correct order and scoping" do
diff --git a/spec/support/pages/projects/show.rb b/spec/support/pages/projects/show.rb
index d25e8b75001..14960b07549 100644
--- a/spec/support/pages/projects/show.rb
+++ b/spec/support/pages/projects/show.rb
@@ -62,18 +62,15 @@ module Pages
end
def within_project_attributes_sidebar(&)
- within "#project-custom-fields-sidebar" do
- expect(page).to have_css("[data-test-selector='project-custom-fields-sidebar-async-content']")
- yield
- end
+ within_test_selector("project-custom-fields-sidebar", &)
end
def within_custom_field_section_container(section, &)
- within("[data-test-selector='project-custom-field-section-#{section.id}']", &)
+ within_test_selector("project-custom-field-section-#{section.id}", &)
end
def within_custom_field_container(custom_field, &)
- within("[data-test-selector='project-custom-field-#{custom_field.id}']", &)
+ within_test_selector("project-custom-field-#{custom_field.id}", &)
end
def expect_no_custom_field(custom_field)
@@ -104,10 +101,7 @@ module Pages
end
def within_life_cycle_sidebar(&)
- within "#project-life-cycle-sidebar" do
- expect(page).to have_css("[data-test-selector='project-life-cycle-sidebar-async-content']")
- yield
- end
+ within_test_selector("project-life-cycle-sidebar-async-content", &)
end
def within_life_cycle_container(life_cycle, &)