summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-05 12:09:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-05 12:09:59 +0000
commitb90cf01a88df981f452a7f6b6d74e8fd0ccbf90b (patch)
tree669bd8c7dab7f6aad2b9eef6d03cdb7bb4e687db /qa
parentf9053931de583bbc3c6a8033f70929a91ce02e93 (diff)
downloadgitlab-ce-b90cf01a88df981f452a7f6b6d74e8fd0ccbf90b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/component/groups_filter.rb45
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb75
2 files changed, 36 insertions, 84 deletions
diff --git a/qa/qa/page/component/groups_filter.rb b/qa/qa/page/component/groups_filter.rb
index ec59d010718..ea91ced8679 100644
--- a/qa/qa/page/component/groups_filter.rb
+++ b/qa/qa/page/component/groups_filter.rb
@@ -24,36 +24,29 @@ module QA
private
+ # Check if a group exists in private or public tab
+ # @param name [String] group name
+ # @return [Boolean] whether a group with given name exists
def has_filtered_group?(name)
- # Filter and submit to reload the page and only retrieve the filtered results
- find_element(:groups_filter_field).set(name).send_keys(:return)
-
- # Since we submitted after filtering, the presence of
- # groups_list_tree_container means we have the complete filtered list
- # of groups
- has_element?(:groups_list_tree_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
- # If there are no groups we'll know immediately because we filtered the list
- if page.has_text?('No groups or projects matched your search',
-wait: 0) || page.has_text?('No groups matched your search', wait: 0)
- return false unless has_element?(:public_groups_tab)
-
- # Try for public groups
- click_element(:public_groups_tab)
- # Filter and submit to reload the page and only retrieve the filtered results
- find_element(:groups_filter_field).set(name).send_keys(:return)
-
- # Since we submitted after filtering, the presence of
- # groups_list_tree_container means we have the complete filtered list
- # of groups
- has_element?(:groups_list_tree_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
-
- return false if page.has_text?('No groups or projects matched your search',
-wait: 0) || page.has_text?('No groups matched your search', wait: 0)
- end
+ filter_group(name)
+ return true if page.has_link?(name, wait: 0) # element containing link to group
+
+ return false unless has_element?(:public_groups_tab, wait: 0)
- # The name will be present as filter input so we check for a link, not text
+ # Check public groups
+ click_element(:public_groups_tab)
+ filter_group(name)
page.has_link?(name, wait: 0)
end
+
+ # Filter by group name
+ # @param name [String] group name
+ # @return [Boolean] whether the filter returned any group
+ def filter_group(name)
+ fill_element(:groups_filter_field, name).send_keys(:return)
+ finished_loading?
+ has_element?(:groups_list_tree_container, wait: 1)
+ end
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
index a4849d47183..9544b3d2155 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb
@@ -2,10 +2,7 @@
module QA
RSpec.describe 'Verify', :runner do
- describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring, feature_flag: {
- name: 'ci_raw_variables_in_yaml_config',
- scope: :project
- } do
+ describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
let(:pipeline_job_name) { 'rspec' }
@@ -23,7 +20,7 @@ module QA
end
end
- let(:commit_ci_file) do
+ let!(:commit_ci_file) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
@@ -76,10 +73,7 @@ module QA
let(:pipeline_id) { project.pipelines.first[:id] }
let(:job_id) { project.job_by_name(pipeline_job_name)[:id] }
- def before_do
- # TODO: Switch to use `let!` and remove this line when removing FF
- commit_ci_file
-
+ before do
Flow::Login.sign_in
project.visit!
Flow::Pipeline.visit_latest_pipeline(status: 'passed')
@@ -92,55 +86,20 @@ module QA
runner&.remove_via_api!
end
- context 'when FF is on', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487' do
- before do
- Runtime::Feature.enable(:ci_raw_variables_in_yaml_config, project: project)
- sleep 60
-
- before_do
- end
-
- it 'expands variables according to expand: true/false', :aggregate_failures do
- Page::Project::Job::Show.perform do |show|
- expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1")
- expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID")
- expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID")
- expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4")
- expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
- expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID")
- end
- end
- end
-
- # TODO: Remove this context when FF :ci_raw_variables_in_yaml_config is removed
- # Also archive testcase and close related issue
- context 'when FF is off',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381486',
- quarantine: {
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/381806',
- only: { pipeline: %w[staging staging-canary staging-ref] },
- type: :waiting_on
- } do
- before do
- Runtime::Feature.disable(:ci_raw_variables_in_yaml_config, project: project)
- sleep 60
-
- before_do
- end
-
- it 'expands all variables', :aggregate_failures do
- Page::Project::Job::Show.perform do |show|
- expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR3 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR4 is JOBID-#{job_id}")
- expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR6 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
- expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
- expect(show.output).to have_content("VAR8 is value 8 #{pipeline_id}")
- end
+ it(
+ 'expands variables according to expand: true/false',
+ :aggregate_failures,
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487'
+ ) do
+ Page::Project::Job::Show.perform do |show|
+ expect(show.output).to have_content("VAR1 is JOBID-#{job_id}")
+ expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}")
+ expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1")
+ expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID")
+ expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID")
+ expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4")
+ expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}")
+ expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID")
end
end
end