summaryrefslogtreecommitdiff
path: root/qa/qa/page/issuable/sidebar.rb
blob: 9bb1c702576a75c34ebf6680ebe5193b19ca29d1 (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
# frozen_string_literal: true

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" # rubocop:disable QA/ElementWithPattern
          element :milestones_block, '.block.milestone' # rubocop:disable QA/ElementWithPattern
        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