diff --git a/spec/features/work_packages/details/inplace_editor/description_editor_spec.rb b/spec/features/work_packages/details/inplace_editor/description_editor_spec.rb index 4bacb48e8f..49bd4efc7e 100644 --- a/spec/features/work_packages/details/inplace_editor/description_editor_spec.rb +++ b/spec/features/work_packages/details/inplace_editor/description_editor_spec.rb @@ -22,10 +22,13 @@ describe 'description inplace editor', js: true do before do allow(User).to receive(:current).and_return(user) - visit project_work_packages_path(project) + "/#{work_package.id}/overview" - end + visit project_work_packages_path(project) + + ensure_wp_table_loaded - include_context 'ensure wp table loaded' + row = page.find("#work-package-#{work_package.id}") + row.double_click + end context 'in read state' do it 'renders the correct text' do diff --git a/spec/features/work_packages/details/inplace_editor/shared_contexts.rb b/spec/features/work_packages/details/inplace_editor/shared_contexts.rb index 6630faea2a..c3b698104e 100644 --- a/spec/features/work_packages/details/inplace_editor/shared_contexts.rb +++ b/spec/features/work_packages/details/inplace_editor/shared_contexts.rb @@ -41,11 +41,9 @@ end # Ensure the page is completely loaded before the spec is run. # The status filter is loaded very late in the page setup. -shared_context 'ensure wp table loaded' do - before do - expect(page).to have_selector('#operators-status_id', visible: false), - 'Work package table page was not loaded in time' - end +def ensure_wp_table_loaded + expect(page).to have_selector('#operators-status_id', visible: false), + 'Work package table page was not loaded in time' end shared_context 'ensure wp details pane update done' do diff --git a/spec/features/work_packages/details/inplace_editor/subject_editor_spec.rb b/spec/features/work_packages/details/inplace_editor/subject_editor_spec.rb index 9e1c8daaa5..dd43bcdab7 100644 --- a/spec/features/work_packages/details/inplace_editor/subject_editor_spec.rb +++ b/spec/features/work_packages/details/inplace_editor/subject_editor_spec.rb @@ -15,10 +15,13 @@ describe 'subject inplace editor', js: true do before do allow(User).to receive(:current).and_return(user) - visit project_work_packages_path(project) + "/#{work_package.id}/overview" - end + visit project_work_packages_path(project) + + ensure_wp_table_loaded - include_context 'ensure wp table loaded' + row = page.find("#work-package-#{work_package.id}") + row.double_click + end context 'in read state' do it 'has correct content' do