Commit f0c379d3 authored by Anastasia McDonald's avatar Anastasia McDonald

Modify create_personal_snippet_spec to verify code highlighting

See https://gitlab.com/gitlab-org/quality/testcases/-/issues/899
parent 71fd52c0
......@@ -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