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

Merge branch 'ml-dismiss-new-modal' into 'master'

Dismiss modal after increasing access level

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



Merged-by: default avatarDan Davison <ddavison@gitlab.com>
Approved-by: default avatarJay McCure <jmccure@gitlab.com>
Approved-by: default avatarJustin Ho Tuan Duong <hduong@gitlab.com>
Approved-by: default avatarDan Davison <ddavison@gitlab.com>
Reviewed-by: default avatarDan Davison <ddavison@gitlab.com>
Co-authored-by: default avatarMark Lapierre <mlapierre@gitlab.com>
分支
标签
无相关合并请求
......@@ -68,7 +68,7 @@ export default {
text: this.primaryText,
attributes: {
variant: this.primaryVariant,
'data-qa-selector': 'confirm_ok_button',
'data-testid': 'confirm-ok-button',
},
};
},
......@@ -110,6 +110,7 @@ export default {
ref="modal"
modal-id="confirmationModal"
body-class="gl-display-flex"
data-testid="confirmation-modal"
:size="size"
:title="title"
:action-primary="primaryAction"
......
......@@ -11,6 +11,7 @@ def self.included(base)
base.view 'app/assets/javascripts/lib/utils/confirm_via_gl_modal/confirm_modal.vue' do
element :confirm_ok_button
element :confirmation_modal
end
base.view 'app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.vue' do
......@@ -37,6 +38,20 @@ def confirm_transfer
def click_confirmation_ok_button
click_element(:confirm_ok_button)
end
# Click the confirmation button if the confirmation modal is present
# Can be used when the modal may not always appear in a test. For example, if the modal is behind a feature flag
#
# @return [void]
def click_confirmation_ok_button_if_present
# In the case of changing access levels[1], the modal appears while there's a request in process, so we need
# to skip the loading check otherwise it will time out.
#
# [1]: https://gitlab.com/gitlab-org/gitlab/-/blob/4a99af809b86047ce3c8985e6582748bbd23fc84/qa/qa/page/component/members/members_table.rb#L54
return unless has_element?(:confirmation_modal, skip_finished_loading_check: true)
click_element(:confirm_ok_button, skip_finished_loading_check: true)
end
end
end
end
......
......@@ -14,6 +14,7 @@ def self.included(base)
include MembersFilter
include RemoveMemberModal
include RemoveGroupModal
include ConfirmModal
end
base.view 'app/assets/javascripts/members/components/table/members_table.vue' do
......@@ -53,6 +54,8 @@ def update_access_level(username, access_level)
click_element :access_level_dropdown
click_element :access_level_link, text: access_level
end
click_confirmation_ok_button_if_present
end
def remove_member(username)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
想要评论请 注册