Commit b7916dea authored by Tomislav Nikic's avatar Tomislav Nikic

Adding a small fix

The button apears mutliple times.
Now we only click on the first one.
parent fa16b84a
...@@ -354,7 +354,7 @@ module QA ...@@ -354,7 +354,7 @@ module QA
end end
def apply_suggestion_with_message(message) def apply_suggestion_with_message(message)
click_element(:apply_suggestion_dropdown) all_elements(:apply_suggestion_dropdown, minimum: 1).first.click
fill_element(:commit_message_field, message) fill_element(:commit_message_field, message)
click_element(:commit_with_custom_message_button) click_element(:commit_with_custom_message_button)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module QA module QA
RSpec.describe 'Create' do RSpec.describe 'Create' do
context 'Add batch suggestions to a Merge Request', :transient do context 'Add batch suggestions to a Merge Request' do
let(:project) do let(:project) do
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
project.name = 'suggestions_project' project.name = 'suggestions_project'
...@@ -46,7 +46,7 @@ module QA ...@@ -46,7 +46,7 @@ module QA
merge_request.visit! merge_request.visit!
end end
it 'applies multiple suggestions', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1838', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/342131', type: :stale } do it 'applies multiple suggestions', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1838' do
Page::MergeRequest::Show.perform do |merge_request| Page::MergeRequest::Show.perform do |merge_request|
merge_request.click_diffs_tab merge_request.click_diffs_tab
4.times { merge_request.add_suggestion_to_batch } 4.times { merge_request.add_suggestion_to_batch }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment