summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-29 03:09:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-29 03:09:57 +0000
commitf574f9a14bb6448935fd27a67fc9f3ca61ffcc86 (patch)
treea4df208cf57f3642bbef9acd1ec5e23855484321 /qa
parenta111182345afb4625cf044ca829f946c7fc3d8a6 (diff)
downloadgitlab-ce-f574f9a14bb6448935fd27a67fc9f3ca61ffcc86.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb1
-rw-r--r--qa/qa/page/component/snippet.rb12
-rw-r--r--qa/qa/page/project/snippet/index.rb29
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb4
-rw-r--r--qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb6
5 files changed, 47 insertions, 5 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 0144d889477..d0edd1936e5 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -373,6 +373,7 @@ module QA
module Snippet
autoload :New, 'qa/page/project/snippet/new'
autoload :Show, 'qa/page/project/snippet/show'
+ autoload :Index, 'qa/page/project/snippet/index'
end
end
diff --git a/qa/qa/page/component/snippet.rb b/qa/qa/page/component/snippet.rb
index 702773768a8..7074d7e7649 100644
--- a/qa/qa/page/component/snippet.rb
+++ b/qa/qa/page/component/snippet.rb
@@ -122,6 +122,18 @@ module QA
end
end
+ def has_no_file_content?(file_content, file_number = nil)
+ if file_number
+ within_element_by_index(:file_content, file_number - 1) do
+ has_no_text?(file_content)
+ end
+ else
+ within_element(:file_content) do
+ has_no_text?(file_content)
+ end
+ end
+ end
+
def has_embed_dropdown?
has_element?(:snippet_embed_dropdown)
end
diff --git a/qa/qa/page/project/snippet/index.rb b/qa/qa/page/project/snippet/index.rb
new file mode 100644
index 00000000000..a221abc4196
--- /dev/null
+++ b/qa/qa/page/project/snippet/index.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Snippet
+ class Index < Page::Base
+ include Page::Component::Snippet
+
+ view 'app/views/shared/snippets/_snippet.html.haml' do
+ element :snippet_link
+ end
+
+ def has_project_snippet?(title)
+ has_element?(:snippet_link, snippet_title: title)
+ end
+
+ def click_snippet_link(title)
+ within_element(:snippet_link, text: title) do
+ click_link(title)
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+QA::Page::Project::Snippet::Index.prepend_if_ee('QA::EE::Page::Project::Snippet::Index')
diff --git a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb
index 0a8f6e13b2e..d80fc4c5b95 100644
--- a/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/snippet/create_project_snippet_spec.rb
@@ -21,8 +21,8 @@ module QA
expect(snippet).to have_file_name('markdown_file.md')
expect(snippet).to have_file_content('Snippet heading')
expect(snippet).to have_file_content('Gitlab link')
- expect(snippet).not_to have_file_content('###')
- expect(snippet).not_to have_file_content('https://gitlab.com/')
+ expect(snippet).to have_no_file_content('###')
+ expect(snippet).to have_no_file_content('https://gitlab.com/')
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb
index cdd4b789bf7..153ccafaa20 100644
--- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb
+++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_via_web_only_spec.rb
@@ -6,7 +6,7 @@ module QA
# [TODO]: Developer to remove :requires_admin and :skip_live_env once FF is removed in https://gitlab.com/gitlab-org/gitlab/-/issues/229632
context 'with web only rule' do
- let(:feature_flag) { 'new_pipeline_form' }
+ let(:feature_flag) { :new_pipeline_form }
let(:job_name) { 'test_job' }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
@@ -37,14 +37,14 @@ module QA
end
before do
- Runtime::Feature.enable_and_verify(feature_flag) # [TODO]: Developer to remove when feature flag is removed
+ Runtime::Feature.enable(feature_flag) # [TODO]: Developer to remove when feature flag is removed
Flow::Login.sign_in
project.visit!
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
end
after do
- Runtime::Feature.disable_and_verify(feature_flag) # [TODO]: Developer to remove when feature flag is removed
+ Runtime::Feature.disable(feature_flag) # [TODO]: Developer to remove when feature flag is removed
end
it 'can trigger pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/946' do