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 to new SubHeader structure

Henriette Darge9423e3c236dd
diff --git a/app/components/settings/project_custom_fields/header_component.html.erb b/app/components/settings/project_custom_fields/header_component.html.erb
index fa0ad4da0e4..421ca0e8b80 100644
--- a/app/components/settings/project_custom_fields/header_component.html.erb
+++ b/app/components/settings/project_custom_fields/header_component.html.erb
@@ -12,6 +12,7 @@
subheader.with_action_button(leading_icon: :plus,
label: t("settings.project_attributes.label_new_section"),
tag: :a,
+ id: "dialog-show-project-custom-field-section-dialog",
href: new_link_admin_settings_project_custom_field_sections_path,
data: { controller: "async-dialog" }) do
t("settings.project_attributes.label_new_section")
diff --git a/modules/budgets/spec/features/budgets/add_budget_spec.rb b/modules/budgets/spec/features/budgets/add_budget_spec.rb
index e3d91121954..998027bb0b8 100644
--- a/modules/budgets/spec/features/budgets/add_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/add_budget_spec.rb
@@ -40,7 +40,7 @@ RSpec.describe "adding a new budget", :js do
it "shows link to create a new budget" do
visit projects_budgets_path(project)
- click_on("Add budget")
+ page.find("[aria-label='Add budget']").click
expect(page).to have_content "New budget"
expect(page).to have_content "Description"
@@ -59,7 +59,7 @@ RSpec.describe "adding a new budget", :js do
it "can switch between them" do
visit projects_budgets_path(project)
- click_on("Add budget")
+ page.find("[aria-label='Add budget']").click
expect(page).to have_content "New budget"
fill_in "Subject", with: "My subject"
diff --git a/modules/costs/spec/features/time_entry/activity_spec.rb b/modules/costs/spec/features/time_entry/activity_spec.rb
index 9055793499b..5cbf6029139 100644
--- a/modules/costs/spec/features/time_entry/activity_spec.rb
+++ b/modules/costs/spec/features/time_entry/activity_spec.rb
@@ -28,7 +28,7 @@
require "spec_helper"
-RSpec.describe "Time entry activity" do
+RSpec.describe "Time entry activity", :js do
shared_let(:admin) { create(:admin) }
let(:project) { create(:project) }
diff --git a/modules/documents/spec/features/document_categories_spec.rb b/modules/documents/spec/features/document_categories_spec.rb
index 676553e55cb..85bfd86cc48 100644
--- a/modules/documents/spec/features/document_categories_spec.rb
+++ b/modules/documents/spec/features/document_categories_spec.rb
@@ -28,7 +28,7 @@
require "spec_helper"
-RSpec.describe "Document categories" do
+RSpec.describe "Document categories", :js do
shared_let(:admin) { create(:admin) }
before do
diff --git a/spec/features/admin/custom_fields/user_custom_field_spec.rb b/spec/features/admin/custom_fields/user_custom_field_spec.rb
index 610faea5166..00879bc6908 100644
--- a/spec/features/admin/custom_fields/user_custom_field_spec.rb
+++ b/spec/features/admin/custom_fields/user_custom_field_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe "User custom fields edit", :js do
it "can create and edit user custom fields (#48725)" do
# Create CF
- click_on "New custom field"
+ page.find("[aria-label='New custom field']").click
new_cf_page.expect_current_path
fill_in "Name", with: "My User CF"
diff --git a/spec/features/admin/settings/work_package_priorities_spec.rb b/spec/features/admin/settings/work_package_priorities_spec.rb
index 78a4e6d4492..47611d246e6 100644
--- a/spec/features/admin/settings/work_package_priorities_spec.rb
+++ b/spec/features/admin/settings/work_package_priorities_spec.rb
@@ -30,7 +30,7 @@
require "spec_helper"
-RSpec.describe "Work package priorities" do
+RSpec.describe "Work package priorities", :js do
shared_let(:admin) { create(:admin) }
before do
diff --git a/spec/features/custom_fields/hierarchy_custom_field_spec.rb b/spec/features/custom_fields/hierarchy_custom_field_spec.rb
index 918cae3f5f4..d5221b6cf1d 100644
--- a/spec/features/custom_fields/hierarchy_custom_field_spec.rb
+++ b/spec/features/custom_fields/hierarchy_custom_field_spec.rb
@@ -47,7 +47,7 @@ RSpec.describe "custom fields of type hierarchy", :js do
custom_field_index_page.visit!
- click_on "New custom field"
+ page.find("[aria-label='New custom field']").click
new_custom_field_page.expect_current_path
hierarchy_name = "Stormtrooper Organisation"
diff --git a/spec/features/versions/create_spec.rb b/spec/features/versions/create_spec.rb
index b910aef96d4..eccd9082b1a 100644
--- a/spec/features/versions/create_spec.rb
+++ b/spec/features/versions/create_spec.rb
@@ -55,7 +55,7 @@ RSpec.describe "version create", js: false do
it "and redirect back to where you started" do
visit project_roadmap_path(project)
- click_on "New version"
+ page.find("[aria-label='New version']").click
fill_in "Name", with: new_version_name
click_on "Create"