summaryrefslogtreecommitdiff
path: root/qa/qa/page
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page')
-rw-r--r--qa/qa/page/label/index.rb15
-rw-r--r--qa/qa/page/label/new.rb30
-rw-r--r--qa/qa/page/merge_request/new.rb10
-rw-r--r--qa/qa/page/merge_request/show.rb11
-rw-r--r--qa/qa/page/project/menu.rb13
5 files changed, 79 insertions, 0 deletions
diff --git a/qa/qa/page/label/index.rb b/qa/qa/page/label/index.rb
new file mode 100644
index 00000000000..323acd57743
--- /dev/null
+++ b/qa/qa/page/label/index.rb
@@ -0,0 +1,15 @@
+module QA
+ module Page
+ module Label
+ class Index < Page::Base
+ view 'app/views/projects/labels/index.html.haml' do
+ element :label_create_new
+ end
+
+ def go_to_new_label
+ click_element :label_create_new
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/label/new.rb b/qa/qa/page/label/new.rb
new file mode 100644
index 00000000000..b5422dc9400
--- /dev/null
+++ b/qa/qa/page/label/new.rb
@@ -0,0 +1,30 @@
+module QA
+ module Page
+ module Label
+ class New < Page::Base
+ view 'app/views/shared/labels/_form.html.haml' do
+ element :label_title
+ element :label_description
+ element :label_color
+ element :label_create_button
+ end
+
+ def create_label
+ click_element :label_create_button
+ end
+
+ def fill_title(title)
+ fill_element :label_title, title
+ end
+
+ def fill_description(description)
+ fill_element :label_description, description
+ end
+
+ def fill_color(color)
+ fill_element :label_color, color
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/merge_request/new.rb b/qa/qa/page/merge_request/new.rb
index 83cc4bbbace..1f8f1fbca8e 100644
--- a/qa/qa/page/merge_request/new.rb
+++ b/qa/qa/page/merge_request/new.rb
@@ -22,6 +22,10 @@ module QA
element :issuable_dropdown_menu_milestone
end
+ view 'app/views/shared/issuable/_label_dropdown.html.haml' do
+ element :issuable_label
+ end
+
def create_merge_request
click_element :issuable_create_button
end
@@ -40,6 +44,12 @@ module QA
click_on milestone.title
end
end
+
+ def select_label(label)
+ click_element :issuable_label
+
+ click_link label.title
+ end
end
end
end
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index b40e90ef4ad..376606afb5d 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -23,6 +23,10 @@ module QA
element :squash_checkbox
end
+ view 'app/views/shared/issuable/_sidebar.html.haml' do
+ element :labels_block
+ end
+
def fast_forward_possible?
!has_text?('Fast-forward merge is not possible')
end
@@ -64,6 +68,13 @@ module QA
end
end
+ def has_label?(label)
+ page.within(element_selector_css(:labels_block)) do
+ element = find('span', text: label)
+ !element.nil?
+ end
+ end
+
def merge!
# The merge button is disabled on load
wait do
diff --git a/qa/qa/page/project/menu.rb b/qa/qa/page/project/menu.rb
index b32d5ea772b..bc125d1af88 100644
--- a/qa/qa/page/project/menu.rb
+++ b/qa/qa/page/project/menu.rb
@@ -22,6 +22,7 @@ module QA
element :activity_link, "title: _('Activity')" # rubocop:disable QA/ElementWithPattern
element :wiki_link_text, "Wiki" # rubocop:disable QA/ElementWithPattern
element :milestones_link
+ element :labels_link
end
view 'app/assets/javascripts/fly_out_nav.js' do
@@ -104,8 +105,20 @@ module QA
end
end
+ def go_to_labels
+ hover_issues { click_element :labels_link }
+ end
+
private
+ def hover_issues
+ within_sidebar do
+ find_element(:issues_item).hover
+
+ yield
+ end
+ end
+
def hover_settings
within_sidebar do
find('.qa-settings-item').hover