summaryrefslogtreecommitdiff
path: root/qa/qa/page/group/show.rb
blob: a30d489e6ff1fea6f873c90c1761c68c741a0aac (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# frozen_string_literal: true

module QA
  module Page
    module Group
      class Show < Page::Base
        include Page::Component::GroupsFilter
        include QA::Page::Component::ConfirmModal

        view 'app/views/groups/_home_panel.html.haml' do
          element :new_project_button
          element :new_subgroup_button
          element :group_id_content
        end

        view 'app/views/shared/members/_access_request_links.html.haml' do
          element :leave_group_link
        end

        def click_subgroup(name)
          click_link name
        end

        def has_new_project_and_new_subgroup_buttons?
          has_element?(:new_project_button)
          has_element?(:new_subgroup_button)
        end

        def has_subgroup?(name)
          has_filtered_group?(name)
        end

        def go_to_new_subgroup
          click_element :new_subgroup_button
        end

        def go_to_new_project
          click_element :new_project_button
        end

        def group_id
          find_element(:group_id_content).text.delete('Group ID: ')
        end

        def leave_group
          click_element :leave_group_link
          click_confirmation_ok_button
        end
      end
    end
  end
end