Commit c56c0620 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'fix-epic-management-flaky-test' into 'master'

Fix epic management flaky test

Closes #118656

See merge request gitlab-org/gitlab!22037
parents f588407e 87a0a930
...@@ -18,6 +18,9 @@ module QA ...@@ -18,6 +18,9 @@ module QA
def save_changes def save_changes
click_element :save_button click_element :save_button
wait(max: 5, interval: 1, reload: false) do
has_no_element?(:save_button)
end
end end
def delete_epic def delete_epic
......
...@@ -38,6 +38,14 @@ module QA ...@@ -38,6 +38,14 @@ module QA
has_element?(:epic_title_text, text: title) has_element?(:epic_title_text, text: title)
end end
end end
def has_no_epic?(title)
# First, check that the new epic button is present,
# meaning that the test is in the right page before
# checking that the epic is not there.
find_element(:new_epic_button)
has_no_element?(:epic_title_text, text: title)
end
end end
end end
end end
......
...@@ -15,21 +15,21 @@ module QA ...@@ -15,21 +15,21 @@ module QA
expect(page).to have_content(epic_title) expect(page).to have_content(epic_title)
epic_edited_title = 'Epic edited via GUI'
EE::Page::Group::Epic::Show.perform(&:click_edit_button) EE::Page::Group::Epic::Show.perform(&:click_edit_button)
EE::Page::Group::Epic::Edit.perform do |edit| EE::Page::Group::Epic::Edit.perform do |edit|
edited_title = 'Epic edited via GUI' edit.set_title(epic_edited_title)
edit.set_title(edited_title)
edit.save_changes edit.save_changes
expect(edit).to have_content(edited_title) expect(edit).to have_content(epic_edited_title)
end end
epic.visit! epic.visit!
EE::Page::Group::Epic::Show.perform(&:click_edit_button) EE::Page::Group::Epic::Show.perform(&:click_edit_button)
EE::Page::Group::Epic::Edit.perform do |edit| EE::Page::Group::Epic::Edit.perform(&:delete_epic)
edit.delete_epic
expect(edit).to have_content('The epic was successfully deleted') EE::Page::Group::Epic::Index.perform do |index|
expect(index).to have_no_epic(epic_edited_title)
end end
end end
......
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