summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/snippet/index.rb
blob: fc677f96769bac28d54b5957e73cddb2d5b4e5e3 (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_mod_with('Page::Project::Snippet::Index', namespace: QA)