diff --git a/modules/team_planner/spec/support/pages/team_planner.rb b/modules/team_planner/spec/support/pages/team_planner.rb index 7de934212f19..567518e192d3 100644 --- a/modules/team_planner/spec/support/pages/team_planner.rb +++ b/modules/team_planner/spec/support/pages/team_planner.rb @@ -227,14 +227,14 @@ def click_on_submit def add_assignee(name) click_add_user page.find('[data-qa-selector="tp-add-assignee"] input') - search_user_to_add name select_user_to_add name end def click_add_user - # Close the existing, if it is open - is_open = page.all('[data-qa-selector="tp-add-assignee"] input').first - page.find('[data-qa-selector="tp-assignee-add-button"]').click unless is_open + is_open = page.has_selector?('[data-qa-selector="tp-add-assignee"] input', wait: 0) + return if is_open + + page.find('[data-qa-selector="tp-assignee-add-button"]').click end def select_user_to_add(name)