diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-04-25 19:01:36 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-04-25 22:57:52 +0800 |
commit | 9cc2123e47661db37fbaff96f99999697aa60432 (patch) | |
tree | 67bd24eeee79ac06667aadf3950d9f867ca1e752 /qa/qa/page | |
parent | c5f6c811eec6bca7952f84af9e30f3fafb848352 (diff) | |
download | gitlab-ce-9cc2123e47661db37fbaff96f99999697aa60432.tar.gz |
Select everything so we could hit protect
Add missing QA selectors as well
Diffstat (limited to 'qa/qa/page')
-rw-r--r-- | qa/qa/page/project/settings/protected_branches.rb | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index f3563401124..23c3217d3f7 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -11,6 +11,13 @@ module QA view 'app/views/projects/protected_branches/_create_protected_branch.html.haml' do element :allowed_to_push_select element :allowed_to_push_dropdown + element :allowed_to_merge_select + element :allowed_to_merge_dropdown + end + + view 'app/views/projects/protected_branches/_update_protected_branch.html.haml' do + element :allowed_to_push + element :allowed_to_merge end view 'app/views/projects/protected_branches/shared/_branches_list.html.haml' do @@ -30,11 +37,19 @@ module QA end def allow_no_one_to_push - allow_to_push('No one') + click_allow(:push, 'No one') end def allow_devs_and_masters_to_push - allow_to_push('Developers + Masters') + click_allow(:push, 'Developers + Masters') + end + + def allow_no_one_to_merge + click_allow(:merge, 'No one') + end + + def allow_devs_and_masters_to_merge + click_allow(:merge, 'Developers + Masters') end def protect_branch @@ -55,11 +70,16 @@ module QA private - def allow_to_push(text) - click_element :allowed_to_push_select + def click_allow(action, text) + click_element :"allowed_to_#{action}_select" - within_element(:allowed_to_push_dropdown) do + + within_element(:"allowed_to_#{action}_dropdown") do click_on text + + wait(reload: false) do + has_css?('.is-active') + end end end end |