6 class QuickEditPage < Page
7 def initialize(driver, base_url, project, before_page)
8 super(driver, base_url, project)
10 @before_page = before_page
12 find_element :id, "quick_edit_context"
15 def view_menu_item(issue_id, menu_selector)
16 menu_element = find_element(:id, "quick_edit_context")
17 menu_item_element = find_element(:css, menu_selector)
18 action.move_to(menu_element).perform
20 find_element(:css, menu_selector)
23 def update_field(issue_id, menu_selector, new_value, desire_alerting = false)
24 menu_element = find_element(:id, "quick_edit_context")
25 menu_item_element = find_element(:css, menu_selector)
26 action.move_to(menu_element).click(menu_item_element).perform
28 input_text :id, "new_value", new_value
30 buttons = find_elements(:css, "button > span")
31 submit_button = buttons.select {|button| button.text =~ /Submit/}
32 submit_button.first.click
34 @before_page.class.open @driver, @base_url, @project unless desire_alerting
37 def clear_field(issue_id, menu_selector)
38 menu_element = find_element(:id, "quick_edit_context")
39 menu_item_element = find_element(:css, menu_selector)
40 action.move_to(menu_element).click(menu_item_element).perform
42 find_element(:css, '#quick_edit_input_dialog #clear').click
44 buttons = find_elements(:css, "button > span")
45 submit_button = buttons.select {|button| button.text =~ /Submit/}
46 submit_button.first.click
48 @before_page.class.open @driver, @base_url, @project
52 button_elements = find_elements(:css, 'span.ui-button-text')
53 cancel_buttons = button_elements.select do |button_element|
54 button_element.text == 'Cancel'
56 cancel_button = cancel_buttons.first
59 # new Selenium::WebDriver::Wait.new().until {
60 # !cancel_button.displayed?
64 def menu_selector(attribute_name, custom_field_id=nil)
65 if :custom_field == attribute_name.to_sym
66 "#quick_edit_context_custom_field_values_#{custom_field_id} > a"
68 "#quick_edit_context_#{attribute_name} > a"