7 def initialize(driver, base_url, project)
23 sec = @default_wait if sec.nil?
27 def find_element(by, target)
28 @driver.find_element(by, target)
31 def find_elements(by, target)
32 @driver.find_elements(by, target)
35 def input_text(by, target, value)
38 element = find_element(by, target)
40 element.send_keys value.to_s unless value.nil? || value.empty?
47 element = find_element(by, target)
50 rescue Selenium::WebDriver::Error::StaleElementReferenceError => e
51 if @retry < @retry_limit
53 p "+++ retry for click(#{by},#{target})"
61 def select(by, target, value)
64 element = find_element(by, target)
65 select = Selenium::WebDriver::Support::Select.new(element)
66 select.select_by :value, value.to_s
69 def selected(by_or_element, target=nil)
71 element = by_or_element
73 element = find_element(by, target)
75 select = Selenium::WebDriver::Support::Select.new(element)
76 select.selected_options
86 @driver.switch_to.alert
90 MyApiKeyPage.open @driver, @base_url, @project
94 AdminInfoPage.open @driver, @base_url, @project
98 ProjectsPage.open @driver, @base_url, @project
102 UsersPage.open @driver, @base_url, @project
105 def open_custom_fields
106 CustomFieldsPage.open @driver, @base_url, @project
109 def open_workflow_edit
110 WorkflowEditPage.open @driver, @base_url, @project
114 MyPage.open @driver, @base_url, @project
118 IssuesPage.open @driver, @base_url, @project
122 StartPage.open @driver, @base_url, @project
126 click :css, 'a.logout'
128 WelcomePage.new @driver, @base_url, @project
132 find_element(:css, "a.user.active").text
136 @driver.manage.cookie_named("_redmine_session")