mediawiki_selenium 0.4.0 → 0.4.1
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/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +160 -0
- data/README.md +40 -2
- data/lib/mediawiki_selenium/support/env.rb +0 -10
- data/lib/mediawiki_selenium/support/hooks.rb +15 -1
- data/lib/mediawiki_selenium/version.rb +1 -1
- data/mediawiki_selenium.gemspec +1 -0
- metadata +20 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11f7e5e40d8fd4389439ab618b6b437d136459db
|
|
4
|
+
data.tar.gz: fedd884a20504dd153f6c36f74db7012381a3a3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58e958aeedac110d515622071690b641fa0f99b9abf530fc4989f198f02a499bec5d97812432b180103f2862fa8b57252fe84e56eb1f4558359164f9769df21e
|
|
7
|
+
data.tar.gz: f8678ed2779399d91653952cf0dc936d0634b26da49b23c92200ced417e286d60135a862b49c65b41eb9952fd80668ccad173c511f0f23b240957b77a8b73f17
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
|
2
|
+
# on 2014-10-20 16:46:25 +0200 using RuboCop version 0.26.1.
|
|
3
|
+
# The point is for the user to remove these configuration records
|
|
4
|
+
# one by one as the offenses are removed from the code base.
|
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
7
|
+
|
|
8
|
+
# Offense count: 1
|
|
9
|
+
# Cop supports --auto-correct.
|
|
10
|
+
Lint/UnusedBlockArgument:
|
|
11
|
+
Enabled: false
|
|
12
|
+
|
|
13
|
+
# Offense count: 4
|
|
14
|
+
# Cop supports --auto-correct.
|
|
15
|
+
Lint/UnusedMethodArgument:
|
|
16
|
+
Enabled: false
|
|
17
|
+
|
|
18
|
+
# Offense count: 1
|
|
19
|
+
Lint/UselessAccessModifier:
|
|
20
|
+
Enabled: false
|
|
21
|
+
|
|
22
|
+
# Offense count: 2
|
|
23
|
+
Metrics/CyclomaticComplexity:
|
|
24
|
+
Max: 16
|
|
25
|
+
|
|
26
|
+
# Offense count: 36
|
|
27
|
+
# Configuration parameters: AllowURI, URISchemes.
|
|
28
|
+
Metrics/LineLength:
|
|
29
|
+
Max: 187
|
|
30
|
+
|
|
31
|
+
# Offense count: 2
|
|
32
|
+
# Configuration parameters: CountComments.
|
|
33
|
+
Metrics/MethodLength:
|
|
34
|
+
Max: 37
|
|
35
|
+
|
|
36
|
+
# Offense count: 2
|
|
37
|
+
Metrics/PerceivedComplexity:
|
|
38
|
+
Max: 17
|
|
39
|
+
|
|
40
|
+
# Offense count: 1
|
|
41
|
+
Style/AccessorMethodName:
|
|
42
|
+
Enabled: false
|
|
43
|
+
|
|
44
|
+
# Offense count: 5
|
|
45
|
+
# Cop supports --auto-correct.
|
|
46
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
47
|
+
Style/AndOr:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
# Offense count: 3
|
|
51
|
+
# Cop supports --auto-correct.
|
|
52
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
53
|
+
Style/BarePercentLiterals:
|
|
54
|
+
Enabled: false
|
|
55
|
+
|
|
56
|
+
# Offense count: 13
|
|
57
|
+
# Cop supports --auto-correct.
|
|
58
|
+
Style/BlockComments:
|
|
59
|
+
Enabled: false
|
|
60
|
+
|
|
61
|
+
# Offense count: 1
|
|
62
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
63
|
+
Style/ClassAndModuleChildren:
|
|
64
|
+
Enabled: false
|
|
65
|
+
|
|
66
|
+
# Offense count: 10
|
|
67
|
+
Style/Documentation:
|
|
68
|
+
Enabled: false
|
|
69
|
+
|
|
70
|
+
# Offense count: 8
|
|
71
|
+
# Cop supports --auto-correct.
|
|
72
|
+
# Configuration parameters: AllowAdjacentOneLineDefs.
|
|
73
|
+
Style/EmptyLineBetweenDefs:
|
|
74
|
+
Enabled: false
|
|
75
|
+
|
|
76
|
+
# Offense count: 1
|
|
77
|
+
# Cop supports --auto-correct.
|
|
78
|
+
Style/EmptyLines:
|
|
79
|
+
Enabled: false
|
|
80
|
+
|
|
81
|
+
# Offense count: 1
|
|
82
|
+
# Cop supports --auto-correct.
|
|
83
|
+
Style/EmptyLinesAroundBody:
|
|
84
|
+
Enabled: false
|
|
85
|
+
|
|
86
|
+
# Offense count: 7
|
|
87
|
+
# Configuration parameters: AllowedVariables.
|
|
88
|
+
Style/GlobalVars:
|
|
89
|
+
Enabled: false
|
|
90
|
+
|
|
91
|
+
# Offense count: 2
|
|
92
|
+
# Configuration parameters: MinBodyLength.
|
|
93
|
+
Style/GuardClause:
|
|
94
|
+
Enabled: false
|
|
95
|
+
|
|
96
|
+
# Offense count: 12
|
|
97
|
+
# Cop supports --auto-correct.
|
|
98
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
99
|
+
Style/HashSyntax:
|
|
100
|
+
Enabled: false
|
|
101
|
+
|
|
102
|
+
# Offense count: 1
|
|
103
|
+
# Cop supports --auto-correct.
|
|
104
|
+
Style/IndentationWidth:
|
|
105
|
+
Enabled: false
|
|
106
|
+
|
|
107
|
+
# Offense count: 2
|
|
108
|
+
# Cop supports --auto-correct.
|
|
109
|
+
Style/LeadingCommentSpace:
|
|
110
|
+
Enabled: false
|
|
111
|
+
|
|
112
|
+
# Offense count: 3
|
|
113
|
+
# Cop supports --auto-correct.
|
|
114
|
+
Style/NilComparison:
|
|
115
|
+
Enabled: false
|
|
116
|
+
|
|
117
|
+
# Offense count: 5
|
|
118
|
+
# Cop supports --auto-correct.
|
|
119
|
+
# Configuration parameters: PreferredDelimiters.
|
|
120
|
+
Style/PercentLiteralDelimiters:
|
|
121
|
+
Enabled: false
|
|
122
|
+
|
|
123
|
+
# Offense count: 1
|
|
124
|
+
# Cop supports --auto-correct.
|
|
125
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
126
|
+
Style/PercentQLiterals:
|
|
127
|
+
Enabled: false
|
|
128
|
+
|
|
129
|
+
# Offense count: 2
|
|
130
|
+
# Cop supports --auto-correct.
|
|
131
|
+
Style/RedundantSelf:
|
|
132
|
+
Enabled: false
|
|
133
|
+
|
|
134
|
+
# Offense count: 1
|
|
135
|
+
# Cop supports --auto-correct.
|
|
136
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
137
|
+
Style/SignalException:
|
|
138
|
+
Enabled: false
|
|
139
|
+
|
|
140
|
+
# Offense count: 6
|
|
141
|
+
# Cop supports --auto-correct.
|
|
142
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
|
|
143
|
+
Style/SpaceInsideHashLiteralBraces:
|
|
144
|
+
Enabled: false
|
|
145
|
+
|
|
146
|
+
# Offense count: 1
|
|
147
|
+
# Cop supports --auto-correct.
|
|
148
|
+
Style/SpecialGlobalVars:
|
|
149
|
+
Enabled: false
|
|
150
|
+
|
|
151
|
+
# Offense count: 192
|
|
152
|
+
# Cop supports --auto-correct.
|
|
153
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
154
|
+
Style/StringLiterals:
|
|
155
|
+
Enabled: false
|
|
156
|
+
|
|
157
|
+
# Offense count: 3
|
|
158
|
+
# Cop supports --auto-correct.
|
|
159
|
+
Style/UnneededPercentQ:
|
|
160
|
+
Enabled: false
|
data/README.md
CHANGED
|
@@ -76,6 +76,39 @@ to `true`:
|
|
|
76
76
|
set KEEP_BROWSER_OPEN=true # Windows Command Prompt
|
|
77
77
|
$env:KEEP_BROWSER_OPEN="true" # Windows PowerShell
|
|
78
78
|
|
|
79
|
+
## Headless Mode
|
|
80
|
+
|
|
81
|
+
Headless operation can be useful when running tests in an environment where
|
|
82
|
+
there's no GUI available, environments such as a continuous integration
|
|
83
|
+
server, or a remote SSH session.
|
|
84
|
+
|
|
85
|
+
There are two basic ways to run in headless mode. The first is achieved by
|
|
86
|
+
simply using an inherently headless browser such as PhantomJS.
|
|
87
|
+
|
|
88
|
+
BROWSER=phantomjs bundle exec cucumber ...
|
|
89
|
+
|
|
90
|
+
The second method is to specify a `HEADLESS` environment variable in
|
|
91
|
+
combination with a non-headless browser. With this invocation
|
|
92
|
+
MediaWiki-Selenium will start up a virtual display to which the browser can
|
|
93
|
+
render. (Note that the underlying implementation relies on
|
|
94
|
+
[Xvfb](https://en.wikipedia.org/wiki/Xvfb) and so is only supported on Linux.)
|
|
95
|
+
|
|
96
|
+
HEADLESS=true BROWSER=firefox bundle exec cucumber ...
|
|
97
|
+
|
|
98
|
+
Some additional options are available to further customize the headless
|
|
99
|
+
behavior.
|
|
100
|
+
|
|
101
|
+
export HEADLESS=true
|
|
102
|
+
|
|
103
|
+
# Use a different display port (the default is 99)
|
|
104
|
+
HEADLESS_DISPLAY=100 bundle exec cucumber ...
|
|
105
|
+
|
|
106
|
+
# Don't reuse an already running xvfb (the default is to reuse)
|
|
107
|
+
HEADLESS_REUSE=false bundle exec cucumber ...
|
|
108
|
+
|
|
109
|
+
# Keep xvfb running after execution (the default is to kill it)
|
|
110
|
+
HEADLESS_DESTROY_AT_EXIT=false bundle exec cucumber ...
|
|
111
|
+
|
|
79
112
|
## Screenshots
|
|
80
113
|
|
|
81
114
|
You can get screenshots on failures by setting the environment
|
|
@@ -86,7 +119,7 @@ the destination path for screenshots. Example:
|
|
|
86
119
|
|
|
87
120
|
SCREENSHOT_FAILURES=true SCREENSHOT_FAILURES_PATH="/tmp/screenshots" bundle exec cucumber
|
|
88
121
|
|
|
89
|
-
##
|
|
122
|
+
## Updating Your Gemfile
|
|
90
123
|
|
|
91
124
|
In your repository, the `Gemfile` specifies dependencies and `Gemfile.lock` defines
|
|
92
125
|
the whole dependency tree. To update it simply run:
|
|
@@ -110,6 +143,7 @@ If not stated differently, Selenium tests are in `/tests/browser` folder and Jen
|
|
|
110
143
|
Repositories that use the gem:
|
|
111
144
|
|
|
112
145
|
1. ArticleFeedbackv5: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ArticleFeedbackv5), [GitHub](https://github.com/wikimedia/mediawiki-extensions-ArticleFeedbackv5), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-ArticleFeedbackv5)
|
|
146
|
+
1. CentralAuth: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/CentralAuth), [GitHub](https://github.com/wikimedia/mediawiki-extensions-CentralAuth), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-CentralAuth)
|
|
113
147
|
1. CirrusSearch: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/CirrusSearch), [GitHub](https://github.com/wikimedia/mediawiki-extensions-CirrusSearch), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-CirrusSearch)
|
|
114
148
|
1. ContentTranslation: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ContentTranslation), [GitHub](https://github.com/wikimedia/mediawiki-extensions-ContentTranslation), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-ContentTranslation)
|
|
115
149
|
1. Echo: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Echo), [GitHub](https://github.com/wikimedia/mediawiki-extensions-Echo), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-Echo)
|
|
@@ -126,9 +160,10 @@ Repositories that use the gem:
|
|
|
126
160
|
1. UniversalLanguageSelector: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/UniversalLanguageSelector), [GitHub](https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-UniversalLanguageSelector)
|
|
127
161
|
1. UploadWizard: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/UploadWizard), [GitHub](https://github.com/wikimedia/mediawiki-extensions-UploadWizard), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-UploadWizard)
|
|
128
162
|
1. VisualEditor: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/VisualEditor), [GitHub](https://github.com/wikimedia/mediawiki-extensions-VisualEditor), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-VisualEditor), `/modules/ve-mw/tests/browser` folder
|
|
129
|
-
1. WikidataBrowserTests: [GitHub](https://github.com/wmde/WikidataBrowserTests), [Code Climate](https://codeclimate.com/github/wmde/WikidataBrowserTests)
|
|
163
|
+
1. WikidataBrowserTests: [GitHub](https://github.com/wmde/WikidataBrowserTests), [Code Climate](https://codeclimate.com/github/wmde/WikidataBrowserTests)
|
|
130
164
|
1. WikiLove: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/WikiLove), [GitHub](https://github.com/wikimedia/mediawiki-extensions-WikiLove), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-WikiLove)
|
|
131
165
|
1. ZeroBanner: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ZeroBanner), [GitHub](https://github.com/wikimedia/mediawiki-extensions-ZeroBanner), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-ZeroBanner)
|
|
166
|
+
1. ZeroPortal: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ZeroPortal), [GitHub](https://github.com/wikimedia/mediawiki-extensions-ZeroPortal), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-ZeroPortal)
|
|
132
167
|
|
|
133
168
|
### Alumni
|
|
134
169
|
|
|
@@ -142,6 +177,9 @@ See https://www.mediawiki.org/wiki/Gerrit
|
|
|
142
177
|
|
|
143
178
|
## Release notes
|
|
144
179
|
|
|
180
|
+
### 0.4.1 2014-11-11
|
|
181
|
+
* Additional headless environment variables: HEADLESS_DISPLAY, HEADLESS_REUSE, HEADLESS_DESTROY_AT_EXIT.
|
|
182
|
+
|
|
145
183
|
### 0.4.0 2014-09-23
|
|
146
184
|
|
|
147
185
|
* Stricter pending behavior for falsely passing steps
|
|
@@ -146,13 +146,3 @@ def test_name(scenario)
|
|
|
146
146
|
"#{scenario.scenario_outline.feature.title}: #{scenario.scenario_outline.title}: #{scenario.name}"
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
|
-
|
|
150
|
-
if ENV["HEADLESS"] == "true"
|
|
151
|
-
require "headless"
|
|
152
|
-
headless = Headless.new
|
|
153
|
-
headless.start
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
at_exit do
|
|
157
|
-
headless.destroy if headless
|
|
158
|
-
end
|
|
@@ -19,10 +19,24 @@ Before("@login") do
|
|
|
19
19
|
puts "MEDIAWIKI_PASSWORD environment variable is not defined! Please export a value for that variable before proceeding." unless ENV["MEDIAWIKI_PASSWORD"]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
# Install a formatter that can be used to show feature-related warnings
|
|
23
22
|
AfterConfiguration do |config|
|
|
23
|
+
# Install a formatter that can be used to show feature-related warnings
|
|
24
24
|
pretty_format, io = config.formats.find { |(format, io)| format == "pretty" }
|
|
25
25
|
config.formats << ["MediawikiSelenium::WarningsFormatter", io] if pretty_format
|
|
26
|
+
|
|
27
|
+
# Initiate headless mode
|
|
28
|
+
if ENV["HEADLESS"] == "true"
|
|
29
|
+
require "headless"
|
|
30
|
+
|
|
31
|
+
headless_options = {}.tap do |options|
|
|
32
|
+
options[:display] = ENV["HEADLESS_DISPLAY"] if ENV.include?("HEADLESS_DISPLAY")
|
|
33
|
+
options[:reuse] = false if ENV["HEADLESS_REUSE"] == "false"
|
|
34
|
+
options[:destroy_at_exit] = false if ENV["HEADLESS_DESTROY_AT_EXIT"] == "false"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
headless = Headless.new(headless_options)
|
|
38
|
+
headless.start
|
|
39
|
+
end
|
|
26
40
|
end
|
|
27
41
|
|
|
28
42
|
# Enforce a dependency check for all scenarios tagged with @extension- tags
|
data/mediawiki_selenium.gemspec
CHANGED
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.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris McMahon
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2014-
|
|
16
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: cucumber
|
|
@@ -183,6 +183,20 @@ dependencies:
|
|
|
183
183
|
- - ">="
|
|
184
184
|
- !ruby/object:Gem::Version
|
|
185
185
|
version: '0'
|
|
186
|
+
- !ruby/object:Gem::Dependency
|
|
187
|
+
name: rubocop
|
|
188
|
+
requirement: !ruby/object:Gem::Requirement
|
|
189
|
+
requirements:
|
|
190
|
+
- - "~>"
|
|
191
|
+
- !ruby/object:Gem::Version
|
|
192
|
+
version: 0.26.1
|
|
193
|
+
type: :development
|
|
194
|
+
prerelease: false
|
|
195
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
196
|
+
requirements:
|
|
197
|
+
- - "~>"
|
|
198
|
+
- !ruby/object:Gem::Version
|
|
199
|
+
version: 0.26.1
|
|
186
200
|
- !ruby/object:Gem::Dependency
|
|
187
201
|
name: yard
|
|
188
202
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -213,6 +227,8 @@ extra_rdoc_files: []
|
|
|
213
227
|
files:
|
|
214
228
|
- ".gitignore"
|
|
215
229
|
- ".gitreview"
|
|
230
|
+
- ".rubocop.yml"
|
|
231
|
+
- ".rubocop_todo.yml"
|
|
216
232
|
- ".yardopts"
|
|
217
233
|
- CREDITS
|
|
218
234
|
- Gemfile
|
|
@@ -258,8 +274,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
258
274
|
version: '0'
|
|
259
275
|
requirements: []
|
|
260
276
|
rubyforge_project:
|
|
261
|
-
rubygems_version: 2.
|
|
277
|
+
rubygems_version: 2.4.3
|
|
262
278
|
signing_key:
|
|
263
279
|
specification_version: 4
|
|
264
280
|
summary: An easy way to run MediaWiki Selenium tests.
|
|
265
281
|
test_files: []
|
|
282
|
+
has_rdoc:
|