[MediaWiki-commits] [Gerrit] Moved LoginPage class and URL module to the gem - change (mediawiki/selenium)

2014-02-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Moved LoginPage class and URL module to the gem
..


Moved LoginPage class and URL module to the gem

Bug: 56088
Change-Id: I2dc4e2fd005e1cee6503a6039c280e508d39f43f
---
M lib/mediawiki_selenium.rb
A lib/mediawiki_selenium/support/modules/url_module.rb
A lib/mediawiki_selenium/support/pages/login_page.rb
3 files changed, 61 insertions(+), 0 deletions(-)

Approvals:
  Jhall: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/mediawiki_selenium.rb b/lib/mediawiki_selenium.rb
index 48b9b84..6a6ac57 100644
--- a/lib/mediawiki_selenium.rb
+++ b/lib/mediawiki_selenium.rb
@@ -14,3 +14,7 @@
 require "mediawiki_selenium/support/env"
 require "mediawiki_selenium/support/hooks"
 require "mediawiki_selenium/support/sauce"
+
+require "mediawiki_selenium/support/modules/url_module"
+
+require "mediawiki_selenium/support/pages/login_page"
diff --git a/lib/mediawiki_selenium/support/modules/url_module.rb 
b/lib/mediawiki_selenium/support/modules/url_module.rb
new file mode 100644
index 000..81f8e9d
--- /dev/null
+++ b/lib/mediawiki_selenium/support/modules/url_module.rb
@@ -0,0 +1,21 @@
+=begin
+This file is subject to the license terms in the LICENSE file found in the
+mediawiki-selenium top-level directory and at
+https://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
+https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
+=end
+
+module URL
+  def self.url(name)
+if ENV["MEDIAWIKI_URL"]
+  mediawiki_url = ENV["MEDIAWIKI_URL"]
+else
+  mediawiki_url = "http://en.wikipedia.beta.wmflabs.org/wiki/";
+end
+"#{mediawiki_url}#{name}"
+  end
+end
diff --git a/lib/mediawiki_selenium/support/pages/login_page.rb 
b/lib/mediawiki_selenium/support/pages/login_page.rb
new file mode 100644
index 000..84cf50d
--- /dev/null
+++ b/lib/mediawiki_selenium/support/pages/login_page.rb
@@ -0,0 +1,36 @@
+=begin
+This file is subject to the license terms in the LICENSE file found in the
+mediawiki-selenium top-level directory and at
+https://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
+https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
+=end
+
+class LoginPage
+  include PageObject
+
+  include URL
+  page_url URL.url("Special:UserLogin")
+
+  div(:feedback, class: "errorbox")
+  button(:login, id: "wpLoginAttempt")
+  a(:logout_link, text: "Log out")
+  text_field(:password, id: "wpPassword1")
+  a(:password_strength, text: "password strength")
+  a(:phishing, text: "phishing")
+  text_field(:username, id: "wpName1")
+  a(:username_displayed, title: /Your user page/)
+
+  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

-- 
To view, visit https://gerrit.wikimedia.org/r/112449
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dc4e2fd005e1cee6503a6039c280e508d39f43f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin 
Gerrit-Reviewer: Cmcmahon 
Gerrit-Reviewer: Jhall 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Tobias Gritschacher 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Moved LoginPage class and URL module to the gem - change (mediawiki/selenium)

2014-02-10 Thread Zfilipin (Code Review)
Zfilipin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/112449

Change subject: Moved LoginPage class and URL module to the gem
..

Moved LoginPage class and URL module to the gem

Bug: 56088
Change-Id: I2dc4e2fd005e1cee6503a6039c280e508d39f43f
---
M lib/mediawiki_selenium.rb
A lib/mediawiki_selenium/support/modules/url_module.rb
A lib/mediawiki_selenium/support/pages/login_page.rb
3 files changed, 61 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/49/112449/1

diff --git a/lib/mediawiki_selenium.rb b/lib/mediawiki_selenium.rb
index 48b9b84..6a6ac57 100644
--- a/lib/mediawiki_selenium.rb
+++ b/lib/mediawiki_selenium.rb
@@ -14,3 +14,7 @@
 require "mediawiki_selenium/support/env"
 require "mediawiki_selenium/support/hooks"
 require "mediawiki_selenium/support/sauce"
+
+require "mediawiki_selenium/support/modules/url_module"
+
+require "mediawiki_selenium/support/pages/login_page"
diff --git a/lib/mediawiki_selenium/support/modules/url_module.rb 
b/lib/mediawiki_selenium/support/modules/url_module.rb
new file mode 100644
index 000..81f8e9d
--- /dev/null
+++ b/lib/mediawiki_selenium/support/modules/url_module.rb
@@ -0,0 +1,21 @@
+=begin
+This file is subject to the license terms in the LICENSE file found in the
+mediawiki-selenium top-level directory and at
+https://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
+https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
+=end
+
+module URL
+  def self.url(name)
+if ENV["MEDIAWIKI_URL"]
+  mediawiki_url = ENV["MEDIAWIKI_URL"]
+else
+  mediawiki_url = "http://en.wikipedia.beta.wmflabs.org/wiki/";
+end
+"#{mediawiki_url}#{name}"
+  end
+end
diff --git a/lib/mediawiki_selenium/support/pages/login_page.rb 
b/lib/mediawiki_selenium/support/pages/login_page.rb
new file mode 100644
index 000..84cf50d
--- /dev/null
+++ b/lib/mediawiki_selenium/support/pages/login_page.rb
@@ -0,0 +1,36 @@
+=begin
+This file is subject to the license terms in the LICENSE file found in the
+mediawiki-selenium top-level directory and at
+https://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
+https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
+=end
+
+class LoginPage
+  include PageObject
+
+  include URL
+  page_url URL.url("Special:UserLogin")
+
+  div(:feedback, class: "errorbox")
+  button(:login, id: "wpLoginAttempt")
+  a(:logout_link, text: "Log out")
+  text_field(:password, id: "wpPassword1")
+  a(:password_strength, text: "password strength")
+  a(:phishing, text: "phishing")
+  text_field(:username, id: "wpName1")
+  a(:username_displayed, title: /Your user page/)
+
+  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

-- 
To view, visit https://gerrit.wikimedia.org/r/112449
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dc4e2fd005e1cee6503a6039c280e508d39f43f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Zfilipin 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits