mediawiki_selenium 1.6.2 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/RELEASES.md +4 -0
- data/Rakefile +19 -0
- data/UPGRADE.md +2 -2
- data/features/saucelabs_browsers.feature +21 -0
- data/features/step_definitions/saucelabs_steps.rb +5 -0
- data/lib/mediawiki_selenium/browser_factory.rb +11 -2
- data/lib/mediawiki_selenium/browser_factory/base.rb +1 -1
- data/lib/mediawiki_selenium/browser_factory/firefox.rb +5 -1
- data/lib/mediawiki_selenium/remote_browser_factory.rb +10 -0
- data/lib/mediawiki_selenium/version.rb +1 -1
- data/spec/browser_factory/base_spec.rb +0 -2
- data/spec/browser_factory/firefox_spec.rb +9 -3
- data/spec/browser_factory_spec.rb +21 -0
- data/spec/remote_browser_factory_spec.rb +18 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffa3ecc9539e538abf8730f38ba611ded2b25006
|
4
|
+
data.tar.gz: 85ab4f6ebb1f28a385df0c95a492ee24d9d1ed78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70bc364392d8c6d5e9264d610858f4565abe5eeb0e55ba440fb76b280a65e2be8e33e78e1f7122225b0fef11c913a3425279ce91f7627ed85a2fc6ac0ff882ba
|
7
|
+
data.tar.gz: 50b31211b5b9e1eae9611ddf1c18e5861b2381e78a085f140a1d1d43cee831f00853ffb838c24a151519fba1d98e36340937fbf42d930f50259eaef9bc93bf26
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ Create a `Gemfile` in the root of your MediaWiki-related project that
|
|
37
37
|
specifies the version of `mediawiki_selenium` you wish to use (typically the
|
38
38
|
latest version).
|
39
39
|
|
40
|
-
gem 'mediawiki_selenium', '~> 1.
|
40
|
+
gem 'mediawiki_selenium', '~> 1.6.3'
|
41
41
|
|
42
42
|
Install the gem and its dependencies by running `bundle install`. (If
|
43
43
|
[Bundler](http://bundler.io/) is not yet installed, install it with
|
data/RELEASES.md
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# pre-flight
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
require 'rubocop/rake_task'
|
7
|
+
require 'yard'
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new(:spec)
|
10
|
+
RuboCop::RakeTask.new(:rubocop)
|
11
|
+
YARD::Rake::YardocTask.new(:yard)
|
12
|
+
|
13
|
+
task default: [:test]
|
14
|
+
|
15
|
+
desc 'Run all build/tests commands (CI entry point)'
|
16
|
+
task test: [:build, :rubocop, :spec, :yard]
|
17
|
+
|
18
|
+
desc 'Generate all documentations'
|
19
|
+
task doc: [:yard]
|
data/UPGRADE.md
CHANGED
@@ -10,7 +10,7 @@ in the root directory of your project.
|
|
10
10
|
First, update the `Gemfile` in your project's root directory to specify the
|
11
11
|
new version.
|
12
12
|
|
13
|
-
gem 'mediawiki_selenium', '~> 1.6.
|
13
|
+
gem 'mediawiki_selenium', '~> 1.6.3'
|
14
14
|
|
15
15
|
### Update `require` paths in `env.rb`
|
16
16
|
|
@@ -37,7 +37,7 @@ if they don't apply to your test cases. The only must have is the first
|
|
37
37
|
First, update the `Gemfile` in your project's root directory to specify the
|
38
38
|
new version.
|
39
39
|
|
40
|
-
gem 'mediawiki_selenium', '~> 1.6.
|
40
|
+
gem 'mediawiki_selenium', '~> 1.6.3'
|
41
41
|
|
42
42
|
### Upgrade gems and dependencies
|
43
43
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: Support for entire suite of browsers provided by SauceLabs
|
2
|
+
Background:
|
3
|
+
Given I have configured my environment from `ENV`
|
4
|
+
And I have set "SAUCE_ONDEMAND_USERNAME" in my shell
|
5
|
+
And I have set "SAUCE_ONDEMAND_ACCESS_KEY" in my shell
|
6
|
+
|
7
|
+
Scenario Outline: All SauceLabs browsers are supported
|
8
|
+
Given I have configured my environment to use <browser> on <platform>
|
9
|
+
When I start interacting with the browser
|
10
|
+
Then the browser is open
|
11
|
+
|
12
|
+
Examples:
|
13
|
+
| browser | platform |
|
14
|
+
| firefox | linux |
|
15
|
+
| firefox | windows |
|
16
|
+
| chrome | linux |
|
17
|
+
| chrome | windows |
|
18
|
+
| internet_explorer | windows |
|
19
|
+
| safari | os x 10.11 |
|
20
|
+
| android | linux |
|
21
|
+
| iphone | os x 10.11 |
|
@@ -1,5 +1,10 @@
|
|
1
1
|
require 'net/https'
|
2
2
|
|
3
|
+
Given(/^I have configured my environment to use (.*?) on (.*?)$/) do |browser, platform|
|
4
|
+
@configs = [ENV, { browser: browser, platform: platform, browser_timeout: 120 }]
|
5
|
+
@env = MediawikiSelenium::Environment.new(*@configs)
|
6
|
+
end
|
7
|
+
|
3
8
|
Then(/^the SauceLabs job should be marked as failed$/) do
|
4
9
|
job_id = @env.browser.driver.session_id
|
5
10
|
|
@@ -5,7 +5,9 @@ module MediawikiSelenium
|
|
5
5
|
autoload :Chrome, 'mediawiki_selenium/browser_factory/chrome'
|
6
6
|
autoload :Phantomjs, 'mediawiki_selenium/browser_factory/phantomjs'
|
7
7
|
|
8
|
-
# Resolves and instantiates a new factory for the given browser name.
|
8
|
+
# Resolves and instantiates a new factory for the given browser name. If a
|
9
|
+
# specific implementation is not defined for the given browser, a `Base`
|
10
|
+
# factory will be returned.
|
9
11
|
#
|
10
12
|
# @example Create a new firefox factory
|
11
13
|
# factory = BrowserFactory.new(:firefox)
|
@@ -17,7 +19,14 @@ module MediawikiSelenium
|
|
17
19
|
# @return [BrowserFactory::Base]
|
18
20
|
#
|
19
21
|
def self.new(browser_name)
|
20
|
-
|
22
|
+
factory_class_name = browser_name.to_s.split('_').map(&:capitalize).join('')
|
23
|
+
|
24
|
+
if const_defined?(factory_class_name)
|
25
|
+
factory_class = const_get(factory_class_name)
|
26
|
+
else
|
27
|
+
factory_class = Base
|
28
|
+
end
|
29
|
+
|
21
30
|
factory_class.new(browser_name)
|
22
31
|
end
|
23
32
|
end
|
@@ -32,7 +32,11 @@ module MediawikiSelenium
|
|
32
32
|
protected
|
33
33
|
|
34
34
|
def default_browser_options
|
35
|
-
|
35
|
+
profile = Selenium::WebDriver::Firefox::Profile.new
|
36
|
+
# Never show any firstrun pages.
|
37
|
+
# @see http://kb.mozillazine.org/Browser.startup.homepage_override.mstone
|
38
|
+
profile['browser.startup.homepage_override.mstone'] = 'ignore'
|
39
|
+
super.merge(profile: profile)
|
36
40
|
end
|
37
41
|
end
|
38
42
|
end
|
@@ -9,6 +9,8 @@ module MediawikiSelenium
|
|
9
9
|
# - sauce_ondemand_access_key
|
10
10
|
# - platform
|
11
11
|
# - version
|
12
|
+
# - device_name
|
13
|
+
# - device_orientation
|
12
14
|
#
|
13
15
|
module RemoteBrowserFactory
|
14
16
|
REQUIRED_CONFIG = [:sauce_ondemand_username, :sauce_ondemand_access_key]
|
@@ -37,6 +39,14 @@ module MediawikiSelenium
|
|
37
39
|
base.configure(:version) do |version, options|
|
38
40
|
options[:desired_capabilities].version = version
|
39
41
|
end
|
42
|
+
|
43
|
+
base.configure(:device_name) do |device_name, options|
|
44
|
+
options[:desired_capabilities]['deviceName'] = device_name
|
45
|
+
end
|
46
|
+
|
47
|
+
base.configure(:device_orientation) do |device_orientation, options|
|
48
|
+
options[:desired_capabilities]['deviceOrientation'] = device_orientation
|
49
|
+
end
|
40
50
|
end
|
41
51
|
end
|
42
52
|
|
@@ -97,8 +97,6 @@ module MediawikiSelenium::BrowserFactory
|
|
97
97
|
before do
|
98
98
|
expect(Selenium::WebDriver::Remote::Capabilities).to receive(browser_name).
|
99
99
|
at_least(:once).and_return(capabilities)
|
100
|
-
expect(capabilities).to receive(:browser_name).
|
101
|
-
at_least(:once).and_return(browser_name)
|
102
100
|
end
|
103
101
|
|
104
102
|
it 'creates a new Watir::Browser' do
|
@@ -16,10 +16,18 @@ module MediawikiSelenium::BrowserFactory
|
|
16
16
|
describe '#browser_options' do
|
17
17
|
subject { factory.browser_options(config) }
|
18
18
|
|
19
|
+
let(:config) { {} }
|
19
20
|
let(:profile) { double(Selenium::WebDriver::Firefox::Profile) }
|
20
21
|
|
21
22
|
before do
|
22
|
-
|
23
|
+
allow(Selenium::WebDriver::Firefox::Profile).to receive(:new).and_return(profile)
|
24
|
+
allow(profile).to receive(:[]=)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'attempts to disable any firtrun page' do
|
28
|
+
expect(profile).to receive(:[]=).with('browser.startup.homepage_override.mstone', 'ignore')
|
29
|
+
|
30
|
+
subject
|
23
31
|
end
|
24
32
|
|
25
33
|
context 'given a browser proxy' do
|
@@ -42,13 +50,11 @@ module MediawikiSelenium::BrowserFactory
|
|
42
50
|
|
43
51
|
it 'sets dom.max_script_run_time to the given number' do
|
44
52
|
expect(profile).to receive(:[]=).with('dom.max_script_run_time', 30)
|
45
|
-
allow(profile).to receive(:[]=)
|
46
53
|
subject
|
47
54
|
end
|
48
55
|
|
49
56
|
it 'sets dom.max_chrome_script_run_time to the given number' do
|
50
57
|
expect(profile).to receive(:[]=).with('dom.max_chrome_script_run_time', 30)
|
51
|
-
allow(profile).to receive(:[]=)
|
52
58
|
subject
|
53
59
|
end
|
54
60
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module MediawikiSelenium
|
4
|
+
describe BrowserFactory do
|
5
|
+
describe '.new' do
|
6
|
+
context 'given a browser that has a specific implementation' do
|
7
|
+
subject { BrowserFactory.new(:firefox) }
|
8
|
+
|
9
|
+
it 'instantiates the concrete factory class' do
|
10
|
+
expect(subject).to be_a(BrowserFactory::Firefox)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'given a browser that has no specific implementation' do
|
15
|
+
subject { BrowserFactory.new(:lynx) }
|
16
|
+
|
17
|
+
it { is_expected.to be_a(BrowserFactory::Base) }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -47,6 +47,24 @@ module MediawikiSelenium
|
|
47
47
|
subject
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
context 'given a device name' do
|
52
|
+
let(:config) { { device_name: 'tabliphone' } }
|
53
|
+
|
54
|
+
it 'configures the deviceName' do
|
55
|
+
expect(capabilities).to receive(:[]=).with('deviceName', 'tabliphone')
|
56
|
+
subject
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'given a device orientation' do
|
61
|
+
let(:config) { { device_orientation: 'portrait' } }
|
62
|
+
|
63
|
+
it 'configures the deviceOrientation' do
|
64
|
+
expect(capabilities).to receive(:[]=).with('deviceOrientation', 'portrait')
|
65
|
+
subject
|
66
|
+
end
|
67
|
+
end
|
50
68
|
end
|
51
69
|
|
52
70
|
describe '#teardown' do
|
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.6.
|
4
|
+
version: 1.6.3
|
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-
|
16
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: cucumber
|
@@ -329,6 +329,7 @@ files:
|
|
329
329
|
- LICENSE
|
330
330
|
- README.md
|
331
331
|
- RELEASES.md
|
332
|
+
- Rakefile
|
332
333
|
- UPGRADE.md
|
333
334
|
- bin/mediawiki-selenium-init
|
334
335
|
- features/api.feature
|
@@ -337,6 +338,7 @@ files:
|
|
337
338
|
- features/recording.feature
|
338
339
|
- features/rspec.feature
|
339
340
|
- features/saucelabs.feature
|
341
|
+
- features/saucelabs_browsers.feature
|
340
342
|
- features/screenshots.feature
|
341
343
|
- features/step_definitions/api_helper_steps.rb
|
342
344
|
- features/step_definitions/browser_steps.rb
|
@@ -395,6 +397,7 @@ files:
|
|
395
397
|
- spec/browser_factory/chrome_spec.rb
|
396
398
|
- spec/browser_factory/firefox_spec.rb
|
397
399
|
- spec/browser_factory/phantomjs_spec.rb
|
400
|
+
- spec/browser_factory_spec.rb
|
398
401
|
- spec/environment_spec.rb
|
399
402
|
- spec/headless_helper_spec.rb
|
400
403
|
- spec/page_factory_spec.rb
|
@@ -425,7 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
425
428
|
version: '0'
|
426
429
|
requirements: []
|
427
430
|
rubyforge_project:
|
428
|
-
rubygems_version: 2.4.
|
431
|
+
rubygems_version: 2.4.5.1
|
429
432
|
signing_key:
|
430
433
|
specification_version: 4
|
431
434
|
summary: An easy way to run MediaWiki Selenium tests.
|