summaryrefslogtreecommitdiff
path: root/qa/qa/page/issuable/sidebar.rb
blob: f207264e24fa544cd675893c78e782a03a6d284d (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
module QA
  module Page
    module Issuable
      class Sidebar < Page::Base
        view 'app/views/shared/issuable/_sidebar.html.haml' do
          element :labels_block, ".issuable-show-labels"
          element :milestones_block, '.block.milestone'
        end

        def has_label?(label)
          page.within('.issuable-show-labels') do
            !!find('span', text: label)
          end
        end

        def has_milestone?(milestone)
          page.within('.block.milestone') do
            !!find("[href*='/milestones/']", text: milestone)
          end
        end
      end
    end
  end
end