diff --git a/ee/app/assets/javascripts/approvals/components/rule_drawer/create_rule.vue b/ee/app/assets/javascripts/approvals/components/rule_drawer/create_rule.vue index 348b4c8d7d0293f4444e6687b747707f8f7412bb..55e681075d5c756f7565f6594a22dc65d25f0483 100644 --- a/ee/app/assets/javascripts/approvals/components/rule_drawer/create_rule.vue +++ b/ee/app/assets/javascripts/approvals/components/rule_drawer/create_rule.vue @@ -78,7 +78,12 @@ export default { </template> <template #header> - <gl-button variant="confirm" :loading="isLoading" @click="submit"> + <gl-button + variant="confirm" + data-testid="save-approval-rule-button" + :loading="isLoading" + @click="submit" + > {{ $options.I18N.saveChanges }} </gl-button> <gl-button variant="confirm" category="secondary" @click="$emit('close')"> diff --git a/qa/qa/ee/page/merge_request/new.rb b/qa/qa/ee/page/merge_request/new.rb index 5f2f21f8860472f0d3c40080dddfbb1e8c93a824..c8a208177a910395ac53ac751a0e983f95fcede9 100644 --- a/qa/qa/ee/page/merge_request/new.rb +++ b/qa/qa/ee/page/merge_request/new.rb @@ -23,6 +23,10 @@ def self.prepended(base) element 'rule-name-field' end + view 'ee/app/assets/javascripts/approvals/components/rule_drawer/create_rule.vue' do + element 'save-approval-rule-button' + end + def add_approval_rules(rules) # The Approval rules button/link is a gitlab-ui component that doesn't have a QA selector click_button('Approval rules') @@ -51,7 +55,12 @@ def add_approval_rules(rules) # add a data attribute to the 'Ok' button without overriding it # So we break the rules and use a CSS selector instead of an element def click_approvers_modal_ok_button - find("#mr-edit-approvals-create-modal footer button.btn-confirm").click + # Conditional to handle approval rule draw https://gitlab.com/gitlab-org/gitlab/-/issues/444628 + if has_element?('save-approval-rule-button') + click_element('save-approval-rule-button') + else + find("#mr-edit-approvals-create-modal footer button.btn-confirm").click + end end private