mediawiki-extensions-Multim.../tests/browser/features/support/pages/lightbox_demo_page.rb
Jeff Hall 47cfaf62bd Initial setup for Multimedia Viewer browser tests and first basic e2e test.
Did some clean-up for Cucumber tags and code conventions.

Change-Id: Ifc954f60a50c41211043493fd64c2dcfa64848ff
Mingle: Multimedia card #100
Bug: 60049
2014-01-18 18:41:26 -08:00

35 lines
982 B
Ruby

class LightboxDemoPage
include PageObject
include URL
page_url URL.url("Lightbox_demo")
# Tag page elements that we will need.
a(:login, text: "Log in")
a(:image1_in_article, href: /\.jpg$/)
div(:mmv_wrapper, class: "mlb-wrapper")
div(:mmv_image_div, class: "mlb-image")
span(:mmv_metadata_title, class: "mw-mlb-title")
p(:mmv_metadata_desc, class: "mw-mlb-image-desc")
div(:mmv_next_button, class: "mw-mlb-next-image")
div(:mmv_previous_button, class: "mw-mlb-prev-image")
div(:mmv_close_button, class: "mlb-close")
# Convenient functions on some of these elements
def next_image()
mmv_next_button_element.fire_event("onfocus")
mmv_next_button_element.when_present.click
end
def previous_image()
mmv_previous_button_element.fire_event("onfocus")
mmv_previous_button_element.when_present.click
end
def exit_mmv()
mmv_close_button_element.fire_event("onfocus")
mmv_close_button_element.when_present.click
end
end