diff --git a/spec/features/admin/custom_fields/shared_custom_field_expectations.rb b/spec/features/admin/custom_fields/shared_custom_field_expectations.rb index 348426ca31d..78f9a1a585a 100644 --- a/spec/features/admin/custom_fields/shared_custom_field_expectations.rb +++ b/spec/features/admin/custom_fields/shared_custom_field_expectations.rb @@ -35,7 +35,7 @@ RSpec.shared_examples_for "list custom fields" do |type| current_user { user } before do - cf_page.visit_tab type + cf_page.visit_page type end it "has the options in the right order" do @@ -100,7 +100,7 @@ RSpec.shared_examples_for "hierarchy custom fields on index page" do |type| current_user { user } before do - cf_page.visit_tab type + cf_page.visit_page type end context "with an active enterprise token with custom_field_hierarchies feature", with_ee: [:custom_field_hierarchies] do @@ -132,7 +132,7 @@ RSpec.shared_examples_for "expected fields for the custom field's format" do |ty current_user { user } before do - cf_page.visit_tab type + cf_page.visit_page type end def expect_page_to_have_texts(*text) diff --git a/spec/features/admin/custom_fields/time_entries/list_spec.rb b/spec/features/admin/custom_fields/time_entries/list_spec.rb index 6eeeae1a23d..f62fbbad607 100644 --- a/spec/features/admin/custom_fields/time_entries/list_spec.rb +++ b/spec/features/admin/custom_fields/time_entries/list_spec.rb @@ -40,7 +40,7 @@ RSpec.describe "List custom fields edit", :js do current_user { admin } before do - index_cf_page.visit_tab("Spent time") + index_cf_page.visit_page("Spent time") end it "can create and edit list custom fields (#37654)" do diff --git a/spec/support/pages/admin/settings/project_custom_fields/index.rb b/spec/support/pages/admin/settings/project_custom_fields/index.rb index 35dcd02385c..8cb76373c31 100644 --- a/spec/support/pages/admin/settings/project_custom_fields/index.rb +++ b/spec/support/pages/admin/settings/project_custom_fields/index.rb @@ -39,6 +39,12 @@ module Pages "/admin/settings/project_custom_fields" end + def visit_page(customizable_name) + fail "Only Project type is expected" unless customizable_name == "Projects" + + visit! + end + def expect_add_project_attribute_submenu(close_dialog: true) wait_for_network_idle diff --git a/spec/support/pages/custom_fields/index.rb b/spec/support/pages/custom_fields/index.rb index ec56acdf9e9..118e8df099e 100644 --- a/spec/support/pages/custom_fields/index.rb +++ b/spec/support/pages/custom_fields/index.rb @@ -37,10 +37,10 @@ module Pages "/custom_fields" end - def visit_tab(name) + def visit_page(customizable_name) visit! within_test_selector("custom-fields--tab-nav") do - click_on name.to_s + click_on customizable_name.to_s end end