Skip to content

Commit

Permalink
Make team planner tests slightly faster
Browse files Browse the repository at this point in the history
- `search_user_to_add` call is useless as the `select_user_to_add`
  already does a search before the selection.

- `click_add_user` does not need to wait when checking the input
  presence. As it is almost always absent, this save 5 seconds.
  • Loading branch information
cbliard committed Sep 8, 2023
1 parent a207acc commit 39bac39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/team_planner/spec/support/pages/team_planner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 39bac39

Please sign in to comment.