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

attempt to stabilize specs

ulferts17e4886f8843
diff --git a/modules/reporting/spec/features/custom_fields_spec.rb b/modules/reporting/spec/features/custom_fields_spec.rb
index beaac665c22..a3b76624f06 100644
--- a/modules/reporting/spec/features/custom_fields_spec.rb
+++ b/modules/reporting/spec/features/custom_fields_spec.rb
@@ -61,6 +61,8 @@ describe 'Custom fields reporting', type: :feature, js: true do
cf.custom_options.find { |co| co.value == str }.try(:id)
end
+ current_user { user }
+
context 'with multi value cf' do
let!(:custom_field) do
create(:list_wp_custom_field,
@@ -83,8 +85,8 @@ describe 'Custom fields reporting', type: :feature, js: true do
end
before do
- login_as(user)
visit '/cost_reports'
+ sleep(0.1)
end
it 'filters by the multi CF' do
@@ -99,7 +101,7 @@ describe 'Custom fields reporting', type: :feature, js: true do
expect(select).to have_selector('option', text: 'Second option')
select.find('option', text: 'Second option').select_option
- find('#query-icon-apply-button').click
+ click_link 'Apply'
# Expect empty result table
within('#result-table') do
@@ -125,7 +127,7 @@ describe 'Custom fields reporting', type: :feature, js: true do
select 'List CF', from: 'group-by--add-columns'
select 'Work package', from: 'group-by--add-rows'
- find('#query-icon-apply-button').click
+ click_link 'Apply'
# Expect row of work package
within('#result-table') do
@@ -173,8 +175,8 @@ describe 'Custom fields reporting', type: :feature, js: true do
CustomValue.find_by(customized_id: work_package2.id).update_columns(value: 'invalid')
work_package2.reload
- login_as(user)
visit '/cost_reports'
+ sleep(0.1)
end
it 'groups by the raw values when an invalid value exists' do
@@ -186,7 +188,7 @@ describe 'Custom fields reporting', type: :feature, js: true do
select 'Invalid List CF', from: 'group-by--add-columns'
select 'Work package', from: 'group-by--add-rows'
- find('#query-icon-apply-button').click
+ click_link 'Apply'
# Expect row of work package
within('#result-table') do
@@ -208,8 +210,8 @@ describe 'Custom fields reporting', type: :feature, js: true do
let(:initial_custom_values) { { custom_field.id => 'foo' } }
before do
- login_as(user)
visit '/cost_reports'
+ sleep(0.1)
end
it 'groups by a text CF' do
@@ -219,7 +221,7 @@ describe 'Custom fields reporting', type: :feature, js: true do
select 'Text CF', from: 'group-by--add-columns'
select 'Work package', from: 'group-by--add-rows'
- find('#query-icon-apply-button').click
+ click_link 'Apply'
# Expect row of work package
within('#result-table') do