Class: LoginPage
- Inherits:
-
Object
- Object
- LoginPage
- Includes:
- PageObject, URL
- Defined in:
- lib/mediawiki_selenium/support/pages/login_page.rb
Overview
This file is subject to the license terms in the LICENSE file found in the mediawiki_selenium top-level directory and at git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of mediawiki_selenium, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file. Copyright 2013 by the Mediawiki developers. See the CREDITS file in the mediawiki_selenium top-level directory and at git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
Instance Method Summary collapse
- #logged_in_as_element ⇒ Object
- #login_with(username, password, wait_for_logout_element = true) ⇒ Object
Methods included from URL
Instance Method Details
#logged_in_as_element ⇒ Object
27 28 29 |
# File 'lib/mediawiki_selenium/support/pages/login_page.rb', line 27 def logged_in_as_element @browser.div(id: "mw-content-text").p.b end |
#login_with(username, password, wait_for_logout_element = true) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/mediawiki_selenium/support/pages/login_page.rb', line 30 def login_with(username, password, wait_for_logout_element = true) 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 logout_element.when_present(10) if wait_for_logout_element end |