watir-webdriver 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/Rakefile +16 -17
  2. data/VERSION +1 -1
  3. data/lib/watir-webdriver/elements/generated.rb +23 -4
  4. data/lib/watir-webdriver/elements/select.rb +6 -0
  5. data/lib/watir-webdriver/html/spec_extractor.rb +3 -0
  6. data/spec/browser_spec.rb +0 -1
  7. data/spec/container_spec.rb +0 -1
  8. data/spec/element_spec.rb +0 -1
  9. data/spec/implementation.rb +17 -0
  10. data/spec/spec_helper.rb +2 -20
  11. data/spec/watirspec/area_spec.rb +1 -1
  12. data/spec/watirspec/areas_spec.rb +1 -1
  13. data/spec/watirspec/browser_spec.rb +1 -1
  14. data/spec/watirspec/button_spec.rb +1 -1
  15. data/spec/watirspec/buttons_spec.rb +1 -1
  16. data/spec/watirspec/checkbox_spec.rb +1 -1
  17. data/spec/watirspec/checkboxes_spec.rb +1 -1
  18. data/spec/watirspec/collections_spec.rb +1 -1
  19. data/spec/watirspec/dd_spec.rb +1 -1
  20. data/spec/watirspec/dds_spec.rb +1 -1
  21. data/spec/watirspec/del_spec.rb +1 -1
  22. data/spec/watirspec/dels_spec.rb +1 -1
  23. data/spec/watirspec/div_spec.rb +1 -1
  24. data/spec/watirspec/divs_spec.rb +1 -1
  25. data/spec/watirspec/dl_spec.rb +1 -1
  26. data/spec/watirspec/dls_spec.rb +1 -1
  27. data/spec/watirspec/dt_spec.rb +1 -1
  28. data/spec/watirspec/dts_spec.rb +1 -1
  29. data/spec/watirspec/element_spec.rb +2 -2
  30. data/spec/watirspec/em_spec.rb +1 -1
  31. data/spec/watirspec/ems_spec.rb +1 -1
  32. data/spec/watirspec/filefield_spec.rb +1 -1
  33. data/spec/watirspec/filefields_spec.rb +1 -1
  34. data/spec/watirspec/font_spec.rb +1 -1
  35. data/spec/watirspec/form_spec.rb +1 -1
  36. data/spec/watirspec/forms_spec.rb +1 -1
  37. data/spec/watirspec/frame_spec.rb +1 -1
  38. data/spec/watirspec/frames_spec.rb +1 -1
  39. data/spec/watirspec/hidden_spec.rb +1 -1
  40. data/spec/watirspec/hiddens_spec.rb +1 -1
  41. data/spec/watirspec/hn_spec.rb +1 -1
  42. data/spec/watirspec/hns_spec.rb +1 -1
  43. data/spec/watirspec/image_spec.rb +1 -1
  44. data/spec/watirspec/images_spec.rb +1 -1
  45. data/spec/watirspec/ins_spec.rb +1 -1
  46. data/spec/watirspec/inses_spec.rb +1 -1
  47. data/spec/watirspec/label_spec.rb +1 -1
  48. data/spec/watirspec/labels_spec.rb +1 -1
  49. data/spec/watirspec/li_spec.rb +1 -1
  50. data/spec/watirspec/lib/{spec_helper.rb → runner.rb} +12 -8
  51. data/spec/watirspec/lib/server.rb +14 -7
  52. data/spec/watirspec/link_spec.rb +1 -1
  53. data/spec/watirspec/links_spec.rb +1 -1
  54. data/spec/watirspec/lis_spec.rb +1 -1
  55. data/spec/watirspec/map_spec.rb +1 -1
  56. data/spec/watirspec/maps_spec.rb +1 -1
  57. data/spec/watirspec/meta_spec.rb +1 -1
  58. data/spec/watirspec/metas_spec.rb +1 -1
  59. data/spec/watirspec/ol_spec.rb +1 -1
  60. data/spec/watirspec/ols_spec.rb +1 -1
  61. data/spec/watirspec/option_spec.rb +1 -1
  62. data/spec/watirspec/p_spec.rb +1 -1
  63. data/spec/watirspec/pre_spec.rb +1 -1
  64. data/spec/watirspec/pres_spec.rb +1 -1
  65. data/spec/watirspec/ps_spec.rb +1 -1
  66. data/spec/watirspec/radio_spec.rb +1 -1
  67. data/spec/watirspec/radios_spec.rb +1 -1
  68. data/spec/watirspec/select_list_spec.rb +1 -1
  69. data/spec/watirspec/select_lists_spec.rb +1 -1
  70. data/spec/watirspec/span_spec.rb +1 -1
  71. data/spec/watirspec/spans_spec.rb +1 -1
  72. data/spec/watirspec/spec_helper.rb +4 -2
  73. data/spec/watirspec/strong_spec.rb +1 -1
  74. data/spec/watirspec/strongs_spec.rb +1 -1
  75. data/spec/watirspec/table_nesting_spec.rb +1 -1
  76. data/spec/watirspec/table_spec.rb +1 -1
  77. data/spec/watirspec/tables_spec.rb +1 -1
  78. data/spec/watirspec/tbody_spec.rb +1 -1
  79. data/spec/watirspec/tbodys_spec.rb +1 -1
  80. data/spec/watirspec/td_spec.rb +1 -1
  81. data/spec/watirspec/tds_spec.rb +1 -1
  82. data/spec/watirspec/text_field_spec.rb +1 -1
  83. data/spec/watirspec/text_fields_spec.rb +1 -1
  84. data/spec/watirspec/tfoot_spec.rb +1 -1
  85. data/spec/watirspec/tfoots_spec.rb +1 -1
  86. data/spec/watirspec/thead_spec.rb +1 -1
  87. data/spec/watirspec/theads_spec.rb +1 -1
  88. data/spec/watirspec/tr_spec.rb +1 -1
  89. data/spec/watirspec/trs_spec.rb +1 -1
  90. data/spec/watirspec/ul_spec.rb +1 -1
  91. data/spec/watirspec/uls_spec.rb +1 -1
  92. data/spec/watirspec/window_switching_spec.rb +1 -2
  93. data/support/html5.html +5315 -6167
  94. data/watir-webdriver.gemspec +11 -9
  95. metadata +13 -19
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Forms" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Frame" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  bug "http://github.com/jarib/watir-webdriver/issues#issue/17", :webdriver do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Hidden" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Hiddens" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "H1", "H2", "H3", "H4", "H5", "H6" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "H1s", "H2s", "H3s", "H4s", "H5s", "H6s" do
5
5
  before :each do
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Image" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Images" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Ins" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Inses" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Label" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Labels" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Li" do
5
5
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module WatirSpec
3
- module SpecHelper
3
+ module Runner
4
4
 
5
5
  module BrowserHelper
6
6
  def browser; @browser; end
@@ -23,12 +23,18 @@ module WatirSpec
23
23
  start_server
24
24
  configure
25
25
  add_guard_hook
26
+
27
+ @executed = true
28
+ end
29
+
30
+ def execute_if_necessary
31
+ execute unless @exectued
26
32
  end
27
33
 
28
34
  def configure
29
35
  Thread.abort_on_exception = true
30
36
 
31
- Spec::Runner.configure do |config|
37
+ RSpec.configure do |config|
32
38
  config.include(MessagesHelper)
33
39
 
34
40
  if WatirSpec.persistent_browser == false
@@ -45,13 +51,11 @@ module WatirSpec
45
51
  end
46
52
 
47
53
  def load_requires
48
- # load spec_helper from containing folder, if it exists
49
- hook = File.expand_path("../../spec_helper.rb", File.dirname(__FILE__))
50
- raise(Errno::ENOENT, hook) unless File.exist?(hook)
51
-
52
- load hook
54
+ require "rspec"
53
55
  require "fileutils"
54
- require "spec"
56
+
57
+ implementation = File.expand_path("../../../implementation.rb", __FILE__)
58
+ load implementation
55
59
 
56
60
  begin
57
61
  require "ruby-debug"
@@ -11,13 +11,7 @@ module WatirSpec
11
11
  Thread.new { run! }
12
12
  sleep 0.1 until WatirSpec::Server.running?
13
13
  when :windows
14
- require "win32/process"
15
- pid = Process.create(
16
- :app_name => "#{WatirSpec.ruby} #{File.dirname(__FILE__)}/../spec_helper.rb",
17
- :process_inherit => true,
18
- :thread_inherit => true,
19
- :inherit => true
20
- ).process_id
14
+ run_in_child_process
21
15
  else
22
16
  pid = fork { run! }
23
17
  sleep 0.5 until listening?
@@ -81,6 +75,19 @@ module WatirSpec
81
75
  rescue SocketError, Errno::EADDRINUSE
82
76
  false
83
77
  end
78
+
79
+ private
80
+
81
+ def run_in_child_process
82
+ begin
83
+ require "childprocess"
84
+ rescue LoadError => ex
85
+ raise "please run `gem install childprocess` for WatirSpec on Windows + MRI\n\t(caught: #{ex.message})"
86
+ end
87
+
88
+ process = ChildProcess.build(WatirSpec.ruby, File.expand_path("../../spec_helper", __FILE__))
89
+ at_exit { process.stop }
90
+ end
84
91
  end # class << Server
85
92
 
86
93
  set :public, WatirSpec.html
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Link" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Links" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Lis" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Map" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Maps" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Meta" do
5
5
  before :each do
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Metas" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Ol" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Ols" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Option" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "P" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Pre" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Pres" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Ps" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Radio" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Radios" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "SelectList" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "SelectLists" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Span" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Spans" do
5
5
 
@@ -8,11 +8,13 @@ require "sinatra/base"
8
8
  require "#{File.dirname(__FILE__)}/lib/watirspec"
9
9
  require "#{File.dirname(__FILE__)}/lib/implementation"
10
10
  require "#{File.dirname(__FILE__)}/lib/server"
11
- require "#{File.dirname(__FILE__)}/lib/spec_helper"
11
+ require "#{File.dirname(__FILE__)}/lib/runner"
12
12
  require "#{File.dirname(__FILE__)}/lib/guards"
13
13
 
14
14
  if __FILE__ == $0
15
+ # this is needed in order to have a stable Server on Windows + MRI
15
16
  WatirSpec::Server.run!
16
17
  else
17
- WatirSpec::SpecHelper.execute
18
+ WatirSpec::Runner.execute_if_necessary
18
19
  end
20
+
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Strong" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Strongs" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Table" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Table" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "Tables" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "TableBody" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "TableBodies" do
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec_helper', File.dirname(__FILE__))
2
+ require File.expand_path("../spec_helper", __FILE__)
3
3
 
4
4
  describe "TableCell" do
5
5