Commit 0a830464 authored by Sanad Liaquat's avatar Sanad Liaquat

Fix merge request widget spec flakiness

parent 8f23a3bb
...@@ -49,13 +49,11 @@ module QA ...@@ -49,13 +49,11 @@ module QA
def approve_license(name) def approve_license(name)
click_license(name) click_license(name)
click_element(:approve_license_button) click_element(:approve_license_button)
wait_for_animated_element(:license_management_modal)
end end
def blacklist_license(name) def blacklist_license(name)
click_license(name) click_license(name)
click_element(:blacklist_license_button) click_element(:blacklist_license_button)
wait_for_animated_element(:license_management_modal)
end end
end end
end end
......
...@@ -90,6 +90,12 @@ module QA ...@@ -90,6 +90,12 @@ module QA
end end
end end
def wait_for_license_compliance_report
wait(reload: false) do
has_no_text?('Loading License Compliance report')
end
end
def approvals_required_from def approvals_required_from
approvals_content.match(/approvals? from (.*)/)[1] approvals_content.match(/approvals? from (.*)/)[1]
end end
......
...@@ -123,6 +123,8 @@ module QA ...@@ -123,6 +123,8 @@ module QA
show.approve_license_with_mr(approved_license_name) show.approve_license_with_mr(approved_license_name)
show.blacklist_license_with_mr(blacklisted_license_name) show.blacklist_license_with_mr(blacklisted_license_name)
show.wait_for_license_compliance_report
expect(show).to have_approved_license approved_license_name expect(show).to have_approved_license approved_license_name
expect(show).to have_blacklisted_license blacklisted_license_name expect(show).to have_blacklisted_license blacklisted_license_name
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