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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +23 -1
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -4
  6. data/UPGRADE.md +1 -1
  7. data/bin/mediawiki-selenium-init +1 -1
  8. data/lib/mediawiki_selenium/browser_factory/base.rb +8 -8
  9. data/lib/mediawiki_selenium/browser_factory/chrome.rb +1 -1
  10. data/lib/mediawiki_selenium/browser_factory/firefox.rb +4 -4
  11. data/lib/mediawiki_selenium/browser_factory/phantomjs.rb +2 -2
  12. data/lib/mediawiki_selenium/browser_factory.rb +5 -5
  13. data/lib/mediawiki_selenium/environment.rb +15 -14
  14. data/lib/mediawiki_selenium/initializer.rb +4 -4
  15. data/lib/mediawiki_selenium/page_factory.rb +1 -1
  16. data/lib/mediawiki_selenium/remote_browser_factory.rb +12 -8
  17. data/lib/mediawiki_selenium/step_definitions/login_steps.rb +0 -11
  18. data/lib/mediawiki_selenium/step_definitions/navigation_steps.rb +0 -11
  19. data/lib/mediawiki_selenium/step_definitions/preferences_steps.rb +0 -11
  20. data/lib/mediawiki_selenium/step_definitions/resource_loader_steps.rb +0 -11
  21. data/lib/mediawiki_selenium/step_definitions/upload_file_steps.rb +3 -3
  22. data/lib/mediawiki_selenium/step_definitions.rb +5 -5
  23. data/lib/mediawiki_selenium/support/env.rb +5 -16
  24. data/lib/mediawiki_selenium/support/hooks.rb +15 -26
  25. data/lib/mediawiki_selenium/support/modules/api_helper.rb +5 -7
  26. data/lib/mediawiki_selenium/support/pages/api_page.rb +6 -6
  27. data/lib/mediawiki_selenium/support/pages/login_page.rb +13 -12
  28. data/lib/mediawiki_selenium/support/pages/random_page.rb +2 -2
  29. data/lib/mediawiki_selenium/support/pages/reset_preferences_page.rb +3 -3
  30. data/lib/mediawiki_selenium/support/pages.rb +4 -4
  31. data/lib/mediawiki_selenium/support/sauce.rb +14 -18
  32. data/lib/mediawiki_selenium/support.rb +4 -4
  33. data/lib/mediawiki_selenium/version.rb +1 -12
  34. data/lib/mediawiki_selenium/warnings_formatter.rb +15 -15
  35. data/lib/mediawiki_selenium.rb +8 -19
  36. data/mediawiki_selenium.gemspec +35 -28
  37. data/spec/api_helper_spec.rb +25 -25
  38. data/spec/browser_factory/base_spec.rb +50 -46
  39. data/spec/browser_factory/chrome_spec.rb +11 -11
  40. data/spec/browser_factory/firefox_spec.rb +17 -17
  41. data/spec/browser_factory/phantomjs_spec.rb +11 -11
  42. data/spec/environment_spec.rb +194 -159
  43. data/spec/page_factory_spec.rb +12 -12
  44. data/spec/remote_browser_factory_spec.rb +15 -15
  45. data/spec/spec_helper.rb +2 -2
  46. data/templates/tests/browser/features/support/env.rb +3 -3
  47. metadata +9 -9
  48. data/.rubocop_todo.yml +0 -160
@@ -1,11 +1,11 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module MediawikiSelenium::BrowserFactory
4
4
  describe Chrome do
5
5
  let(:factory_class) { Chrome }
6
6
  let(:factory) { factory_class.new(:chrome) }
7
7
 
8
- describe ".default_bindings" do
8
+ describe '.default_bindings' do
9
9
  subject { factory_class.default_bindings }
10
10
 
11
11
  it { is_expected.to include(:browser_language) }
@@ -13,22 +13,22 @@ module MediawikiSelenium::BrowserFactory
13
13
  it { is_expected.to include(:browser_user_agent) }
14
14
  end
15
15
 
16
- describe "#browser_options" do
16
+ describe '#browser_options' do
17
17
  subject { factory.browser_options(config) }
18
18
 
19
- context "given a custom browser_language" do
20
- let(:config) { { browser_language: "eo" } }
19
+ context 'given a custom browser_language' do
20
+ let(:config) { { browser_language: 'eo' } }
21
21
 
22
- it "sets the intl.accept_languages preference to the given language" do
23
- expect(subject[:prefs]).to include("intl.accept_languages" => "eo")
22
+ it 'sets the intl.accept_languages preference to the given language' do
23
+ expect(subject[:prefs]).to include('intl.accept_languages' => 'eo')
24
24
  end
25
25
  end
26
26
 
27
- context "given a custom browser_user_agent" do
28
- let(:config) { { browser_user_agent: "FooBot" } }
27
+ context 'given a custom browser_user_agent' do
28
+ let(:config) { { browser_user_agent: 'FooBot' } }
29
29
 
30
- it "includes it as --user-agent in the chrome arguments" do
31
- expect(subject[:args]).to include("--user-agent=FooBot")
30
+ it 'includes it as --user-agent in the chrome arguments' do
31
+ expect(subject[:args]).to include('--user-agent=FooBot')
32
32
  end
33
33
  end
34
34
  end
@@ -1,11 +1,11 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module MediawikiSelenium::BrowserFactory
4
4
  describe Firefox do
5
5
  let(:factory_class) { Firefox }
6
6
  let(:factory) { factory_class.new(:firefox) }
7
7
 
8
- describe ".default_bindings" do
8
+ describe '.default_bindings' do
9
9
  subject { factory_class.default_bindings }
10
10
 
11
11
  it { is_expected.to include(:browser_language) }
@@ -13,7 +13,7 @@ module MediawikiSelenium::BrowserFactory
13
13
  it { is_expected.to include(:browser_user_agent) }
14
14
  end
15
15
 
16
- describe "#browser_options" do
16
+ describe '#browser_options' do
17
17
  subject { factory.browser_options(config) }
18
18
 
19
19
  let(:profile) { double(Selenium::WebDriver::Firefox::Profile) }
@@ -22,36 +22,36 @@ module MediawikiSelenium::BrowserFactory
22
22
  expect(Selenium::WebDriver::Firefox::Profile).to receive(:new).and_return(profile)
23
23
  end
24
24
 
25
- context "given a custom browser_timeout" do
26
- let(:config) { { browser_timeout: "30" } }
25
+ context 'given a custom browser_timeout' do
26
+ let(:config) { { browser_timeout: '30' } }
27
27
 
28
- it "sets dom.max_script_run_time to the given number" do
29
- expect(profile).to receive(:[]=).with("dom.max_script_run_time", 30)
28
+ it 'sets dom.max_script_run_time to the given number' do
29
+ expect(profile).to receive(:[]=).with('dom.max_script_run_time', 30)
30
30
  allow(profile).to receive(:[]=)
31
31
  subject
32
32
  end
33
33
 
34
- it "sets dom.max_chrome_script_run_time to the given number" do
35
- expect(profile).to receive(:[]=).with("dom.max_chrome_script_run_time", 30)
34
+ it 'sets dom.max_chrome_script_run_time to the given number' do
35
+ expect(profile).to receive(:[]=).with('dom.max_chrome_script_run_time', 30)
36
36
  allow(profile).to receive(:[]=)
37
37
  subject
38
38
  end
39
39
  end
40
40
 
41
- context "given a custom browser_language" do
42
- let(:config) { { browser_language: "eo" } }
41
+ context 'given a custom browser_language' do
42
+ let(:config) { { browser_language: 'eo' } }
43
43
 
44
- it "sets intl.accept_languages to the given language" do
45
- expect(profile).to receive(:[]=).with("intl.accept_languages", "eo")
44
+ it 'sets intl.accept_languages to the given language' do
45
+ expect(profile).to receive(:[]=).with('intl.accept_languages', 'eo')
46
46
  subject
47
47
  end
48
48
  end
49
49
 
50
- context "given a custom browser_user_agent" do
51
- let(:config) { { browser_user_agent: "FooBot" } }
50
+ context 'given a custom browser_user_agent' do
51
+ let(:config) { { browser_user_agent: 'FooBot' } }
52
52
 
53
- it "sets general.useragent.override to the given string" do
54
- expect(profile).to receive(:[]=).with("general.useragent.override", "FooBot")
53
+ it 'sets general.useragent.override to the given string' do
54
+ expect(profile).to receive(:[]=).with('general.useragent.override', 'FooBot')
55
55
  subject
56
56
  end
57
57
  end
@@ -1,11 +1,11 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module MediawikiSelenium::BrowserFactory
4
4
  describe Phantomjs do
5
5
  let(:factory_class) { Phantomjs }
6
6
  let(:factory) { factory_class.new(:phantomjs) }
7
7
 
8
- describe ".default_bindings" do
8
+ describe '.default_bindings' do
9
9
  subject { factory_class.default_bindings }
10
10
 
11
11
  it { is_expected.to include(:browser_language) }
@@ -13,24 +13,24 @@ module MediawikiSelenium::BrowserFactory
13
13
  it { is_expected.to include(:browser_user_agent) }
14
14
  end
15
15
 
16
- describe "#browser_options" do
16
+ describe '#browser_options' do
17
17
  subject { factory.browser_options(config) }
18
18
 
19
- context "given a custom browser_language" do
20
- let(:config) { { browser_language: "eo" } }
19
+ context 'given a custom browser_language' do
20
+ let(:config) { { browser_language: 'eo' } }
21
21
 
22
- it "sets phantomjs.page.customHeaders.Accept-Language to the given language" do
22
+ it 'sets phantomjs.page.customHeaders.Accept-Language to the given language' do
23
23
  capabilities = subject[:desired_capabilities]
24
- expect(capabilities["phantomjs.page.customHeaders.Accept-Language"]).to eq("eo")
24
+ expect(capabilities['phantomjs.page.customHeaders.Accept-Language']).to eq('eo')
25
25
  end
26
26
  end
27
27
 
28
- context "given a custom browser_user_agent" do
29
- let(:config) { { browser_user_agent: "FooBot" } }
28
+ context 'given a custom browser_user_agent' do
29
+ let(:config) { { browser_user_agent: 'FooBot' } }
30
30
 
31
- it "sets phantomjs.page.settings.userAgent to the given string" do
31
+ it 'sets phantomjs.page.settings.userAgent to the given string' do
32
32
  capabilities = subject[:desired_capabilities]
33
- expect(capabilities["phantomjs.page.settings.userAgent"]).to eq("FooBot")
33
+ expect(capabilities['phantomjs.page.settings.userAgent']).to eq('FooBot')
34
34
  end
35
35
  end
36
36
  end