<commit_before># frozen_string_literal: true

module QA
  # Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/49
  context 'Create', :smoke, :quarantine do
    describe 'Snippet creation' do
      it 'User creates a snippet' do
        Runtime::Browser.visit(:gitlab, Page::Main::Login)
        Page::Main::Login.perform(&:sign_in_using_credentials)

        Page::Main::Menu.perform(&:click_snippets_link)

        Resource::Snippet.fabricate_via_browser_ui! do |snippet|
          snippet.title = 'Snippet title'
          snippet.description = 'Snippet description'
          snippet.visibility = 'Public'
          snippet.file_name = 'New snippet file name'
          snippet.file_content = 'Snippet file text'
        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_embed_type('Embed')
          expect(snippet).to have_visibility_type('Public')
          expect(snippet).to have_file_name('New snippet file name')
          expect(snippet).to have_file_content('Snippet file text')
        end
      end
    end
  end
end<commit_msg>Test public snippet<commit_after># frozen_string_literal: true

module QA
  context 'Create', :smoke do
    describe 'Snippet creation' do
      it 'User creates a snippet' do
        Runtime::Browser.visit(:gitlab, Page::Main::Login)
        Page::Main::Login.perform(&:sign_in_using_credentials)

        Page::Main::Menu.perform(&:click_snippets_link)

        Resource::Snippet.fabricate_via_browser_ui! do |snippet|
          snippet.title = 'Snippet title'
          snippet.description = 'Snippet description'
          snippet.visibility = 'Private'
          snippet.file_name = 'New snippet file name'
          snippet.file_content = 'Snippet file text'
        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')
          expect(snippet).to have_file_name('New snippet file name')
          expect(snippet).to have_file_content('Snippet file text')
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10346283783783784, 'fraction_numerical': 0.0008445945945945946, 'mean_word_length': 3.1128472222222223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3111043', 'n_tokens_mistral': 708, 'n_tokens_neox': 685, 'n_words': 145}