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

Better selector for inline create button

Oliver Günther2c71a4ee6d53
diff --git a/app/cells/enumerations/table_cell.rb b/app/cells/enumerations/table_cell.rb
index 0b5f4e57ef8..14e8c58443e 100644
--- a/app/cells/enumerations/table_cell.rb
+++ b/app/cells/enumerations/table_cell.rb
@@ -24,6 +24,7 @@ module Enumerations
link_to new_enumeration_path(type: model.name),
aria: { label: t(:label_enumeration_new) },
class: 'wp-inline-create--add-link',
+ data: { 'qa-selector': "create-enumeration-#{model.name.underscore.dasherize}" },
title: t(:label_enumeration_new) do
op_icon('icon icon-add')
end
diff --git a/modules/costs/spec/features/time_entry/activity_spec.rb b/modules/costs/spec/features/time_entry/activity_spec.rb
index d8d449249d4..427b09bd1d4 100644
--- a/modules/costs/spec/features/time_entry/activity_spec.rb
+++ b/modules/costs/spec/features/time_entry/activity_spec.rb
@@ -39,7 +39,7 @@ describe 'Time entry activity', type: :feature do
it 'supports CRUD' do
visit enumerations_path
- page.all('.wp-inline-create--add-link[title="New enumeration value"]').first.click
+ page.find('[data-qa-selector="create-enumeration-time-entry-activity"]').click
fill_in 'Name', with: 'A new activity'
click_on('Create')