adapt shared custom field expectations to test project attributes too

This commit is contained in:
Ivan Kuchin
2025-12-18 21:32:07 +01:00
parent bf8a13f3d8
commit 0009cfd1df
4 changed files with 12 additions and 6 deletions
@@ -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)
@@ -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
@@ -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
+2 -2
View File
@@ -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