rwebspec 1.4.0.2 → 1.6

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.
@@ -1,26 +1,31 @@
1
- if RUBY_PLATFORM == "java" then
2
- # no need to load firefox extension
3
- else
4
- module FireWatir
5
- class Firefox
6
1
 
7
- @@firefox_started = false
2
+ module FireWatir
3
+ class Firefox
8
4
 
9
- def initialize(options = {})
10
- if(options.kind_of?(Integer))
11
- options = {:waitTime => options}
12
- end
5
+ @@firefox_started = false
13
6
 
14
- if(options[:profile])
15
- profile_opt = "-no-remote -P #{options[:profile]}"
16
- else
17
- profile_opt = ""
18
- end
7
+ def initialize(options = {})
8
+ if(options.kind_of?(Integer))
9
+ options = {:waitTime => options}
10
+ end
11
+
12
+ if(options[:profile])
13
+ profile_opt = "-no-remote -P #{options[:profile]}"
14
+ else
15
+ profile_opt = ""
16
+ end
19
17
 
20
- waitTime = options[:waitTime] || 2
18
+ waitTime = options[:waitTime] || 2
21
19
 
22
- case RUBY_PLATFORM
23
- when /mswin/
20
+ os = RUBY_PLATFORM
21
+ if RUBY_PLATFORM =~ /java/ then
22
+ require 'rbconfig'
23
+ os = Config::CONFIG['host_os']
24
+ end
25
+
26
+ case os
27
+ when /mswin/
28
+ begin
24
29
  # Get the path to Firefox.exe using Registry.
25
30
  require 'win32/registry.rb'
26
31
  path_to_bin = ""
@@ -33,37 +38,38 @@ else
33
38
  end
34
39
  end
35
40
  end
36
-
37
- when /linux/i
38
- path_to_bin = `which firefox`.strip
39
- when /darwin/i
40
- path_to_bin = '/Applications/Firefox.app/Contents/MacOS/firefox'
41
- when /java/
42
- raise "Not implemented: Create a browser finder in JRuby"
41
+ rescue LoadError => e
42
+ path_to_bin = '"C:\Program Files\Mozilla Firefox\firefox.exe"'
43
43
  end
44
44
 
45
- @t = Thread.new { system("#{path_to_bin} -jssh #{profile_opt}")} unless @@firefox_started
46
-
47
- sleep waitTime
48
- begin
49
- set_defaults()
50
- rescue Watir::Exception::UnableToStartJSShException
51
- if !@t # no new thread starting browser, try again
52
- puts "Firefox with JSSH not detected after you indicated @@firefox_started"
53
- @t = Thread.new { system("#{path_to_bin} -jssh #{profile_opt}")}
54
- sleep waitTime
55
- set_defaults
56
- end
57
- end
58
- get_window_number()
59
- set_browser_document()
45
+ when /linux/i
46
+ path_to_bin = `which firefox`.strip
47
+ when /darwin/i
48
+ path_to_bin = '/Applications/Firefox.app/Contents/MacOS/firefox'
49
+ when /java/
50
+ raise "Error, should have set using rbconfig: #{os}"
60
51
  end
61
52
 
62
- def self.firefox_started=(value)
63
- @@firefox_started = value
53
+ @t = Thread.new { system("#{path_to_bin} -jssh #{profile_opt}")} unless @@firefox_started
54
+
55
+ sleep waitTime
56
+ begin
57
+ set_defaults()
58
+ rescue Watir::Exception::UnableToStartJSShException
59
+ if !@t # no new thread starting browser, try again
60
+ puts "Firefox with JSSH not detected after you indicated @@firefox_started"
61
+ @t = Thread.new { system("#{path_to_bin} -jssh #{profile_opt}")}
62
+ sleep waitTime
63
+ set_defaults
64
+ end
64
65
  end
66
+ get_window_number()
67
+ set_browser_document()
68
+ end
65
69
 
70
+ def self.firefox_started=(value)
71
+ @@firefox_started = value
66
72
  end
67
- end
68
73
 
74
+ end
69
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rwebspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.2
4
+ version: "1.6"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhimin Zhan
@@ -9,7 +9,7 @@ autorequire: rwebspec
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-01 00:00:00 +10:00
12
+ date: 2010-05-16 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,16 +22,6 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.1.12
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: firewatir
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.6.2
34
- version:
35
25
  - !ruby/object:Gem::Dependency
36
26
  name: commonwatir
37
27
  type: :runtime
@@ -40,17 +30,7 @@ dependencies:
40
30
  requirements:
41
31
  - - ">="
42
32
  - !ruby/object:Gem::Version
43
- version: 1.6.2
44
- version:
45
- - !ruby/object:Gem::Dependency
46
- name: test-unit
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 2.0.2
33
+ version: 1.6.5
54
34
  version:
55
35
  description:
56
36
  email: zhimin@agileway.net
@@ -66,18 +46,18 @@ files:
66
46
  - CHANGELOG
67
47
  - MIT-LICENSE
68
48
  - lib/rspec_extensions.rb
69
- - lib/rwebspec
70
49
  - lib/rwebspec/assert.rb
71
50
  - lib/rwebspec/clickJSDialog.rb
72
51
  - lib/rwebspec/context.rb
52
+ - lib/rwebspec/database_checker.rb
73
53
  - lib/rwebspec/driver.rb
74
- - lib/rwebspec/itest_plugin.rb
75
- - lib/rwebspec/matchers
54
+ - lib/rwebspec/load_test_helper.rb
76
55
  - lib/rwebspec/matchers/contains_text.rb
77
56
  - lib/rwebspec/popup.rb
78
57
  - lib/rwebspec/rspec_helper.rb
79
58
  - lib/rwebspec/test_script.rb
80
59
  - lib/rwebspec/test_utils.rb
60
+ - lib/rwebspec/testwise_plugin.rb
81
61
  - lib/rwebspec/using_pages.rb
82
62
  - lib/rwebspec/web_browser.rb
83
63
  - lib/rwebspec/web_page.rb
@@ -87,6 +67,8 @@ files:
87
67
  - lib/watir_extensions.rb
88
68
  has_rdoc: true
89
69
  homepage: http://github.com/zhimin/rwebspec/tree/master
70
+ licenses: []
71
+
90
72
  post_install_message:
91
73
  rdoc_options: []
92
74
 
@@ -107,9 +89,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
89
  requirements:
108
90
  - none
109
91
  rubyforge_project: rwebspec
110
- rubygems_version: 1.3.1
92
+ rubygems_version: 1.3.5
111
93
  signing_key:
112
- specification_version: 2
94
+ specification_version: 3
113
95
  summary: Executable functional specification for web applications in RSpec syntax and Watir
114
96
  test_files: []
115
97