Skip to content

Fix flaky test spec/features/projects/work_items/work_item_spec.rb:42

What does this MR do and why?

Related to #415331 (closed)

Because there is more than one comment in the work item, the following line might return the incorrect note if the target comment hasn't been submitted:

page.within('.timeline-entry.note.note-wrapper.note-comment:last-child') do

The menu for the note actions won't include the delete option if the comment was authored by a different user, we need to make sure we are clicking on the comment added by the current user:

work_item_for_signed_in_user_behaves_like_work_items_comments_for_work_item_note_actions_signed_in_u

❯ rspec './spec/features/projects/work_items/work_item_spec.rb[1:1:7:3:1]' --seed 57724

Randomized with seed 57724
Test environment set up in 5.60768 seconds
Starting the Capybara driver server...
2023-06-14 12:50:30 WARN Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging#ruby

2023-06-14 12:50:30 WARN Selenium applicable driver not found; attempting to install with Selenium Manager
Capybara starting Puma...
* Version 6.3.0 , codename: Mugi No Toki Itaru
* Min threads: 0, max threads: 4
* Listening on unix:///var/folders/w2/gvt6bfks463ftmksytjppj0m0000gn/T/20230614-51252-2lgp5k

Finished in 28.7 seconds (files took 12.48 seconds to load)
1 example, 0 failures

Randomized with seed 57724

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugenia Grieff

Merge request reports

Loading