blob: 77d02c73a52639ca5f05416f4b5fcd86a391c223 (
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
|
# frozen_string_literal: true
module QA
module Page
module Label
class Index < Page::Base
include Component::LazyLoader
view 'app/views/shared/labels/_nav.html.haml' do
element 'create-new-label-button'
end
view 'app/views/shared/empty_states/_labels.html.haml' do
element 'label-svg-content'
end
view 'app/views/shared/empty_states/_priority_labels.html.haml' do
element 'label-svg-content'
end
def click_new_label_button
# The 'labels.svg' takes a fraction of a second to load after which the "New label" button shifts up a bit
# This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_element?)
# before clicking the button.
within_element('label-svg-content') do
has_element?('js-lazy-loaded-content')
end
click_element('create-new-label-button')
end
end
end
end
end
|