Class: LoginPage

Inherits:
Object
  • Object
show all
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

Methods included from URL

url

Instance Method Details

#logged_in_as_elementObject



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 (username, password, wait_for_logout_element = true)
  self.username_element.when_present.send_keys(username)
  self.password_element.when_present.send_keys(password)
  .fire_event("onfocus")
  .when_present.click
  logout_element.when_present(10) if wait_for_logout_element
end