diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /qa/qa/resource | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) | |
download | gitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'qa/qa/resource')
-rw-r--r-- | qa/qa/resource/ci_variable.rb | 10 | ||||
-rw-r--r-- | qa/qa/resource/issue.rb | 5 | ||||
-rw-r--r-- | qa/qa/resource/members.rb | 13 | ||||
-rw-r--r-- | qa/qa/resource/merge_request.rb | 8 | ||||
-rw-r--r-- | qa/qa/resource/personal_access_token.rb | 2 | ||||
-rw-r--r-- | qa/qa/resource/project.rb | 8 | ||||
-rw-r--r-- | qa/qa/resource/repository/wiki_push.rb | 5 | ||||
-rw-r--r-- | qa/qa/resource/ssh_key.rb | 2 |
8 files changed, 31 insertions, 22 deletions
diff --git a/qa/qa/resource/ci_variable.rb b/qa/qa/resource/ci_variable.rb index f14fcdaac9f..0b9f4eb6635 100644 --- a/qa/qa/resource/ci_variable.rb +++ b/qa/qa/resource/ci_variable.rb @@ -3,7 +3,7 @@ module QA module Resource class CiVariable < Base - attr_accessor :key, :value, :masked + attr_accessor :key, :value, :masked, :protected attribute :project do Project.fabricate! do |resource| @@ -12,6 +12,11 @@ module QA end end + def initialize + @masked = false + @protected = false + end + def fabricate! project.visit! @@ -49,7 +54,8 @@ module QA { key: key, value: value, - masked: masked + masked: masked, + protected: protected } end end diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb index a6bd8987077..ffffa0eecda 100644 --- a/qa/qa/resource/issue.rb +++ b/qa/qa/resource/issue.rb @@ -5,7 +5,7 @@ require 'securerandom' module QA module Resource class Issue < Base - attr_writer :description, :milestone, :weight + attr_writer :description, :milestone, :template, :weight attribute :project do Project.fabricate! do |resource| @@ -33,7 +33,8 @@ module QA Page::Project::Issue::New.perform do |new_page| new_page.fill_title(@title) - new_page.fill_description(@description) + new_page.choose_template(@template) if @template + new_page.fill_description(@description) if @description new_page.choose_milestone(@milestone) if @milestone new_page.create_new_issue end diff --git a/qa/qa/resource/members.rb b/qa/qa/resource/members.rb index 52928afa7db..a88980f26d8 100644 --- a/qa/qa/resource/members.rb +++ b/qa/qa/resource/members.rb @@ -31,12 +31,13 @@ module QA end class AccessLevel - NO_ACCESS = 0 - GUEST = 10 - REPORTER = 20 - DEVELOPER = 30 - MAINTAINER = 40 - OWNER = 50 + NO_ACCESS = 0 + MINIMAL_ACCESS = 5 + GUEST = 10 + REPORTER = 20 + DEVELOPER = 30 + MAINTAINER = 40 + OWNER = 50 end end end diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb index ecf25b797a8..fd5f454f134 100644 --- a/qa/qa/resource/merge_request.rb +++ b/qa/qa/resource/merge_request.rb @@ -19,7 +19,8 @@ module QA :file_name, :file_content attr_writer :no_preparation, - :wait_for_merge + :wait_for_merge, + :template attribute :merge_when_pipeline_succeeds attribute :merge_status @@ -73,7 +74,8 @@ module QA Page::Project::Show.perform(&:new_merge_request) Page::MergeRequest::New.perform do |new_page| new_page.fill_title(@title) - new_page.fill_description(@description) + new_page.choose_template(@template) if @template + new_page.fill_description(@description) unless @template new_page.choose_milestone(@milestone) if @milestone new_page.assign_to_me if @assignee == 'me' labels.each do |label| @@ -86,6 +88,8 @@ module QA end def fabricate_via_api! + raise ResourceNotFoundError unless id + resource_web_url(api_get) rescue ResourceNotFoundError populate_target_and_source_if_required diff --git a/qa/qa/resource/personal_access_token.rb b/qa/qa/resource/personal_access_token.rb index 488138326df..6b2301ba916 100644 --- a/qa/qa/resource/personal_access_token.rb +++ b/qa/qa/resource/personal_access_token.rb @@ -15,7 +15,7 @@ module QA end def fabricate! - Page::Main::Menu.perform(&:click_settings_link) + Page::Main::Menu.perform(&:click_edit_profile_link) Page::Profile::Menu.perform(&:click_access_tokens) Page::Profile::PersonalAccessTokens.perform do |token_page| diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index a92f7912b9e..efb6c2c0591 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -25,10 +25,6 @@ module QA attribute :template_name attribute :import - attribute :default_branch do - api_response[:default_branch] || Runtime::Env.default_branch - end - attribute :group do Group.fabricate! end @@ -224,6 +220,10 @@ module QA parse_body(get(Runtime::API::Request.new(api_client, api_commits_path).url)) end + def default_branch + reload!.api_response[:default_branch] || Runtime::Env.default_branch + end + def import_status response = get Runtime::API::Request.new(api_client, "/projects/#{id}/import").url diff --git a/qa/qa/resource/repository/wiki_push.rb b/qa/qa/resource/repository/wiki_push.rb index f188e52c969..edf76c7cd78 100644 --- a/qa/qa/resource/repository/wiki_push.rb +++ b/qa/qa/resource/repository/wiki_push.rb @@ -12,14 +12,11 @@ module QA end end - def branch_name - @branch_name ||= wiki.project.default_branch - end - def initialize @file_name = 'Home.md' @file_content = 'This line was created using git push' @commit_message = 'Updating using git push' + @branch_name = 'master' @new_branch = false end diff --git a/qa/qa/resource/ssh_key.rb b/qa/qa/resource/ssh_key.rb index fcd0a479fec..52526275cb0 100644 --- a/qa/qa/resource/ssh_key.rb +++ b/qa/qa/resource/ssh_key.rb @@ -22,7 +22,7 @@ module QA end def fabricate! - Page::Main::Menu.perform(&:click_settings_link) + Page::Main::Menu.perform(&:click_edit_profile_link) Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::SSHKeys.perform do |profile_page| |