mediawiki_selenium 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CREDITS +1 -1
- data/README.md +1 -1
- data/lib/mediawiki_selenium.rb +14 -6
- data/lib/mediawiki_selenium/step_definitions/login_steps.rb +14 -0
- data/lib/mediawiki_selenium/step_definitions/preferences_steps.rb +14 -0
- data/lib/mediawiki_selenium/{env.rb → support/env.rb} +3 -3
- data/lib/mediawiki_selenium/{hooks.rb → support/hooks.rb} +3 -3
- data/lib/mediawiki_selenium/support/modules/url_module.rb +21 -0
- data/lib/mediawiki_selenium/support/pages/login_page.rb +36 -0
- data/lib/mediawiki_selenium/support/pages/reset_preferences_page.rb +18 -0
- data/lib/mediawiki_selenium/{sauce.rb → support/sauce.rb} +3 -3
- data/lib/mediawiki_selenium/version.rb +4 -4
- metadata +11 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b405dae21d5f2bebb99264238da98b1b5be4669
|
|
4
|
+
data.tar.gz: bf6064004d8ad66be92cdb783374cb5ad1f8be6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 179b553c6b0163c10192089843a480b7b4f0d1d04000a3cf15dddf774d8be5a17e100f462f48b01b822d96a9ddfedc25b0194dc1ae29dc327c981a6cd6310ffb
|
|
7
|
+
data.tar.gz: de82a420a77b4a0900707e8e93b4cf1ac58d0520002e5b1db1283c751a5fb0617ca0f37c08a87c6d602e6b822482bfd5908b8f9f2fb74ed6da9eaef7ee85b99e
|
data/CREDITS
CHANGED
data/README.md
CHANGED
|
@@ -49,7 +49,7 @@ By default, the browser will close itself at the end of every scenario. If you w
|
|
|
49
49
|
|
|
50
50
|
## Links
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
mediawiki_selenium gem: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/selenium), [GitHub](https://github.com/wikimedia/mediawiki-selenium), [RubyGems](https://rubygems.org/gems/mediawiki_selenium), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-selenium)
|
|
53
53
|
|
|
54
54
|
If not stated differently, Selenium tests are in `/tests/browser` folder.
|
|
55
55
|
|
data/lib/mediawiki_selenium.rb
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
-
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
4
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
-
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
6
|
distributed except according to the terms contained in the LICENSE file.
|
|
7
7
|
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
-
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
9
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
|
-
require "mediawiki_selenium/env"
|
|
13
|
-
require "mediawiki_selenium/hooks"
|
|
14
|
-
require "mediawiki_selenium/sauce"
|
|
15
12
|
require "mediawiki_selenium/version"
|
|
16
13
|
|
|
14
|
+
require "mediawiki_selenium/support/env"
|
|
15
|
+
require "mediawiki_selenium/support/hooks"
|
|
16
|
+
require "mediawiki_selenium/support/sauce"
|
|
17
|
+
|
|
18
|
+
require "mediawiki_selenium/step_definitions/login_steps"
|
|
19
|
+
require "mediawiki_selenium/step_definitions/preferences_steps"
|
|
20
|
+
|
|
21
|
+
require "mediawiki_selenium/support/modules/url_module"
|
|
22
|
+
|
|
23
|
+
require "mediawiki_selenium/support/pages/login_page"
|
|
24
|
+
require "mediawiki_selenium/support/pages/reset_preferences_page"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
|
+
distributed except according to the terms contained in the LICENSE file.
|
|
7
|
+
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
Given(/^I am logged in$/) do
|
|
13
|
+
visit(LoginPage).login_with(ENV["MEDIAWIKI_USER"], ENV["MEDIAWIKI_PASSWORD"])
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
|
+
distributed except according to the terms contained in the LICENSE file.
|
|
7
|
+
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
Given(/^I have reset my preferences$/) do
|
|
13
|
+
visit(ResetPreferencesPage).submit_element.click
|
|
14
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
-
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
4
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
-
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
6
|
distributed except according to the terms contained in the LICENSE file.
|
|
7
7
|
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
-
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
9
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
10
|
=end
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
-
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
4
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
-
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
6
|
distributed except according to the terms contained in the LICENSE file.
|
|
7
7
|
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
-
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
9
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
10
|
=end
|
|
11
11
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
|
+
distributed except according to the terms contained in the LICENSE file.
|
|
7
|
+
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
module URL
|
|
13
|
+
def self.url(name)
|
|
14
|
+
if ENV["MEDIAWIKI_URL"]
|
|
15
|
+
mediawiki_url = ENV["MEDIAWIKI_URL"]
|
|
16
|
+
else
|
|
17
|
+
mediawiki_url = "http://en.wikipedia.beta.wmflabs.org/wiki/"
|
|
18
|
+
end
|
|
19
|
+
"#{mediawiki_url}#{name}"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
|
+
distributed except according to the terms contained in the LICENSE file.
|
|
7
|
+
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
class LoginPage
|
|
13
|
+
include PageObject
|
|
14
|
+
|
|
15
|
+
include URL
|
|
16
|
+
page_url URL.url("Special:UserLogin")
|
|
17
|
+
|
|
18
|
+
div(:feedback, class: "errorbox")
|
|
19
|
+
button(:login, id: "wpLoginAttempt")
|
|
20
|
+
a(:logout_link, text: "Log out")
|
|
21
|
+
text_field(:password, id: "wpPassword1")
|
|
22
|
+
a(:password_strength, text: "password strength")
|
|
23
|
+
a(:phishing, text: "phishing")
|
|
24
|
+
text_field(:username, id: "wpName1")
|
|
25
|
+
a(:username_displayed, title: /Your user page/)
|
|
26
|
+
|
|
27
|
+
def logged_in_as_element
|
|
28
|
+
@browser.div(id: "mw-content-text").p.b
|
|
29
|
+
end
|
|
30
|
+
def login_with(username, password)
|
|
31
|
+
self.username_element.when_present.send_keys(username)
|
|
32
|
+
self.password_element.when_present.send_keys(password)
|
|
33
|
+
login_element.fire_event("onfocus")
|
|
34
|
+
login_element.when_present.click
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
|
+
distributed except according to the terms contained in the LICENSE file.
|
|
7
|
+
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
|
+
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
class ResetPreferencesPage
|
|
13
|
+
include PageObject
|
|
14
|
+
include URL
|
|
15
|
+
page_url URL.url("Special:Preferences/reset")
|
|
16
|
+
|
|
17
|
+
button(:submit, class: "mw-htmlform-submit")
|
|
18
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
-
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
4
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
-
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
6
|
distributed except according to the terms contained in the LICENSE file.
|
|
7
7
|
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
-
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
9
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
10
|
=end
|
|
11
11
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
This file is subject to the license terms in the LICENSE file found in the
|
|
3
|
-
|
|
3
|
+
mediawiki_selenium top-level directory and at
|
|
4
4
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/LICENSE. No part of
|
|
5
|
-
|
|
5
|
+
mediawiki_selenium, including this file, may be copied, modified, propagated, or
|
|
6
6
|
distributed except according to the terms contained in the LICENSE file.
|
|
7
7
|
Copyright 2013 by the Mediawiki developers. See the CREDITS file in the
|
|
8
|
-
|
|
8
|
+
mediawiki_selenium top-level directory and at
|
|
9
9
|
https://git.wikimedia.org/blob/mediawiki%2Fselenium/HEAD/CREDITS.
|
|
10
10
|
=end
|
|
11
11
|
|
|
12
12
|
module MediawikiSelenium
|
|
13
|
-
VERSION = "0.2.
|
|
13
|
+
VERSION = "0.2.2"
|
|
14
14
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mediawiki_selenium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris McMahon
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2014-02-
|
|
15
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: cucumber
|
|
@@ -200,9 +200,14 @@ files:
|
|
|
200
200
|
- docs/template.md
|
|
201
201
|
- docs/view.md
|
|
202
202
|
- lib/mediawiki_selenium.rb
|
|
203
|
-
- lib/mediawiki_selenium/
|
|
204
|
-
- lib/mediawiki_selenium/
|
|
205
|
-
- lib/mediawiki_selenium/
|
|
203
|
+
- lib/mediawiki_selenium/step_definitions/login_steps.rb
|
|
204
|
+
- lib/mediawiki_selenium/step_definitions/preferences_steps.rb
|
|
205
|
+
- lib/mediawiki_selenium/support/env.rb
|
|
206
|
+
- lib/mediawiki_selenium/support/hooks.rb
|
|
207
|
+
- lib/mediawiki_selenium/support/modules/url_module.rb
|
|
208
|
+
- lib/mediawiki_selenium/support/pages/login_page.rb
|
|
209
|
+
- lib/mediawiki_selenium/support/pages/reset_preferences_page.rb
|
|
210
|
+
- lib/mediawiki_selenium/support/sauce.rb
|
|
206
211
|
- lib/mediawiki_selenium/version.rb
|
|
207
212
|
- mediawiki_selenium.gemspec
|
|
208
213
|
homepage: https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/selenium
|
|
@@ -225,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
225
230
|
version: '0'
|
|
226
231
|
requirements: []
|
|
227
232
|
rubyforge_project:
|
|
228
|
-
rubygems_version: 2.2.
|
|
233
|
+
rubygems_version: 2.2.2
|
|
229
234
|
signing_key:
|
|
230
235
|
specification_version: 4
|
|
231
236
|
summary: An easy way to run MediaWiki Selenium tests.
|