summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/snippet/index.rb
blob: a221abc4196174d35858d39f36fe10b6e200ba2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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')