Rewrite protected branches feature & E2E tests to the new flow
While working on removing the old protected branches section in project's settings, I realised there's quite a bit of feature tests that still run based on that. In the end I had to hide the section using edit_branch_rules feature flag, instead of removing it.
Note: That source code of that section needs to stay, as it is still used on the group level settings, but we can remove the rendering on the project level.
Here's a list of feature tests and helpers affected (though it may not be complete):
ee/spec/features/projects/settings/ee/protected_branches_spec.rbee/spec/features/projects/protected_branches_spec.rbee/spec/features/protected_branches_spec.rbspec/features/protected_branches_spec.rbspec/views/projects/settings/repository/_protected_branches.html.haml_spec.rbspec/support/shared_examples/features/protected_branches_access_control_ce_shared_examples.rbee/spec/support/shared_examples/features/protected_branches_access_control_shared_examples.rbspec/support/shared_examples/projects/protected_branches_shared_examples.rbspec/support/protected_branch_helpers.rb
And the list of E2E files affected:
qa/qa/specs/features/browser_ui/3_create/repository/add_new_branch_rule_spec.rbqa/qa/specs/features/ee/browser_ui/3_create/repository/assign_code_owners_spec.rbqa/qa/specs/features/ee/browser_ui/3_create/repository/restrict_push_protected_branch_spec.rbqa/qa/resource/protected_branch.rbqa/qa/page/project/settings/repository.rb
I'd want to propose rewriting these separately and ahead of Cleanup edit_branch_rules feature flag (#498288)
When rewriting this, we need to be sure that we are testing exactly the same cases, but just using the new UI.