mediawiki_selenium 1.6.1 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01bb1e36bd275e158439389152f9f0e75df02ee6
4
- data.tar.gz: 6b5c1825eeeb66c8551de98bf2de03ce8637207b
3
+ metadata.gz: c55bb41a3040b8fe13f7959cb9471870fb964c47
4
+ data.tar.gz: d8dee93ee8a956288de1ae1e412e3512a2427689
5
5
  SHA512:
6
- metadata.gz: f600a40695ac3fa6d2876ad0458318e63b75acf15d60e072c7693a9b24bb6d05f347eaa9cc236614e848ed30bdeb779a60f8a62b8a0988005aaf96a0323b73d2
7
- data.tar.gz: 03493b1449b8d70a92a1221b5e6c80a2cfe89faec2290b889b68156c36c3e7dfd0cf83b72b66ebee859b679580db818a11940f32adeb4bd80997a1fa1e28b859
6
+ metadata.gz: 86045429284cab2eea77d9c5a2a8f76e7922d982c5ebb728e644ceea15b7126085a26872dd4790fe147f5bfd25f01e77a6baad6d4cbe515de1303dcc5b28fe5f
7
+ data.tar.gz: fc39ea530db1f558c0f61261b012e555bc6bc308b3ec17ce53330ae3a872f59f1fbbe28dda10c351d66b6dac982f74190ac5326cdee9bd1b50797ab6ff44968d
data/RELEASES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Release notes
2
2
 
3
+ ### 1.6.2 2015-10-23
4
+ * Fixed undefined `last_session_ids=` method bug in `RemoteBrowserFactory`
5
+ which entirely broke SauceLabs use in previous 1.6.x versions
6
+
3
7
  ### 1.6.1 2015-09-29
4
8
  * Fixed bug in `UserFactory#user` and `UserFactory#password` that caused the
5
9
  incorrect resolution of alternative users/passwords when in the context of
data/UPGRADE.md CHANGED
@@ -3,14 +3,14 @@
3
3
  You can check your current version by running `bundle list mediawiki_selenium`
4
4
  in the root directory of your project.
5
5
 
6
- ## From 1.x releases to 1.6.0
6
+ ## From 1.x releases to 1.6.x
7
7
 
8
8
  ### Update your `Gemfile`
9
9
 
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.0'
13
+ gem 'mediawiki_selenium', '~> 1.6.2'
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.0'
40
+ gem 'mediawiki_selenium', '~> 1.6.2'
41
41
 
42
42
  ### Upgrade gems and dependencies
43
43
 
@@ -45,13 +45,12 @@ module MediawikiSelenium
45
45
  def teardown(env, status)
46
46
  artifacts = super
47
47
 
48
- self.class.last_session_ids = []
48
+ RemoteBrowserFactory.last_session_ids = []
49
49
 
50
50
  each do |browser|
51
51
  sid = browser.driver.session_id
52
- url = browser.driver.send(:bridge).http.send(:server_url)
53
- username = url.user
54
- key = url.password
52
+ username = env.lookup(:sauce_ondemand_username)
53
+ key = env.lookup(:sauce_ondemand_access_key)
55
54
 
56
55
  RestClient::Request.execute(
57
56
  method: :put,
@@ -66,7 +65,7 @@ module MediawikiSelenium
66
65
  }.to_json
67
66
  )
68
67
 
69
- self.class.last_session_ids << sid
68
+ RemoteBrowserFactory.last_session_ids << sid
70
69
 
71
70
  artifacts["http://saucelabs.com/jobs/#{sid}"] = 'text/url'
72
71
  end
@@ -1,3 +1,3 @@
1
1
  module MediawikiSelenium
2
- VERSION = '1.6.1'
2
+ VERSION = '1.6.2'
3
3
  end
@@ -1,4 +1,6 @@
1
+ require 'rest_client'
1
2
  require 'spec_helper'
3
+
2
4
  require 'mediawiki_selenium/browser_factory/base'
3
5
 
4
6
  module MediawikiSelenium
@@ -46,5 +48,43 @@ module MediawikiSelenium
46
48
  end
47
49
  end
48
50
  end
51
+
52
+ describe '#teardown' do
53
+ subject { factory.teardown(env, status) }
54
+
55
+ let(:config) do
56
+ {
57
+ sauce_ondemand_username: 'foo',
58
+ sauce_ondemand_access_key: 'bar',
59
+ build_number: 'b123'
60
+ }
61
+ end
62
+
63
+ let(:env) { Environment.new(config) }
64
+ let(:status) { :passed }
65
+
66
+ before do
67
+ browser = double('Watir::Browser')
68
+ driver = double('Selenium::WebDriver::Driver')
69
+
70
+ expect(factory).to receive(:each).and_yield(browser)
71
+ expect(browser).to receive(:driver).and_return(driver)
72
+ expect(driver).to receive(:session_id).and_return('123')
73
+ end
74
+
75
+ it 'updates the SauceLabs session for each browser and returns the URL as an artifact' do
76
+ expect(RestClient::Request).to receive(:execute).with(
77
+ method: :put,
78
+ url: 'https://saucelabs.com/rest/v1/foo/jobs/123',
79
+ user: 'foo',
80
+ password: 'bar',
81
+ headers: { content_type: 'application/json' },
82
+ payload: '{"public":true,"passed":true,"build":"b123"}'
83
+ )
84
+
85
+ expect(subject).to include('http://saucelabs.com/jobs/123')
86
+ expect(subject['http://saucelabs.com/jobs/123']).to eq('text/url')
87
+ end
88
+ end
49
89
  end
50
90
  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: 1.6.1
4
+ version: 1.6.2
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-09-29 00:00:00.000000000 Z
16
+ date: 2015-10-26 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: cucumber