Skip to content
代码片段 群组 项目
提交 ec965704 编辑于 作者: Chloe Liu's avatar Chloe Liu
浏览文件

Merge branch 'jmd/add-negatable-for-be-mergeable' into 'master'

[E2E] Add RSpec Matcher for be_mergeable

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127064



Merged-by: default avatarChloe Liu <yliu@gitlab.com>
Approved-by: default avatarChloe Liu <yliu@gitlab.com>
Approved-by: default avatarWill Meek <wmeek@gitlab.com>
Reviewed-by: default avatarChloe Liu <yliu@gitlab.com>
Co-authored-by: default avatarJohn McDonnell <jmcdonnell@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -310,13 +310,14 @@ def merged? ...@@ -310,13 +310,14 @@ def merged?
end end
end end
# Check if the MR is able to be merged RSpec::Matchers.define :be_mergeable do
# Waits up 10 seconds and returns false if the MR can't be merged match do |page|
def mergeable? page.has_element?(:merge_button, disabled: false)
# The merge button is enabled via JS, but `has_element?` calls end
# `wait_for_requests`, which should ensure the disabled/enabled
# state of the element is reliable match_when_negated do |page|
has_element?(:merge_button, disabled: false) page.has_no_element?(:merge_button, disabled: false)
end
end end
# Waits up 10 seconds and returns false if the Revert button is not enabled # Waits up 10 seconds and returns false if the Revert button is not enabled
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册