selenium-connect 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.coveralls.yml +1 -0
- data/.gitignore +1 -0
- data/.rspec +6 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +16 -0
- data/Guardfile +6 -0
- data/README.md +121 -16
- data/Rakefile +36 -12
- data/lib/selenium-connect.rb +3 -82
- data/lib/selenium_connect.rb +49 -0
- data/lib/{selenium-connect → selenium_connect}/configuration.rb +4 -2
- data/lib/selenium_connect/job.rb +102 -0
- data/lib/selenium_connect/report/job_report.rb +17 -0
- data/lib/selenium_connect/report/main_report.rb +17 -0
- data/lib/selenium_connect/report/report_factory.rb +25 -0
- data/lib/{selenium-connect → selenium_connect}/runner.rb +9 -8
- data/lib/{selenium-connect → selenium_connect}/runners/chrome.rb +1 -1
- data/lib/{selenium-connect → selenium_connect}/runners/firefox.rb +1 -1
- data/lib/{selenium-connect → selenium_connect}/runners/ie.rb +1 -1
- data/lib/{selenium-connect → selenium_connect}/runners/no_browser.rb +1 -1
- data/lib/{selenium-connect → selenium_connect}/runners/phantomjs.rb +1 -1
- data/lib/{selenium-connect → selenium_connect}/runners/saucelabs.rb +2 -1
- data/lib/{selenium-connect → selenium_connect}/server.rb +2 -1
- data/selenium-connect.gemspec +9 -4
- data/spec/integration/lib/selenium_connect/runners/chrome_spec.rb +19 -0
- data/spec/integration/lib/selenium_connect/runners/firefox_spec.rb +55 -0
- data/spec/integration/lib/selenium_connect/runners/headless_spec.rb +33 -0
- data/spec/integration/lib/selenium_connect/runners/ie_spec.rb +24 -0
- data/spec/{runners → integration/lib/selenium_connect/runners}/phantomjs_spec.rb +4 -3
- data/spec/integration/lib/selenium_connect/runners/sauce_spec.rb +63 -0
- data/spec/integration/lib/selenium_connect_spec.rb +41 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/{example.yaml → support/example.yaml} +0 -0
- data/spec/{acceptance/helper.rb → support/example_page_object.rb} +1 -1
- data/spec/support/integration_helper.rb +9 -0
- data/spec/unit/lib/selenium-connect_spec.rb +15 -0
- data/spec/{configuration_spec.rb → unit/lib/selenium_connect/configuration_spec.rb} +9 -3
- data/spec/unit/lib/selenium_connect/job_spec.rb +38 -0
- data/spec/unit/lib/selenium_connect/report/job_report_spec.rb +20 -0
- data/spec/unit/lib/selenium_connect/report/main_report_spec.rb +20 -0
- data/spec/unit/lib/selenium_connect/report/report_factory_spec.rb +27 -0
- data/spec/unit/lib/selenium_connect/runners/.gitkeep +0 -0
- data/spec/unit/lib/selenium_connect_spec.rb +58 -0
- metadata +125 -29
- data/spec/acceptance/chrome_spec.rb +0 -21
- data/spec/acceptance/firefox_spec.rb +0 -62
- data/spec/acceptance/headless_spec.rb +0 -29
- data/spec/acceptance/ie_spec.rb +0 -21
- data/spec/acceptance/logging_spec.rb +0 -28
- data/spec/acceptance/sauce_spec.rb +0 -27
- data/spec/quit_and_finish_spec.rb +0 -14
- data/spec/yaml_spec.rb +0 -51
@@ -1,21 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
require_relative 'helper'
|
5
|
-
|
6
|
-
describe 'Chrome', selenium: true do
|
7
|
-
|
8
|
-
let(:google) { Google.new(SeleniumConnect.start) }
|
9
|
-
let(:quit) { SeleniumConnect.finish }
|
10
|
-
|
11
|
-
it 'localhost' do
|
12
|
-
# currently only works on Mac
|
13
|
-
SeleniumConnect.configure do |c|
|
14
|
-
c.browser = 'chrome'
|
15
|
-
end
|
16
|
-
google.visit
|
17
|
-
google.page_title.should include('Google')
|
18
|
-
quit
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
require_relative 'helper'
|
5
|
-
|
6
|
-
describe 'Firefox', selenium: true do
|
7
|
-
|
8
|
-
let(:google) { Google.new(SeleniumConnect.start) }
|
9
|
-
let(:quit) { SeleniumConnect.finish }
|
10
|
-
|
11
|
-
it 'blank config' do
|
12
|
-
SeleniumConnect.configure {}
|
13
|
-
google.visit
|
14
|
-
google.page_title.should include('Google')
|
15
|
-
quit
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'localhost' do
|
19
|
-
SeleniumConnect.configure do |c|
|
20
|
-
c.host = 'localhost'
|
21
|
-
end
|
22
|
-
google.visit
|
23
|
-
google.page_title.should include('Google')
|
24
|
-
quit
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'local jar file specified' do
|
28
|
-
SeleniumConnect.configure do |c|
|
29
|
-
c.host = 'localhost'
|
30
|
-
c.jar = "#{Dir.pwd}/bin/selenium-server-standalone-2.33.0.jar"
|
31
|
-
end
|
32
|
-
google.visit
|
33
|
-
google.page_title.should include('Google')
|
34
|
-
quit
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'profile name' do
|
38
|
-
pending 'requires machine setup to run, and need a public example'
|
39
|
-
SeleniumConnect.configure do |c|
|
40
|
-
c.profile_name = 'YourProfileNameGoesHere'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'profile path' do
|
45
|
-
pending 'need to add a profile to the repo'
|
46
|
-
SeleniumConnect.configure do |c|
|
47
|
-
c.profile_path = "#{Dir.pwd}/path/to/profile"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'browser path' do
|
52
|
-
# example only works on Mac
|
53
|
-
SeleniumConnect.configure do |c|
|
54
|
-
c.browser = 'firefox'
|
55
|
-
c.browser_path = '/Applications/Firefox.app/Contents/MacOS/firefox'
|
56
|
-
end
|
57
|
-
google.visit
|
58
|
-
google.page_title.should include('Google')
|
59
|
-
quit
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
require_relative 'helper'
|
5
|
-
|
6
|
-
describe 'Headless', selenium: true do
|
7
|
-
|
8
|
-
let(:google) { Google.new(SeleniumConnect.start) }
|
9
|
-
let(:quit) { SeleniumConnect.finish }
|
10
|
-
|
11
|
-
it 'should run a basic test with phantom js' do
|
12
|
-
SeleniumConnect.configure do |c|
|
13
|
-
c.browser = 'phantomjs'
|
14
|
-
end
|
15
|
-
google.visit
|
16
|
-
google.page_title.should include('Google')
|
17
|
-
quit
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should not find something on a page' do
|
21
|
-
SeleniumConnect.configure do |c|
|
22
|
-
c.browser = 'phantomjs'
|
23
|
-
end
|
24
|
-
google.visit
|
25
|
-
google.page_title.should_not include('Poogle')
|
26
|
-
quit
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
data/spec/acceptance/ie_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
require_relative 'helper'
|
5
|
-
|
6
|
-
describe 'IE', selenium: true do
|
7
|
-
|
8
|
-
let(:google) { Google.new(SeleniumConnect.start) }
|
9
|
-
let(:quit) { SeleniumConnect.finish }
|
10
|
-
|
11
|
-
it 'with Selenium Grid' do
|
12
|
-
pending
|
13
|
-
SeleniumConnect.configure do |c|
|
14
|
-
c.host = '192.168.1.139'
|
15
|
-
c.browser = 'ie'
|
16
|
-
end
|
17
|
-
driver.get 'https://mashup.ic.mantech.com/ispace'
|
18
|
-
quit
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
require_relative 'helper'
|
5
|
-
|
6
|
-
describe 'Logging', selenium: true do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@log_dir = 'build'
|
10
|
-
|
11
|
-
SeleniumConnect.configure do |c|
|
12
|
-
c.log = @log_dir
|
13
|
-
end
|
14
|
-
|
15
|
-
Google.new(SeleniumConnect.start).visit
|
16
|
-
SeleniumConnect.finish
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'server' do
|
20
|
-
server_log = File.read(@log_dir + '/server.log')
|
21
|
-
server_log.empty?.should be false
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'browser' do
|
25
|
-
browser_log = File.read(@log_dir + '/firefox.log')
|
26
|
-
browser_log.empty?.should be false
|
27
|
-
end
|
28
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
|
5
|
-
describe 'Sauce Labs', selenium: true do
|
6
|
-
|
7
|
-
it 'hello world' do
|
8
|
-
SeleniumConnect.configure do |c|
|
9
|
-
c.log = File.join('build', 'tmp')
|
10
|
-
c.host = 'saucelabs'
|
11
|
-
c.sauce_username = 'testing_arrgyle'
|
12
|
-
c.sauce_api_key = 'ab7a6e17-16df-42d2-9ef6-c8d2539cc38a'
|
13
|
-
c.os = 'windows'
|
14
|
-
c.browser = 'iexplore'
|
15
|
-
c.browser_version = '7'
|
16
|
-
c.description = 'hello world from selenium-connect!'
|
17
|
-
end
|
18
|
-
driver = SeleniumConnect.start
|
19
|
-
driver.get 'http://google.com'
|
20
|
-
driver.title.should include('Google')
|
21
|
-
id = driver.session_id
|
22
|
-
data = SeleniumConnect.finish
|
23
|
-
File.exist?(File.join(Dir.pwd, 'build', 'tmp', "sauce_job_#{id}.log")).should be_true
|
24
|
-
data.empty?.should be_false
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
|
5
|
-
describe 'Quit and Finish', selenium: true do
|
6
|
-
|
7
|
-
it 'quit when already finished doesn\'t blow up' do
|
8
|
-
SeleniumConnect.configure {}
|
9
|
-
@driver = SeleniumConnect.start
|
10
|
-
@driver.quit
|
11
|
-
SeleniumConnect.finish
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
data/spec/yaml_spec.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require 'selenium-connect'
|
4
|
-
|
5
|
-
describe 'YAML' do
|
6
|
-
|
7
|
-
it 'setting config_file returns a proper config object' do
|
8
|
-
SeleniumConnect.configure do |c|
|
9
|
-
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
10
|
-
end
|
11
|
-
config = SeleniumConnect.debug_config
|
12
|
-
config.class.should eq SeleniumConnect::Configuration
|
13
|
-
config.inspect.empty?.should be_false
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'chrome', wip: true, selenium: true do
|
17
|
-
SeleniumConnect.configure do |c|
|
18
|
-
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
19
|
-
end
|
20
|
-
driver = SeleniumConnect.start
|
21
|
-
driver.get 'http://google.com'
|
22
|
-
SeleniumConnect.finish
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'chrome', wip: true, selenium: true do
|
26
|
-
SeleniumConnect.configure do |c|
|
27
|
-
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
28
|
-
end
|
29
|
-
driver = SeleniumConnect.start
|
30
|
-
driver.get 'http://google.com'
|
31
|
-
SeleniumConnect.finish
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'chrome', wip: true, selenium: true do
|
35
|
-
SeleniumConnect.configure do |c|
|
36
|
-
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
37
|
-
end
|
38
|
-
driver = SeleniumConnect.start
|
39
|
-
driver.get 'http://google.com'
|
40
|
-
SeleniumConnect.finish
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'chrome', wip: true, selenium: true do
|
44
|
-
SeleniumConnect.configure do |c|
|
45
|
-
c.config_file = "#{Dir.pwd}/spec/example.yaml"
|
46
|
-
end
|
47
|
-
driver = SeleniumConnect.start
|
48
|
-
driver.get 'http://google.com'
|
49
|
-
SeleniumConnect.finish
|
50
|
-
end
|
51
|
-
end
|