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.
- data/Rakefile +16 -17
- data/VERSION +1 -1
- data/lib/watir-webdriver/elements/generated.rb +23 -4
- data/lib/watir-webdriver/elements/select.rb +6 -0
- data/lib/watir-webdriver/html/spec_extractor.rb +3 -0
- data/spec/browser_spec.rb +0 -1
- data/spec/container_spec.rb +0 -1
- data/spec/element_spec.rb +0 -1
- data/spec/implementation.rb +17 -0
- data/spec/spec_helper.rb +2 -20
- data/spec/watirspec/area_spec.rb +1 -1
- data/spec/watirspec/areas_spec.rb +1 -1
- data/spec/watirspec/browser_spec.rb +1 -1
- data/spec/watirspec/button_spec.rb +1 -1
- data/spec/watirspec/buttons_spec.rb +1 -1
- data/spec/watirspec/checkbox_spec.rb +1 -1
- data/spec/watirspec/checkboxes_spec.rb +1 -1
- data/spec/watirspec/collections_spec.rb +1 -1
- data/spec/watirspec/dd_spec.rb +1 -1
- data/spec/watirspec/dds_spec.rb +1 -1
- data/spec/watirspec/del_spec.rb +1 -1
- data/spec/watirspec/dels_spec.rb +1 -1
- data/spec/watirspec/div_spec.rb +1 -1
- data/spec/watirspec/divs_spec.rb +1 -1
- data/spec/watirspec/dl_spec.rb +1 -1
- data/spec/watirspec/dls_spec.rb +1 -1
- data/spec/watirspec/dt_spec.rb +1 -1
- data/spec/watirspec/dts_spec.rb +1 -1
- data/spec/watirspec/element_spec.rb +2 -2
- data/spec/watirspec/em_spec.rb +1 -1
- data/spec/watirspec/ems_spec.rb +1 -1
- data/spec/watirspec/filefield_spec.rb +1 -1
- data/spec/watirspec/filefields_spec.rb +1 -1
- data/spec/watirspec/font_spec.rb +1 -1
- data/spec/watirspec/form_spec.rb +1 -1
- data/spec/watirspec/forms_spec.rb +1 -1
- data/spec/watirspec/frame_spec.rb +1 -1
- data/spec/watirspec/frames_spec.rb +1 -1
- data/spec/watirspec/hidden_spec.rb +1 -1
- data/spec/watirspec/hiddens_spec.rb +1 -1
- data/spec/watirspec/hn_spec.rb +1 -1
- data/spec/watirspec/hns_spec.rb +1 -1
- data/spec/watirspec/image_spec.rb +1 -1
- data/spec/watirspec/images_spec.rb +1 -1
- data/spec/watirspec/ins_spec.rb +1 -1
- data/spec/watirspec/inses_spec.rb +1 -1
- data/spec/watirspec/label_spec.rb +1 -1
- data/spec/watirspec/labels_spec.rb +1 -1
- data/spec/watirspec/li_spec.rb +1 -1
- data/spec/watirspec/lib/{spec_helper.rb → runner.rb} +12 -8
- data/spec/watirspec/lib/server.rb +14 -7
- data/spec/watirspec/link_spec.rb +1 -1
- data/spec/watirspec/links_spec.rb +1 -1
- data/spec/watirspec/lis_spec.rb +1 -1
- data/spec/watirspec/map_spec.rb +1 -1
- data/spec/watirspec/maps_spec.rb +1 -1
- data/spec/watirspec/meta_spec.rb +1 -1
- data/spec/watirspec/metas_spec.rb +1 -1
- data/spec/watirspec/ol_spec.rb +1 -1
- data/spec/watirspec/ols_spec.rb +1 -1
- data/spec/watirspec/option_spec.rb +1 -1
- data/spec/watirspec/p_spec.rb +1 -1
- data/spec/watirspec/pre_spec.rb +1 -1
- data/spec/watirspec/pres_spec.rb +1 -1
- data/spec/watirspec/ps_spec.rb +1 -1
- data/spec/watirspec/radio_spec.rb +1 -1
- data/spec/watirspec/radios_spec.rb +1 -1
- data/spec/watirspec/select_list_spec.rb +1 -1
- data/spec/watirspec/select_lists_spec.rb +1 -1
- data/spec/watirspec/span_spec.rb +1 -1
- data/spec/watirspec/spans_spec.rb +1 -1
- data/spec/watirspec/spec_helper.rb +4 -2
- data/spec/watirspec/strong_spec.rb +1 -1
- data/spec/watirspec/strongs_spec.rb +1 -1
- data/spec/watirspec/table_nesting_spec.rb +1 -1
- data/spec/watirspec/table_spec.rb +1 -1
- data/spec/watirspec/tables_spec.rb +1 -1
- data/spec/watirspec/tbody_spec.rb +1 -1
- data/spec/watirspec/tbodys_spec.rb +1 -1
- data/spec/watirspec/td_spec.rb +1 -1
- data/spec/watirspec/tds_spec.rb +1 -1
- data/spec/watirspec/text_field_spec.rb +1 -1
- data/spec/watirspec/text_fields_spec.rb +1 -1
- data/spec/watirspec/tfoot_spec.rb +1 -1
- data/spec/watirspec/tfoots_spec.rb +1 -1
- data/spec/watirspec/thead_spec.rb +1 -1
- data/spec/watirspec/theads_spec.rb +1 -1
- data/spec/watirspec/tr_spec.rb +1 -1
- data/spec/watirspec/trs_spec.rb +1 -1
- data/spec/watirspec/ul_spec.rb +1 -1
- data/spec/watirspec/uls_spec.rb +1 -1
- data/spec/watirspec/window_switching_spec.rb +1 -2
- data/support/html5.html +5315 -6167
- data/watir-webdriver.gemspec +11 -9
- metadata +13 -19
data/Rakefile
CHANGED
@@ -11,9 +11,9 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/jarib/watir-webdriver"
|
12
12
|
gem.authors = ["Jari Bakken"]
|
13
13
|
|
14
|
-
gem.add_dependency "selenium-webdriver", '0.0
|
14
|
+
gem.add_dependency "selenium-webdriver", '0.1.0'
|
15
15
|
|
16
|
-
gem.add_development_dependency "rspec"
|
16
|
+
gem.add_development_dependency "rspec", "~> 2.1.0"
|
17
17
|
gem.add_development_dependency "yard", "~> 0.6"
|
18
18
|
gem.add_development_dependency "webidl", ">= 0.0.6"
|
19
19
|
gem.add_development_dependency "sinatra", "~> 1.0"
|
@@ -26,31 +26,30 @@ rescue LoadError
|
|
26
26
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
27
27
|
end
|
28
28
|
|
29
|
-
require '
|
30
|
-
|
31
|
-
spec.
|
32
|
-
spec.
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.ruby_opts = "-I lib:spec"
|
32
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
33
33
|
end
|
34
34
|
|
35
35
|
namespace :spec do
|
36
|
-
|
37
|
-
spec.
|
38
|
-
spec.pattern
|
39
|
-
spec.rcov
|
36
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
37
|
+
spec.ruby_opts = "-I lib:spec"
|
38
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
39
|
+
spec.rcov = true
|
40
40
|
spec.rcov_opts = %w[--exclude spec,ruby-debug,/Library/Ruby,.gem --include lib/watir-webdriver]
|
41
41
|
end
|
42
42
|
|
43
43
|
desc 'Run specs for CI'
|
44
|
-
|
45
|
-
spec.
|
46
|
-
spec.pattern
|
47
|
-
spec.
|
44
|
+
RSpec::Core::RakeTask.new(:ci) do |spec|
|
45
|
+
spec.ruby_opts = "-I lib:spec"
|
46
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
47
|
+
spec.rspec_opts = ["--format", "html:results/#{RUBY_PLATFORM}/#{ENV['WATIR_WEBDRIVER_BROWSER'] || 'firefox'}/spec-results.html",
|
48
48
|
"--format", "progress",
|
49
49
|
"--backtrace"]
|
50
|
-
spec.rcov
|
51
|
-
spec.rcov_opts
|
50
|
+
spec.rcov = true
|
51
|
+
spec.rcov_opts = %w[--exclude spec,ruby-debug,/Library/Ruby,.gem --include lib/watir-webdriver]
|
52
52
|
end
|
53
|
-
|
54
53
|
end
|
55
54
|
|
56
55
|
task :spec => :check_dependencies
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -38,11 +38,13 @@ module Watir
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
+
|
42
|
+
|
41
43
|
|
42
44
|
|
43
45
|
|
44
46
|
class HTMLElement < Element
|
45
|
-
attributes(:string => [:innerhtml, :outerhtml, :id, :title, :lang, :dir, :class_name, :item_type, :item_id, :item_value, :access_key, :access_key_label, :content_editable, :command_type, :label, :icon], :token_list => [:class_list, :item_ref, :item_prop], :string_map => [:dataset], :bool => [:item_scope, :hidden, :draggable, :is_content_editable, :spellcheck, :disabled, :checked], :properties_collection => [:properties], :int => [:tab_index], :html_element => [:context_menu], :style => [:style], :function => [:onabort, :onblur, :oncanplay, :oncanplaythrough, :onchange, :onclick, :oncontextmenu, :oncuechange, :ondblclick, :ondrag, :ondragend, :ondragenter, :ondragleave, :ondragover, :ondragstart, :ondrop, :ondurationchange, :onemptied, :onended, :onerror, :onfocus, :onformchange, :onforminput, :oninput, :oninvalid, :onkeydown, :onkeypress, :onkeyup, :onload, :onloadeddata, :onloadedmetadata, :onloadstart, :onmousedown, :onmousemove, :onmouseout, :onmouseover, :onmouseup, :onmousewheel, :onpause, :onplay, :onplaying, :onprogress, :onratechange, :onreadystatechange, :onreset, :onscroll, :onseeked, :onseeking, :onselect, :onshow, :onstalled, :onsubmit, :onsuspend, :ontimeupdate, :onvolumechange, :onwaiting])
|
47
|
+
attributes(:string => [:innerhtml, :outerhtml, :id, :title, :lang, :dir, :class_name, :item_type, :item_id, :item_value, :access_key, :access_key_label, :content_editable, :command_type, :label, :icon], :token_list => [:class_list, :item_ref, :item_prop, :dropzone], :string_map => [:dataset], :bool => [:item_scope, :hidden, :draggable, :is_content_editable, :spellcheck, :disabled, :checked], :properties_collection => [:properties], :int => [:tab_index], :html_element => [:context_menu], :style => [:style], :function => [:onabort, :onblur, :oncanplay, :oncanplaythrough, :onchange, :onclick, :oncontextmenu, :oncuechange, :ondblclick, :ondrag, :ondragend, :ondragenter, :ondragleave, :ondragover, :ondragstart, :ondrop, :ondurationchange, :onemptied, :onended, :onerror, :onfocus, :onformchange, :onforminput, :oninput, :oninvalid, :onkeydown, :onkeypress, :onkeyup, :onload, :onloadeddata, :onloadedmetadata, :onloadstart, :onmousedown, :onmousemove, :onmouseout, :onmouseover, :onmouseup, :onmousewheel, :onpause, :onplay, :onplaying, :onprogress, :onratechange, :onreadystatechange, :onreset, :onscroll, :onseeked, :onseeking, :onselect, :onshow, :onstalled, :onsubmit, :onsuspend, :ontimeupdate, :onvolumechange, :onwaiting])
|
46
48
|
end
|
47
49
|
class HTMLElementCollection < ElementCollection
|
48
50
|
def element_class
|
@@ -174,7 +176,7 @@ module Watir
|
|
174
176
|
end
|
175
177
|
end
|
176
178
|
class TextArea < HTMLElement
|
177
|
-
attributes(:bool => [:autofocus, :disabled, :read_only, :required, :will_validate], :int => [:cols, :max_length, :rows, :text_length, :selection_start, :selection_end], :
|
179
|
+
attributes(:bool => [:autofocus, :disabled, :read_only, :required, :will_validate], :int => [:cols, :max_length, :rows, :text_length, :selection_start, :selection_end], :string => [:dir_name, :name, :placeholder, :wrap, :type, :default_value, :value, :validity, :validation_message], :html_element => [:form], :list => [:labels])
|
178
180
|
end
|
179
181
|
class TextAreaCollection < ElementCollection
|
180
182
|
def element_class
|
@@ -222,7 +224,7 @@ module Watir
|
|
222
224
|
end
|
223
225
|
end
|
224
226
|
class Input < HTMLElement
|
225
|
-
attributes(:string => [:accept, :alt, :autocomplete, :form_action, :form_enctype, :form_method, :form_target, :height, :max, :min, :name, :pattern, :placeholder, :src, :step, :type, :default_value, :value, :width, :validity, :validation_message], :bool => [:autofocus, :default_checked, :checked, :disabled, :form_no_validate, :indeterminate, :multiple, :read_only, :required, :will_validate], :html_element => [:form, :list, :selected_option], :list => [:files, :labels], :int => [:max_length, :size, :selection_start, :selection_end], :date => [:value_as_date], :float => [:value_as_number])
|
227
|
+
attributes(:string => [:accept, :alt, :autocomplete, :dir_name, :form_action, :form_enctype, :form_method, :form_target, :height, :max, :min, :name, :pattern, :placeholder, :src, :step, :type, :default_value, :value, :width, :validity, :validation_message], :bool => [:autofocus, :default_checked, :checked, :disabled, :form_no_validate, :indeterminate, :multiple, :read_only, :required, :will_validate], :html_element => [:form, :list, :selected_option], :list => [:files, :labels], :int => [:max_length, :size, :selection_start, :selection_end], :date => [:value_as_date], :float => [:value_as_number])
|
226
228
|
end
|
227
229
|
class InputCollection < ElementCollection
|
228
230
|
def element_class
|
@@ -402,7 +404,7 @@ module Watir
|
|
402
404
|
end
|
403
405
|
end
|
404
406
|
class Video < Media
|
405
|
-
attributes(:int => [:width, :height, :video_width, :video_height], :string => [:poster])
|
407
|
+
attributes(:int => [:width, :height, :video_width, :video_height], :string => [:poster], :token_list => [:audio])
|
406
408
|
end
|
407
409
|
class VideoCollection < ElementCollection
|
408
410
|
def element_class
|
@@ -909,6 +911,23 @@ module Watir
|
|
909
911
|
# @return [HTMLElement]
|
910
912
|
#
|
911
913
|
|
914
|
+
def bdi(*args)
|
915
|
+
HTMLElement.new(self, extract_selector(args).merge(:tag_name => "bdi"))
|
916
|
+
end
|
917
|
+
|
918
|
+
#
|
919
|
+
# @return [HTMLElementCollection]
|
920
|
+
#
|
921
|
+
|
922
|
+
def bdis(*args)
|
923
|
+
HTMLElementCollection.new(self, extract_selector(args).merge(:tag_name => "bdi"))
|
924
|
+
end
|
925
|
+
|
926
|
+
Watir.tag_to_class[:bdi] = HTMLElement
|
927
|
+
#
|
928
|
+
# @return [HTMLElement]
|
929
|
+
#
|
930
|
+
|
912
931
|
def bdo(*args)
|
913
932
|
HTMLElement.new(self, extract_selector(args).merge(:tag_name => "bdo"))
|
914
933
|
end
|
data/spec/browser_spec.rb
CHANGED
data/spec/container_spec.rb
CHANGED
data/spec/element_spec.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path("../spec_helper", __FILE__)
|
2
|
+
|
3
|
+
WatirSpec.implementation do |imp|
|
4
|
+
name = :webdriver
|
5
|
+
browser = (ENV['WATIR_WEBDRIVER_BROWSER'] || :firefox).to_sym
|
6
|
+
|
7
|
+
imp.name = name
|
8
|
+
imp.browser_class = Watir::Browser
|
9
|
+
imp.browser_args = [browser]
|
10
|
+
|
11
|
+
imp.guard_proc = lambda { |args|
|
12
|
+
args.any? { |arg| arg == name || arg == [name, browser] }
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -2,31 +2,13 @@
|
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
4
|
|
5
|
-
require 'rubygems'
|
6
5
|
require 'watir-webdriver'
|
7
6
|
require 'locator_spec_helper'
|
8
|
-
require '
|
9
|
-
require '
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rspec'
|
10
9
|
|
11
10
|
include Watir
|
12
11
|
include Watir::Exception
|
13
12
|
|
14
13
|
WEBDRIVER_SELECTORS = [:class, :class_name, :css, :id, :name, :tag_name, :xpath]
|
15
14
|
|
16
|
-
if defined?(WatirSpec)
|
17
|
-
browser = (ENV['WATIR_WEBDRIVER_BROWSER'] || :firefox).to_sym
|
18
|
-
|
19
|
-
WatirSpec.implementation do |imp|
|
20
|
-
imp.name = :webdriver
|
21
|
-
imp.browser_class = Watir::Browser
|
22
|
-
imp.browser_args = [browser]
|
23
|
-
|
24
|
-
imp.guard_proc = lambda { |args|
|
25
|
-
args.any? { |arg| arg == :webdriver || arg == [:webdriver, browser] }
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
# WatirSpec.unguarded = true
|
30
|
-
end
|
31
|
-
|
32
|
-
|
data/spec/watirspec/area_spec.rb
CHANGED
data/spec/watirspec/dd_spec.rb
CHANGED
data/spec/watirspec/dds_spec.rb
CHANGED
data/spec/watirspec/del_spec.rb
CHANGED
data/spec/watirspec/dels_spec.rb
CHANGED
data/spec/watirspec/div_spec.rb
CHANGED
data/spec/watirspec/divs_spec.rb
CHANGED
data/spec/watirspec/dl_spec.rb
CHANGED
data/spec/watirspec/dls_spec.rb
CHANGED
data/spec/watirspec/dt_spec.rb
CHANGED
data/spec/watirspec/dts_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.expand_path(
|
2
|
+
require File.expand_path("../spec_helper", __FILE__)
|
3
3
|
|
4
4
|
describe "Element" do
|
5
5
|
|
@@ -18,7 +18,7 @@ describe "Element" do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "raises ArgumentError if given the wrong number of arguments" do
|
21
|
-
container = mock("container"
|
21
|
+
container = mock("container").as_null_object
|
22
22
|
lambda { Element.new(container, 1,2,3,4) }.should raise_error(ArgumentError)
|
23
23
|
lambda { Element.new(container, "foo") }.should raise_error(ArgumentError)
|
24
24
|
end
|
data/spec/watirspec/em_spec.rb
CHANGED
data/spec/watirspec/ems_spec.rb
CHANGED
data/spec/watirspec/font_spec.rb
CHANGED
data/spec/watirspec/form_spec.rb
CHANGED