Commit f97f1e4e authored by Phil Hughes's avatar Phil Hughes

Merge branch '10io-qa-add-pull-test-for-gradle' into 'master'

Improve gradle QA scenario

See merge request gitlab-org/gitlab!64419
parents c0db0637 85558bab
......@@ -38,7 +38,7 @@
- if packages_registry_enabled?(group_or_project)
%fieldset.form-group.form-check
= f.check_box :read_package_registry, class: 'form-check-input'
= f.check_box :read_package_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_package_registry_checkbox' }
= f.label :read_package_registry, 'read_package_registry', class: 'label-bold form-check-label'
.text-secondary= s_('DeployTokens|Allows read access to the package registry.')
......
......@@ -9,6 +9,7 @@ module QA
element :deploy_token_name_field
element :deploy_token_expires_at_field
element :deploy_token_read_repository_checkbox
element :deploy_token_read_package_registry_checkbox
element :deploy_token_read_registry_checkbox
element :create_deploy_token_button
end
......@@ -27,8 +28,9 @@ module QA
fill_element(:deploy_token_expires_at_field, expires_at.to_s + "\n")
end
def fill_scopes(read_repository:, read_registry:)
def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false)
check_element(:deploy_token_read_repository_checkbox) if read_repository
check_element(:deploy_token_read_package_registry_checkbox) if read_package_registry
check_element(:deploy_token_read_registry_checkbox) if read_registry
end
......
......@@ -37,7 +37,7 @@ module QA
setting.expand_deploy_tokens do |page|
page.fill_token_name(name)
page.fill_token_expires_at(expires_at)
page.fill_scopes(read_repository: true, read_registry: false)
page.fill_scopes(read_repository: true, read_package_registry: true)
page.add_token
end
......
......@@ -15,11 +15,10 @@ module QA
end
attribute :id do
packages = project.packages
return unless (this_package = packages&.find { |package| package[:name] == "#{project.path_with_namespace}/#{name}" }) # rubocop:disable Cop/AvoidReturnFromBlocks
this_package = project.packages
&.find { |package| package[:name] == name }
this_package[:id]
this_package.try(:fetch, :id)
end
def fabricate!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment