mediawiki_selenium 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffa3ecc9539e538abf8730f38ba611ded2b25006
4
- data.tar.gz: 85ab4f6ebb1f28a385df0c95a492ee24d9d1ed78
3
+ metadata.gz: ccc71f5c503fa3584924d25edd822abfeeb12f3b
4
+ data.tar.gz: 31f7478f1fc2748f507c63430a6f2674828726f2
5
5
  SHA512:
6
- metadata.gz: 70bc364392d8c6d5e9264d610858f4565abe5eeb0e55ba440fb76b280a65e2be8e33e78e1f7122225b0fef11c913a3425279ce91f7627ed85a2fc6ac0ff882ba
7
- data.tar.gz: 50b31211b5b9e1eae9611ddf1c18e5861b2381e78a085f140a1d1d43cee831f00853ffb838c24a151519fba1d98e36340937fbf42d930f50259eaef9bc93bf26
6
+ metadata.gz: 7569d7793812924083b35cf74c0dc53c96e620ecd6ee376b1f82049d36cbd4e0acbea561c64161fd1f460d99e861bcedabd9575e1fa185c4a755075b15548db7
7
+ data.tar.gz: ba8f9c33ed6b3e0a4a25be14dea34ea881fd0353df65096fd80881ccd88b6b89787de9a1a7c65d38d0e3d95a40c9c3fe99efcd440188271db8793a073da4a702
data/README.md CHANGED
@@ -36,8 +36,9 @@ Windows.
36
36
  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
+ Replace `x.x.x` with version number from `lib/mediawiki_selenium/version.rb`.
39
40
 
40
- gem 'mediawiki_selenium', '~> 1.6.3'
41
+ gem 'mediawiki_selenium', '~> x.x.x'
41
42
 
42
43
  Install the gem and its dependencies by running `bundle install`. (If
43
44
  [Bundler](http://bundler.io/) is not yet installed, install it with
@@ -232,7 +233,7 @@ When you're ready to cut a new release, increase the major/minor/patch version (
232
233
  - Bug fixes
233
234
  - Possible incompatibilities
234
235
 
235
- Update gem version in `README.md`, `UPGRADE.md` and `lib/mediawiki_selenium/version.rb`. Add release notes to `RELEASES.md`.
236
+ Update gem version in `lib/mediawiki_selenium/version.rb`. Add release notes to `RELEASES.md`.
236
237
 
237
238
  ### Step 2
238
239
 
@@ -249,35 +250,15 @@ When the commit is merged into master branch, fetch it and verify the commit is
249
250
 
250
251
  ### Step 4
251
252
 
252
- Tag the commit, for example:
253
+ This assumes you have working Ruby, RubyGems, RubyGems.org account and are an owner of the gem at the site.
253
254
 
254
- $ git fetch --tags
255
- $ git log --oneline --decorate
256
- 123abcd (HEAD, origin/master, origin/HEAD, master, T108873) Release minor version 1.5.1
257
- ...
258
- $ git tag 1.5.1 123abcd
259
- $ git push --tags
260
-
261
- ### Step 5
262
-
263
- Build the gem, for example:
264
-
265
- $ gem build mediawiki_selenium.gemspec
266
- Successfully built RubyGem
267
- Name: mediawiki_selenium
268
- Version: 1.5.1
269
- File: mediawiki_selenium-1.5.1.gem
270
-
271
- The above gem assumes you have working Ruby and RubyGems.
272
-
273
- ### Step 6
274
-
275
- Push the gem to RubyGems.org, for example:
276
-
277
- $ gem push mediawiki_selenium-1.5.1.gem
278
- ...
255
+ Release the gem:
279
256
 
280
- The last step assumes you have RubyGems.org account and are owner of the gem at the site.
257
+ $ bundle exec rake release
258
+ mediawiki_selenium x.x.x built to pkg/mediawiki_selenium-x.x.x.gem.
259
+ Tagged vx.x.x.
260
+ Pushed git commits and tags.
261
+ Pushed mediawiki_selenium x.x.x to rubygems.org.
281
262
 
282
263
  ### Step 7
283
264
 
@@ -1,5 +1,9 @@
1
1
  ## Release notes
2
2
 
3
+ ### 1.6.4 2016-01-27
4
+
5
+ * Log SauceLabs session URLs via Cucumber logger embeds
6
+
3
7
  ### 1.6.3 2015-12-15
4
8
 
5
9
  * Added support for all SauceLabs provided browsers
data/UPGRADE.md CHANGED
@@ -9,8 +9,9 @@ in the root directory of your project.
9
9
 
10
10
  First, update the `Gemfile` in your project's root directory to specify the
11
11
  new version.
12
+ Replace `x.x.x` with version number from `lib/mediawiki_selenium/version.rb`.
12
13
 
13
- gem 'mediawiki_selenium', '~> 1.6.3'
14
+ gem 'mediawiki_selenium', '~> x.x.x'
14
15
 
15
16
  ### Update `require` paths in `env.rb`
16
17
 
@@ -36,8 +37,9 @@ if they don't apply to your test cases. The only must have is the first
36
37
 
37
38
  First, update the `Gemfile` in your project's root directory to specify the
38
39
  new version.
40
+ Replace `x.x.x` with version number from `lib/mediawiki_selenium/version.rb`.
39
41
 
40
- gem 'mediawiki_selenium', '~> 1.6.3'
42
+ gem 'mediawiki_selenium', '~> x.x.x'
41
43
 
42
44
  ### Upgrade gems and dependencies
43
45
 
@@ -4,6 +4,7 @@ module MediawikiSelenium
4
4
  autoload :BrowserFactory, 'mediawiki_selenium/browser_factory'
5
5
  autoload :ConfigurationError, 'mediawiki_selenium/configuration_error'
6
6
  autoload :Environment, 'mediawiki_selenium/environment'
7
+ autoload :EmbedBrowserSession, 'mediawiki_selenium/cucumber/embed_browser_session'
7
8
  autoload :HeadlessHelper, 'mediawiki_selenium/helpers/headless_helper'
8
9
  autoload :Initializer, 'mediawiki_selenium/initializer'
9
10
  autoload :LoginHelper, 'mediawiki_selenium/helpers/login_helper'
@@ -0,0 +1,18 @@
1
+ module MediawikiSelenium
2
+ # Embeds the browser session upon creation into the active Cucumber logger.
3
+ #
4
+ module EmbedBrowserSession
5
+ # Embeds the browser session into the active Cucumber logger(s) as soon as
6
+ # {Environment} is done creating it. Note that the
7
+ # 'application/vnd.webdriver-session-id' MIME used for the embedding is
8
+ # made up for this purpose.
9
+ #
10
+ # @see Environment#browser
11
+ #
12
+ def browser
13
+ super.tap do |b|
14
+ embed(b.driver.session_id, 'application/vnd.webdriver-session-id')
15
+ end
16
+ end
17
+ end
18
+ end
@@ -9,4 +9,5 @@ World(MediawikiSelenium::LoginHelper)
9
9
  World(MediawikiSelenium::PageFactory)
10
10
  World(MediawikiSelenium::ScreenshotHelper)
11
11
  World(MediawikiSelenium::StrictPending)
12
+ World(MediawikiSelenium::EmbedBrowserSession)
12
13
  World(MediawikiSelenium::UserFactoryHelper)
@@ -1,17 +1,28 @@
1
1
  require 'cucumber/formatter/junit'
2
2
  require 'mediawiki_selenium/remote_browser_factory'
3
+ require 'set'
3
4
 
4
5
  module Cucumber::Formatter
5
6
  class Sauce < Junit
7
+ def before_steps(_steps)
8
+ @sids = Set.new
9
+
10
+ super
11
+ end
12
+
13
+ def embed(session_id, mime, _label)
14
+ return unless mime == 'application/vnd.webdriver-session-id'
15
+
16
+ @sids << session_id
17
+ end
18
+
6
19
  private
7
20
 
8
21
  def format_exception(exception)
9
- sids = MediawikiSelenium::RemoteBrowserFactory.last_session_ids
10
-
11
- if sids.nil? || sids.empty?
22
+ if @sids.nil? || @sids.empty?
12
23
  message = 'Uh-oh. Could not find link to Sauce Labs job URL.'
13
24
  else
14
- message = sids.map { |sid| "Sauce Labs job URL: http://saucelabs.com/jobs/#{sid}\n" }.join
25
+ message = @sids.map { |sid| "Sauce Labs job URL: http://saucelabs.com/jobs/#{sid}\n" }.join
15
26
  end
16
27
 
17
28
  msgs = [message] + ["#{exception.message} (#{exception.class})"] + exception.backtrace
@@ -16,37 +16,32 @@ module MediawikiSelenium
16
16
  REQUIRED_CONFIG = [:sauce_ondemand_username, :sauce_ondemand_access_key]
17
17
  URL = 'http://ondemand.saucelabs.com/wd/hub'
18
18
 
19
- class << self
20
- # @attr [Array] SauceLabs job IDs from the most recent sessions.
21
- attr_accessor :last_session_ids
19
+ def self.extend_object(base)
20
+ return if base.is_a?(self)
22
21
 
23
- def extend_object(base)
24
- return if base.is_a?(self)
22
+ super
25
23
 
26
- super
24
+ base.configure(:sauce_ondemand_username, :sauce_ondemand_access_key) do |user, key, options|
25
+ options[:url] = URI.parse(URL)
27
26
 
28
- base.configure(:sauce_ondemand_username, :sauce_ondemand_access_key) do |user, key, options|
29
- options[:url] = URI.parse(URL)
30
-
31
- options[:url].user = user
32
- options[:url].password = key
33
- end
27
+ options[:url].user = user
28
+ options[:url].password = key
29
+ end
34
30
 
35
- base.configure(:platform) do |platform, options|
36
- options[:desired_capabilities].platform = platform
37
- end
31
+ base.configure(:platform) do |platform, options|
32
+ options[:desired_capabilities].platform = platform
33
+ end
38
34
 
39
- base.configure(:version) do |version, options|
40
- options[:desired_capabilities].version = version
41
- end
35
+ base.configure(:version) do |version, options|
36
+ options[:desired_capabilities].version = version
37
+ end
42
38
 
43
- base.configure(:device_name) do |device_name, options|
44
- options[:desired_capabilities]['deviceName'] = device_name
45
- end
39
+ base.configure(:device_name) do |device_name, options|
40
+ options[:desired_capabilities]['deviceName'] = device_name
41
+ end
46
42
 
47
- base.configure(:device_orientation) do |device_orientation, options|
48
- options[:desired_capabilities]['deviceOrientation'] = device_orientation
49
- end
43
+ base.configure(:device_orientation) do |device_orientation, options|
44
+ options[:desired_capabilities]['deviceOrientation'] = device_orientation
50
45
  end
51
46
  end
52
47
 
@@ -55,8 +50,6 @@ module MediawikiSelenium
55
50
  def teardown(env, status)
56
51
  artifacts = super
57
52
 
58
- RemoteBrowserFactory.last_session_ids = []
59
-
60
53
  each do |browser|
61
54
  sid = browser.driver.session_id
62
55
  username = env.lookup(:sauce_ondemand_username)
@@ -75,8 +68,6 @@ module MediawikiSelenium
75
68
  }.to_json
76
69
  )
77
70
 
78
- RemoteBrowserFactory.last_session_ids << sid
79
-
80
71
  artifacts["http://saucelabs.com/jobs/#{sid}"] = 'text/url'
81
72
  end
82
73
 
@@ -1,3 +1,3 @@
1
1
  module MediawikiSelenium
2
- VERSION = '1.6.3'
2
+ VERSION = '1.6.4'
3
3
  end
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_runtime_dependency 'syntax', '~> 1.2', '>= 1.2.0'
39
39
  spec.add_runtime_dependency 'thor', '~> 0.19', '>= 0.19.1'
40
40
 
41
+ spec.add_development_dependency 'rake', '~> 10.5'
41
42
  spec.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.3'
42
43
  spec.add_development_dependency 'yard', '~> 0.8', '>= 0.8.7.4'
43
44
  spec.add_development_dependency 'redcarpet', '~> 3.2', '>= 3.2.0'
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.3
4
+ version: 1.6.4
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-12-15 00:00:00.000000000 Z
16
+ date: 2016-01-27 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: cucumber
@@ -209,6 +209,20 @@ dependencies:
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
211
  version: 0.19.1
212
+ - !ruby/object:Gem::Dependency
213
+ name: rake
214
+ requirement: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - "~>"
217
+ - !ruby/object:Gem::Version
218
+ version: '10.5'
219
+ type: :development
220
+ prerelease: false
221
+ version_requirements: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - "~>"
224
+ - !ruby/object:Gem::Version
225
+ version: '10.5'
212
226
  - !ruby/object:Gem::Dependency
213
227
  name: bundler
214
228
  requirement: !ruby/object:Gem::Requirement
@@ -358,6 +372,7 @@ files:
358
372
  - lib/mediawiki_selenium/browser_factory/phantomjs.rb
359
373
  - lib/mediawiki_selenium/configuration_error.rb
360
374
  - lib/mediawiki_selenium/cucumber.rb
375
+ - lib/mediawiki_selenium/cucumber/embed_browser_session.rb
361
376
  - lib/mediawiki_selenium/cucumber/env.rb
362
377
  - lib/mediawiki_selenium/cucumber/hooks.rb
363
378
  - lib/mediawiki_selenium/cucumber/sauce.rb