1 Given /^I have PNP data for "(.+)"/ do |object|
3 objs = object.split(";")
10 host.gsub!(/[ :\/\\]/, '_')
11 service.gsub!(/[ :\/\\]/, '_')
13 FileUtils.mkdir_p("/opt/monitor/op5/pnp/perfdata/" + host)
14 FileUtils.touch("/opt/monitor/op5/pnp/perfdata/" + host + "/" + service + ".xml")
17 When /^I enter the time in (\d) minutes into "(.+)"$/ do |minutes, selector|
19 fill_in(selector, :with => (Time.now + minutes.to_i * 60).strftime('%F %T'))
22 # Because all our projects have their own helptext implementation...
23 Then /^all helptexts should be defined$/ do
24 all(:css, '.helptext_target', :visible => true).each { | elem |
25 elem.trigger(:mouseover)
27 page.should have_css(".qtip-content", :visible => true)
28 # "This helptext (%s) is not translated yet" is only printed by convention, but it appears we follow it
29 page.should have_no_content "This helptext"
30 find(".qtip-content", :visible => true).text.length.should_not be 0
31 elem.trigger(:mouseout)
32 page.should have_no_css(".qtip-content", :visible => true)
36 When /I select "(.*)" from the multiselect "(.*)"$/ do |option, selector|
37 tmp_sel = find_field(find_field(selector)[:id].sub('[', '_tmp['))
38 tmp_sel.select(option)
39 page.execute_script("$('##{tmp_sel[:id].gsub('[', '\\\\\[').gsub(']', '\\\\\]')}').trigger('change');")
42 When /I deselect "(.*)" from the multiselect "(.*)"$/ do |option, selector|
43 tmp_sel = find_field(selector)
44 tmp_sel.select(option)
45 page.execute_script("$('##{tmp_sel[:id].gsub('[', '\\\\\[').gsub(']', '\\\\\]')}').trigger('change');")
48 When /^I filter "(.*)" on "(.*)"$/ do |selector, regex|
49 find(:xpath, ".//input[following-sibling::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = '#{selector}' or ./@name = '#{selector}') or ./@placeholder = '#{selector}') or ./@id = //label[normalize-space(string(.)) = '#{selector}']/@for)]]").set(regex)