Commit ca756904 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-e2e-modify-create-snippet-test' into 'master'

Modify create_personal_snippet_spec to verify code highlighting

Closes gitlab-org/quality/testcases#899

See merge request gitlab-org/gitlab!37042
parents 544e73a5 f0c379d3
......@@ -154,6 +154,12 @@ module QA
end
end
def has_syntax_highlighting?(language)
within_element(:file_content) do
find('.line')['lang'].to_s == language
end
end
def edit_comment(comment)
finished_loading?
click_element(:edit_comment_button)
......
......@@ -14,16 +14,17 @@ module QA
snippet.title = 'Snippet title'
snippet.description = 'Snippet description'
snippet.visibility = 'Private'
snippet.file_name = 'New snippet file name'
snippet.file_content = 'Snippet file text'
snippet.file_name = 'ruby_file.rb'
snippet.file_content = 'File.read("test.txt").split(/\n/)'
end
Page::Dashboard::Snippet::Show.perform do |snippet|
expect(snippet).to have_snippet_title('Snippet title')
expect(snippet).to have_snippet_description('Snippet description')
expect(snippet).to have_visibility_type(/private/i)
expect(snippet).to have_file_name('New snippet file name')
expect(snippet).to have_file_content('Snippet file text')
expect(snippet).to have_file_name('ruby_file.rb')
expect(snippet).to have_file_content('File.read("test.txt").split(/\n/)')
expect(snippet).to have_syntax_highlighting('ruby')
end
end
end
......
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