mediawiki_selenium 1.0.0.pre.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +23 -1
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +1 -4
- data/UPGRADE.md +1 -1
- data/bin/mediawiki-selenium-init +1 -1
- data/lib/mediawiki_selenium/browser_factory/base.rb +8 -8
- data/lib/mediawiki_selenium/browser_factory/chrome.rb +1 -1
- data/lib/mediawiki_selenium/browser_factory/firefox.rb +4 -4
- data/lib/mediawiki_selenium/browser_factory/phantomjs.rb +2 -2
- data/lib/mediawiki_selenium/browser_factory.rb +5 -5
- data/lib/mediawiki_selenium/environment.rb +15 -14
- data/lib/mediawiki_selenium/initializer.rb +4 -4
- data/lib/mediawiki_selenium/page_factory.rb +1 -1
- data/lib/mediawiki_selenium/remote_browser_factory.rb +12 -8
- data/lib/mediawiki_selenium/step_definitions/login_steps.rb +0 -11
- data/lib/mediawiki_selenium/step_definitions/navigation_steps.rb +0 -11
- data/lib/mediawiki_selenium/step_definitions/preferences_steps.rb +0 -11
- data/lib/mediawiki_selenium/step_definitions/resource_loader_steps.rb +0 -11
- data/lib/mediawiki_selenium/step_definitions/upload_file_steps.rb +3 -3
- data/lib/mediawiki_selenium/step_definitions.rb +5 -5
- data/lib/mediawiki_selenium/support/env.rb +5 -16
- data/lib/mediawiki_selenium/support/hooks.rb +15 -26
- data/lib/mediawiki_selenium/support/modules/api_helper.rb +5 -7
- data/lib/mediawiki_selenium/support/pages/api_page.rb +6 -6
- data/lib/mediawiki_selenium/support/pages/login_page.rb +13 -12
- data/lib/mediawiki_selenium/support/pages/random_page.rb +2 -2
- data/lib/mediawiki_selenium/support/pages/reset_preferences_page.rb +3 -3
- data/lib/mediawiki_selenium/support/pages.rb +4 -4
- data/lib/mediawiki_selenium/support/sauce.rb +14 -18
- data/lib/mediawiki_selenium/support.rb +4 -4
- data/lib/mediawiki_selenium/version.rb +1 -12
- data/lib/mediawiki_selenium/warnings_formatter.rb +15 -15
- data/lib/mediawiki_selenium.rb +8 -19
- data/mediawiki_selenium.gemspec +35 -28
- data/spec/api_helper_spec.rb +25 -25
- data/spec/browser_factory/base_spec.rb +50 -46
- data/spec/browser_factory/chrome_spec.rb +11 -11
- data/spec/browser_factory/firefox_spec.rb +17 -17
- data/spec/browser_factory/phantomjs_spec.rb +11 -11
- data/spec/environment_spec.rb +194 -159
- data/spec/page_factory_spec.rb +12 -12
- data/spec/remote_browser_factory_spec.rb +15 -15
- data/spec/spec_helper.rb +2 -2
- data/templates/tests/browser/features/support/env.rb +3 -3
- metadata +9 -9
- data/.rubocop_todo.yml +0 -160
data/spec/page_factory_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
module MediawikiSelenium
|
4
4
|
describe PageFactory do
|
@@ -9,49 +9,49 @@ module MediawikiSelenium
|
|
9
9
|
expect(env).to be_a(::PageObject::PageFactory)
|
10
10
|
end
|
11
11
|
|
12
|
-
describe
|
12
|
+
describe '#on_page' do
|
13
13
|
subject { env.on_page(page_class, { using_params: {} }, visit) }
|
14
14
|
|
15
|
-
let(:browser) { double(
|
15
|
+
let(:browser) { double('Watir::Browser') }
|
16
16
|
|
17
|
-
context
|
17
|
+
context 'when told to visit a page' do
|
18
18
|
let(:visit) { true }
|
19
|
-
let(:config) { { mediawiki_url:
|
19
|
+
let(:config) { { mediawiki_url: 'http://an.example/wiki/' } }
|
20
20
|
|
21
|
-
let(:page_object_platform) { double(
|
21
|
+
let(:page_object_platform) { double('PageObject::WatirPageObject') }
|
22
22
|
|
23
23
|
before do
|
24
24
|
expect(env).to receive(:browser)
|
25
25
|
allow_any_instance_of(page_class).to receive(:initialize_browser)
|
26
26
|
end
|
27
27
|
|
28
|
-
context
|
28
|
+
context 'where the page URL is defined' do
|
29
29
|
let(:page_class) do
|
30
30
|
Class.new do
|
31
31
|
include ::PageObject
|
32
|
-
page_url
|
32
|
+
page_url 'Special:RandomPage'
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
it
|
36
|
+
it 'qualifies the path with the configured :mediawiki_url' do
|
37
37
|
expect_any_instance_of(page_class).to receive(:platform).
|
38
38
|
and_return(page_object_platform)
|
39
39
|
|
40
40
|
expect(page_object_platform).to receive(:navigate_to).
|
41
|
-
with(
|
41
|
+
with('http://an.example/wiki/Special:RandomPage')
|
42
42
|
|
43
43
|
subject
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
context
|
47
|
+
context 'where the page URL is undefined' do
|
48
48
|
let(:page_class) do
|
49
49
|
Class.new do
|
50
50
|
include ::PageObject
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
it
|
54
|
+
it 'never attempts to qualify one but still works' do
|
55
55
|
expect { subject }.not_to raise_error
|
56
56
|
end
|
57
57
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'mediawiki_selenium/browser_factory/base'
|
3
3
|
|
4
4
|
module MediawikiSelenium
|
5
5
|
describe RemoteBrowserFactory do
|
@@ -10,7 +10,7 @@ module MediawikiSelenium
|
|
10
10
|
|
11
11
|
it { is_expected.to be_a(RemoteBrowserFactory) }
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe '#browser_options' do
|
14
14
|
subject { factory.browser_options(config) }
|
15
15
|
|
16
16
|
let(:config) { {} }
|
@@ -20,28 +20,28 @@ module MediawikiSelenium
|
|
20
20
|
expect(Selenium::WebDriver::Remote::Capabilities).to receive(:foo).and_return(capabilities)
|
21
21
|
end
|
22
22
|
|
23
|
-
context
|
24
|
-
let(:config) { { sauce_ondemand_username:
|
23
|
+
context 'given a sauce_ondemand_username and sauce_ondemand_access_key' do
|
24
|
+
let(:config) { { sauce_ondemand_username: 'foo', sauce_ondemand_access_key: 'bar' } }
|
25
25
|
|
26
|
-
it
|
27
|
-
expect(subject[:url]).to eq(URI.parse(
|
26
|
+
it 'configures the remote webdriver url' do
|
27
|
+
expect(subject[:url]).to eq(URI.parse('http://foo:bar@ondemand.saucelabs.com/wd/hub'))
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
context
|
32
|
-
let(:config) { { platform:
|
31
|
+
context 'given a browser platform' do
|
32
|
+
let(:config) { { platform: 'foo' } }
|
33
33
|
|
34
|
-
it
|
35
|
-
expect(capabilities).to receive(:platform=).with(
|
34
|
+
it 'configures the browser platform' do
|
35
|
+
expect(capabilities).to receive(:platform=).with('foo')
|
36
36
|
subject
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
context
|
41
|
-
let(:config) { { version:
|
40
|
+
context 'given a browser version' do
|
41
|
+
let(:config) { { version: '123' } }
|
42
42
|
|
43
|
-
it
|
44
|
-
expect(capabilities).to receive(:version=).with(
|
43
|
+
it 'configures the browser version' do
|
44
|
+
expect(capabilities).to receive(:version=).with('123')
|
45
45
|
subject
|
46
46
|
end
|
47
47
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'mediawiki_selenium'
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'mediawiki_selenium/support'
|
4
|
+
require 'mediawiki_selenium/step_definitions'
|
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: 1.0.0
|
4
|
+
version: 1.0.0
|
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: 2015-02-
|
16
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: cucumber
|
@@ -309,9 +309,8 @@ dependencies:
|
|
309
309
|
- - ">="
|
310
310
|
- !ruby/object:Gem::Version
|
311
311
|
version: 2.14.4
|
312
|
-
description:
|
313
|
-
|
314
|
-
makes it easy to update the shared code.
|
312
|
+
description: Several MediaWiki extensions share code that makes it easy to run Selenium
|
313
|
+
tests. This gem makes it easy to update the shared code.
|
315
314
|
email:
|
316
315
|
- cmcmahon@wikimedia.org
|
317
316
|
- dduvall@wikimedia.org
|
@@ -328,7 +327,8 @@ files:
|
|
328
327
|
- ".gitreview"
|
329
328
|
- ".rspec"
|
330
329
|
- ".rubocop.yml"
|
331
|
-
- ".
|
330
|
+
- ".ruby-gemset"
|
331
|
+
- ".ruby-version"
|
332
332
|
- ".yardopts"
|
333
333
|
- CREDITS
|
334
334
|
- Gemfile
|
@@ -393,12 +393,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
393
393
|
version: '0'
|
394
394
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
395
395
|
requirements:
|
396
|
-
- - "
|
396
|
+
- - ">="
|
397
397
|
- !ruby/object:Gem::Version
|
398
|
-
version:
|
398
|
+
version: '0'
|
399
399
|
requirements: []
|
400
400
|
rubyforge_project:
|
401
|
-
rubygems_version: 2.
|
401
|
+
rubygems_version: 2.4.3
|
402
402
|
signing_key:
|
403
403
|
specification_version: 4
|
404
404
|
summary: An easy way to run MediaWiki Selenium tests.
|
data/.rubocop_todo.yml
DELETED
@@ -1,160 +0,0 @@
|
|
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
|