Commit be72c797 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch 'qa-rewrite-create-personal-snippet-spec' into 'master'

Rewrite snippet tests verification flow

See merge request gitlab-org/gitlab!81769
parents f9c2abce d26735cb
......@@ -77,7 +77,10 @@ module QA
def click_create_snippet_button
wait_until(reload: false) { !find_element(:submit_button).disabled? }
click_element(:submit_button, Page::Dashboard::Snippet::Show)
click_element(:submit_button)
wait_until(reload: false) do
has_no_element?(:snippet_title_field)
end
end
private
......
......@@ -10,7 +10,7 @@ module QA
super
base.view 'app/assets/javascripts/snippets/components/snippet_title.vue' do
element :snippet_title_content, required: true
element :snippet_title_content
end
base.view 'app/assets/javascripts/snippets/components/snippet_description_view.vue' do
......@@ -87,7 +87,7 @@ module QA
end
def has_snippet_title?(snippet_title)
has_element? :snippet_title_content, text: snippet_title
has_element?(:snippet_title_content, text: snippet_title, wait: 10)
end
def has_snippet_description?(snippet_description)
......
......@@ -64,7 +64,10 @@ module QA
def save_changes
wait_until(reload: false) { !find_element(:submit_button).disabled? }
click_element(:submit_button, Page::Dashboard::Snippet::Show)
click_element(:submit_button)
wait_until(reload: false) do
has_no_element?(:file_name_field)
end
end
private
......
......@@ -9,7 +9,7 @@ module QA
include Page::Component::BlobContent
view 'app/assets/javascripts/snippets/components/snippet_title.vue' do
element :snippet_title_content, required: true
element :snippet_title_content
end
end
end
......
......@@ -22,7 +22,7 @@ module QA
end
it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347799' do
snippet.visit!
snippet
Page::Dashboard::Snippet::Show.perform do |snippet|
expect(snippet).to have_snippet_title('Snippet title')
......
......@@ -27,7 +27,7 @@ module QA
end
it 'creates a personal snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347723' do
snippet.visit!
snippet
Page::Dashboard::Snippet::Show.perform do |snippet|
expect(snippet).to have_snippet_title('Personal snippet with multiple files')
......
......@@ -22,7 +22,7 @@ module QA
end
it 'user creates a project snippet', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347798' do
snippet.visit!
snippet
Page::Dashboard::Snippet::Show.perform do |snippet|
expect(snippet).to have_snippet_title('Project snippet')
......
......@@ -29,7 +29,7 @@ module QA
end
it 'creates a project snippet with multiple files', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347725' do
snippet.visit!
snippet
Page::Dashboard::Snippet::Show.perform do |snippet|
aggregate_failures 'file content verification' do
......
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