mediawiki-extensions-Multim.../tests/browser/features/support/pages/login_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

23 lines
536 B
Ruby

class LoginPage
include PageObject
include URL
page_url URL.url("Special:UserLogin")
button(:login, id: "wpLoginAttempt")
text_field(:password, id: "wpPassword1")
text_field(:username, id: "wpName1")
def logged_in_as_element
@browser.div(id: "mw-content-text").p.b
end
def login_with(username, password)
self.username_element.when_present.send_keys(username)
self.password_element.when_present.send_keys(password)
login_element.fire_event("onfocus")
login_element.when_present.click
end
end