blob: 922a6ddb086b4fa4b551f7baebee3b00a4253788 (
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
53
54
55
56
57
58
59
60
61
62
63
64
|
# frozen_string_literal: true
module QA
module Page
module Project
module Branches
class Show < Page::Base
view 'app/views/projects/branches/_branch.html.haml' do
element :remove_btn
end
view 'app/views/projects/branches/_panel.html.haml' do
element :all_branches
end
view 'app/views/projects/branches/index.html.haml' do
element :delete_merged_branches
end
def delete_branch(branch_name)
within_element(:all_branches) do
within(".js-branch-#{branch_name}") do
accept_alert do
click_element(:remove_btn)
end
end
end
finished_loading?
end
def has_branch_title?(branch_title)
within_element(:all_branches) do
within(".item-title") do
has_text?(branch_title)
end
end
end
def has_branch_with_badge?(branch_name, badge)
within_element(:all_branches) do
within(".js-branch-#{branch_name} .badge") do
has_text?(badge)
end
end
end
def delete_merged_branches
accept_alert do
click_element(:delete_merged_branches)
end
end
def wait_for_texts_not_to_be_visible(texts)
text_not_visible = wait do
texts.all? do |text|
has_no_text?(text)
end
end
raise "Expected text(s) #{texts} not to be visible" unless text_not_visible
end
end
end
end
end
end
|