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

Improve board sorting waiting

Oliver Günther297a9a5310ac
diff --git a/modules/boards/spec/features/boards_sorting_spec.rb b/modules/boards/spec/features/boards_sorting_spec.rb
index 7334e9b6b49..cbdcf06432b 100644
--- a/modules/boards/spec/features/boards_sorting_spec.rb
+++ b/modules/boards/spec/features/boards_sorting_spec.rb
@@ -49,24 +49,37 @@ describe 'Work Package boards sorting spec', type: :feature, js: true do
# The currently added board should be at the top
it 'sorts the boards grid and menu based on their names' do
board_page = board_index.create_board action: nil
- board_page.back_to_index
- expect(page.first('[data-qa-selector="boards-table-column--name"]'))
- .to have_text('Unnamed board')
+ retry_block do
+ board_page.back_to_index
+ find('[data-qa-selector="boards-table-column--name"]', text: 'Unnamed board')
+ end
+
+ expect(page.all('[data-qa-selector="boards-table-column--name"]').map(&:text))
+ .to eq ['Unnamed board']
query_menu.expect_menu_entry 'Unnamed board'
board_page = board_index.create_board action: :Version, expect_empty: true
- board_page.back_to_index
+ retry_block do
+ board_page.back_to_index
+ find('[data-qa-selector="boards-table-column--name"]', text: 'Action board (version)')
+ end
- expect(page.first('[data-qa-selector="boards-table-column--name"]'))
- .to have_text('Action board (version)')
+ expect(page.all('[data-qa-selector="boards-table-column--name"]').map(&:text))
+ .to eq ['Action board (version)', 'Unnamed board']
query_menu.expect_menu_entry 'Action board (version)'
board_page = board_index.create_board action: :Status
board_page.back_to_index
- expect(page.first('[data-qa-selector="boards-table-column--name"]'))
- .to have_text('Action board (status)')
+ retry_block do
+ board_page.back_to_index
+ find('[data-qa-selector="boards-table-column--name"]', text: 'Action board (status)')
+ end
+
+ expect(page.all('[data-qa-selector="boards-table-column--name"]').map(&:text))
+ .to eq ['Action board (status)', 'Action board (version)', 'Unnamed board']
+
query_menu.expect_menu_entry 'Action board (status)'
end
end