operawatir 0.4-jruby → 0.4.1-jruby
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.
- data/.gitmodules +3 -3
- data/AUTHORS +1 -0
- data/CHANGES +454 -0
- data/README.md +67 -50
- data/Rakefile +6 -10
- data/VERSION +1 -1
- data/bin/desktopwatir +52 -29
- data/bin/operawatir +50 -18
- data/lib/operadriver/client-combined-nodeps.jar +0 -0
- data/lib/operadriver/webdriver-opera.jar +0 -0
- data/lib/operawatir.rb +8 -1
- data/lib/operawatir/browser.rb +35 -15
- data/lib/operawatir/collection.rb +2 -2
- data/lib/operawatir/compat.rb +3 -2
- data/lib/operawatir/compat/browser.rb +0 -5
- data/lib/operawatir/compat/collection.rb +15 -0
- data/lib/operawatir/compat/element.rb +72 -21
- data/lib/operawatir/compat/element_finders.rb +6 -0
- data/lib/operawatir/compat/selector.rb +7 -0
- data/lib/operawatir/compat/window.rb +49 -0
- data/lib/operawatir/desktop_browser.rb +88 -14
- data/lib/operawatir/desktop_common.rb +0 -2
- data/lib/operawatir/desktop_container.rb +82 -29
- data/lib/operawatir/desktop_helper.rb +2 -0
- data/lib/operawatir/element.rb +49 -25
- data/lib/operawatir/helper.rb +5 -3
- data/lib/operawatir/keys.rb +19 -6
- data/lib/operawatir/preferences.rb +315 -78
- data/lib/operawatir/quickwidgets.rb +2 -1
- data/lib/operawatir/quickwidgets/quick_addressfield.rb +12 -0
- data/lib/operawatir/quickwidgets/quick_button.rb +8 -2
- data/lib/operawatir/quickwidgets/quick_checkbox.rb +5 -5
- data/lib/operawatir/quickwidgets/quick_editfield.rb +8 -5
- data/lib/operawatir/quickwidgets/quick_find.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_griditem.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_gridlayout.rb +11 -0
- data/lib/operawatir/quickwidgets/quick_searchfield.rb +7 -1
- data/lib/operawatir/quickwidgets/quick_tab.rb +0 -1
- data/lib/operawatir/quickwidgets/quick_treeitem.rb +22 -1
- data/lib/operawatir/quickwidgets/quick_widget.rb +62 -23
- data/lib/operawatir/quickwidgets/quick_window.rb +32 -2
- data/lib/operawatir/screenshot.rb +46 -0
- data/lib/operawatir/version.rb +6 -4
- data/lib/operawatir/window.rb +53 -67
- data/operawatir.gemspec +310 -245
- data/spec/operawatir/README.md +4 -0
- data/spec/operawatir/core/browser_spec.rb +82 -0
- data/spec/operawatir/core/element_spec.rb +88 -0
- data/spec/operawatir/core/preferences_spec.rb +438 -0
- data/spec/operawatir/core/screenshot_spec.rb +76 -0
- data/spec/{new_watirspec → operawatir/core}/spatnav_spec.rb +3 -3
- data/spec/operawatir/core/window_spec.rb +76 -0
- data/spec/operawatir/desktop/desktopbrowser_spec.rb +316 -0
- data/spec/operawatir/desktop/quickaddressfield_spec.rb +59 -0
- data/spec/operawatir/desktop/quickbutton_spec.rb +248 -0
- data/spec/operawatir/desktop/quickcheckbox_spec.rb +36 -0
- data/spec/operawatir/desktop/quickdialogtab_spec.rb +30 -0
- data/spec/operawatir/desktop/quickdropdown_spec.rb +39 -0
- data/spec/operawatir/desktop/quickeditfield_spec.rb +51 -0
- data/spec/operawatir/desktop/quickfind_spec.rb +30 -0
- data/spec/operawatir/desktop/quickgriditem_spec.rb +16 -0
- data/spec/operawatir/desktop/quickgridlayout_spec.rb +15 -0
- data/spec/operawatir/desktop/quicklabel_spec.rb +28 -0
- data/spec/operawatir/desktop/quickradiobutton_spec.rb +24 -0
- data/spec/operawatir/desktop/quicksearchfield_spec.rb +26 -0
- data/spec/operawatir/desktop/quicktab_spec.rb +86 -0
- data/spec/operawatir/desktop/quickthumbnail_spec.rb +37 -0
- data/spec/operawatir/desktop/quicktreeitem_spec.rb +135 -0
- data/spec/operawatir/desktop/quicktreeview_spec.rb +30 -0
- data/spec/operawatir/desktop/quickwidget_spec.rb +101 -0
- data/spec/operawatir/desktop/quickwindow_spec.rb +108 -0
- data/spec/operawatir/desktop/shared/shared.rb +138 -0
- data/spec/operawatir/fixtures/boxes.html +22 -0
- data/spec/operawatir/fixtures/browsers.svg +367 -0
- data/spec/operawatir/fixtures/frames.html +13 -0
- data/spec/operawatir/fixtures/grid.html +29 -0
- data/spec/operawatir/fixtures/input_fields_value.html +6 -0
- data/spec/operawatir/fixtures/onclick.html +20 -0
- data/spec/operawatir/fixtures/paragraphs.html +15 -0
- data/spec/operawatir/fixtures/two_input_fields.html +6 -0
- data/spec/{new_watirspec → operawatir}/guards.rb +0 -0
- data/spec/operawatir/matchers.rb +68 -0
- data/spec/{legacy_watirspec → operawatir}/server.rb +0 -0
- data/spec/operawatir/watirspec.rake +43 -0
- data/spec/operawatir/watirspec_desktophelper.rb +14 -0
- data/spec/operawatir/watirspec_helper.rb +62 -0
- data/spec/{legacy_watirspec → watir2}/area_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/areas_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/browser_spec.rb +2 -0
- data/spec/{legacy_watirspec → watir2}/button_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/buttons_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/checkbox_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/checkboxes_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/collections_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dd_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dds_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/del_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dels_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/div_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/divs_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dl_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dls_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dt_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/dts_spec.rb +0 -0
- data/spec/watir2/element_spec.rb +155 -0
- data/spec/{legacy_watirspec → watir2}/em_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ems_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/filefield_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/filefields_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/2000_spans.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/bug_duplicate_attributes.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/bug_javascript_001.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/buttons_with_duplicate_ids.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/collections.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/definition_lists.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/euc-jp_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/forms_with_input_elements.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frame_1.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frame_2.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/frames.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/iframes.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/1.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/2.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/3.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/button.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/circle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/map.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/map2.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/minus.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/originaltriangle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/plus.gif +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/square.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/images/triangle.jpg +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/iso-2022-jp_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/javascript/helpers.js +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/jquery.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/latin1_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/multiple_ids.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/non_control_elements.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/parser_bug_001.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/prevent_form_submit.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/right_click.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/shift_jis_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/tables.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/timeout.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/timeout_window_location.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/tiny_mce.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/utf8_text.html +0 -0
- data/spec/{legacy_watirspec → watir2}/fixtures/watirspec.css +0 -0
- data/spec/{legacy_watirspec → watir2}/form_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/forms_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/frame_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/frames_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/guards.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hidden_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hiddens_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hn_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/hns_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/image_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/images_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ins_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/inses_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/label_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/labels_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/li_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/link_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/links_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/lis_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/map_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/maps_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/meta_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/metas_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ol_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ols_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/option_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/p_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/pre_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/pres_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ps_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/radio_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/radios_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/select_list_spec.rb +84 -71
- data/spec/{legacy_watirspec → watir2}/select_lists_spec.rb +0 -0
- data/spec/{new_watirspec → watir2}/server.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/span_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/spans_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/spec_helper.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/strong_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/strongs_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_bodies_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_body_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_cell_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_cells_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_footer_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_footers_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_header_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_headers_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_row_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_rows_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/table_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/tables_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/text_field_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/text_fields_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/ul_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/uls_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/watir_compatibility_spec.rb +0 -0
- data/spec/{legacy_watirspec → watir2}/watirspec_helper.rb +0 -0
- data/spec/{new_watirspec → watir3}/browser_spec.rb +11 -21
- data/spec/{new_watirspec → watir3}/clipboard_spec.rb +2 -2
- data/spec/{new_watirspec → watir3}/collection_spec.rb +0 -0
- data/spec/{new_watirspec → watir3}/element_spec.rb +30 -12
- data/spec/watir3/guards.rb +39 -0
- data/spec/{new_watirspec → watir3}/keys_spec.rb +0 -0
- data/spec/watir3/server.rb +91 -0
- data/spec/{new_watirspec → watir3}/watirspec_helper.rb +0 -0
- data/spec/{new_watirspec → watir3}/window_spec.rb +8 -83
- metadata +315 -280
- data/lib/operadriver/selenium-common.jar +0 -0
- data/spec/legacy_watirspec/element_spec.rb +0 -86
- data/spec/new_watirspec/preferences_spec.rb +0 -144
- data/spec/new_watirspec/screenshot_spec.rb +0 -34
Binary file
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require File.expand_path("../spec_helper", __FILE__)
|
3
|
-
|
4
|
-
describe "Element" do
|
5
|
-
|
6
|
-
before :each do
|
7
|
-
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
|
8
|
-
end
|
9
|
-
|
10
|
-
describe ".new" do
|
11
|
-
it "finds elements matching the conditions when given a hash of :how => 'what' arguments" do
|
12
|
-
browser.checkbox(:name => 'new_user_interests', :title => 'Dancing is fun!').value.should == 'dancing'
|
13
|
-
#browser.text_field(:class_name => 'name', :index => 2).id.should == 'new_user_last_name'
|
14
|
-
end
|
15
|
-
|
16
|
-
it "raises UnknownObjectException with a sane error message when given a hash of :how => 'what' arguments (non-existing object)" do
|
17
|
-
conditions = {:index => 100, :name => "foo"}
|
18
|
-
lambda { browser.text_field(conditions).id }.should raise_error(UnknownObjectException, /Unable to locate TextField, using (\{:name=>"foo", :index=>100\}|\{:index=>100, :name=>"foo"\})/)
|
19
|
-
end
|
20
|
-
|
21
|
-
bug "WTR-351", :watir do
|
22
|
-
it "raises ArgumentError if given the wrong number of arguments" do
|
23
|
-
container = mock("container").as_null_object
|
24
|
-
|
25
|
-
lambda { Element.new(container, 1,2,3,4) }.should raise_error(ArgumentError, "wrong number of arguments (4 for 2)")
|
26
|
-
lambda { Element.new(container, "foo") }.should raise_error(ArgumentError, "wrong number of arguments (1 for 2)")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#focus" do
|
32
|
-
it "fires the onfocus event for the given element" do
|
33
|
-
tf = browser.text_field(:id, "new_user_occupation")
|
34
|
-
tf.value.should == "Developer"
|
35
|
-
tf.focus
|
36
|
-
browser.div(:id, "onfocus_test").text.should == "changed by onfocus event"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#fire_event" do
|
41
|
-
it "should fire the given event" do
|
42
|
-
browser.div(:id, "onfocus_test").text.should be_empty
|
43
|
-
browser.text_field(:id, "new_user_occupation").fire_event('onfocus')
|
44
|
-
browser.div(:id, "onfocus_test").text.should == "changed by onfocus event"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "#parent" do
|
49
|
-
bug "WTR-352", :watir do
|
50
|
-
it "gets the parent of this element" do
|
51
|
-
browser.text_field(:id, "new_user_email").parent.should be_instance_of(Form)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "#visible?" do
|
57
|
-
it "returns true if the element is visible" do
|
58
|
-
browser.text_field(:id, "new_user_email").should be_visible
|
59
|
-
end
|
60
|
-
|
61
|
-
it "returns false if the element is input element where type == 'hidden'" do
|
62
|
-
browser.text_field(:id, "new_user_interests_dolls").should_not be_visible
|
63
|
-
end
|
64
|
-
|
65
|
-
bug "WTR-336", :watir do
|
66
|
-
it "returns false if the element has style='display: none;'" do
|
67
|
-
browser.div(:id, 'changed_language').should_not be_visible
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
it "returns false if the element has style='visibility: hidden;" do
|
72
|
-
browser.div(:id, 'wants_newsletter').should_not be_visible
|
73
|
-
end
|
74
|
-
|
75
|
-
it "returns false if one of the parent elements is hidden" do
|
76
|
-
browser.div(:id, 'hidden_parent').should_not be_visible
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "#exist?" do
|
81
|
-
it "doesn't raise when called on nested elements" do
|
82
|
-
browser.div(:id, 'no_such_div').link(:id, 'no_such_id').should_not exist
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
@@ -1,144 +0,0 @@
|
|
1
|
-
require File.expand_path('../watirspec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe 'Preferences' do
|
4
|
-
|
5
|
-
before :all do
|
6
|
-
@prefs = browser.preferences
|
7
|
-
end
|
8
|
-
|
9
|
-
describe '#new' do
|
10
|
-
it 'constructs a new instance' do
|
11
|
-
@prefs.exist?.should be_true
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe '#to_s' do; end
|
16
|
-
|
17
|
-
describe '#each_section' do # #each is an alias
|
18
|
-
it 'contains a list' do
|
19
|
-
@prefs.each_section do |p|
|
20
|
-
p.kind_of?(OperaWatir::Preferences::Entry).should be_true
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#length' do; end # #size is an alias
|
26
|
-
describe '#last' do; end
|
27
|
-
describe '#empty?' do; end
|
28
|
-
|
29
|
-
describe 'Section' do # Entry / Preferences#method_missing
|
30
|
-
|
31
|
-
before :all do
|
32
|
-
@section = @prefs.link
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '#new' do
|
36
|
-
it 'constructs a new instance' do
|
37
|
-
@section.exist?.should be_true
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe '#value' do; end
|
42
|
-
describe '#value=' do; end
|
43
|
-
describe '#default' do; end
|
44
|
-
describe '#default!' do; end
|
45
|
-
describe '#each_key' do; end # #each is an alias
|
46
|
-
|
47
|
-
describe '#is_section?' do
|
48
|
-
it 'is a section' do
|
49
|
-
@section.is_section?.should be_true
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe 'Keys' do # Entry / Entry#method_missing
|
54
|
-
|
55
|
-
before :all do
|
56
|
-
@key = @section.expiry
|
57
|
-
end
|
58
|
-
|
59
|
-
describe '#type' do
|
60
|
-
it '`expiry` is a type integer' do
|
61
|
-
@key.type.should include 'Integer'
|
62
|
-
end
|
63
|
-
|
64
|
-
it '`color` is a type boolean' do
|
65
|
-
@section.color.type.should include 'Boolean'
|
66
|
-
end
|
67
|
-
|
68
|
-
it '`opera_account.server_address` is a type string' do
|
69
|
-
@prefs.opera_account.server_address.should include 'String'
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe '#value' do
|
74
|
-
it 'is not empty' do
|
75
|
-
@key.value.should_not be_empty
|
76
|
-
end
|
77
|
-
|
78
|
-
it 'is numeric' do
|
79
|
-
@key.value.should be_numeric
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe '#value=' do
|
84
|
-
it 'is changed when set' do
|
85
|
-
@key.value = '20'
|
86
|
-
@key.value.should == '20'
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'has effect in the browser when changed' do
|
90
|
-
@section.strike_through.value = true
|
91
|
-
window.url = fixture('simple.html')
|
92
|
-
window.a.eval_js('this.currentStyle.textDecoration').should include /strike\-through/
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'does not allow setting an invalid value' do
|
96
|
-
old_value = @section.color.value
|
97
|
-
@section.color.value = 'foo'
|
98
|
-
@section.color.value.should_not == 'foo'
|
99
|
-
@section.color.value.should == old_value
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
describe '#default' do
|
104
|
-
it 'returns the default value' do
|
105
|
-
@key.default == '10'
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
describe '#default!' do
|
110
|
-
before :each do
|
111
|
-
@default_value = @key.default
|
112
|
-
@key.value = '1337'
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'returns and sets default value' do
|
116
|
-
@key.default!.should == @default_value
|
117
|
-
@key.value.should == @default_value
|
118
|
-
end
|
119
|
-
|
120
|
-
after :all do
|
121
|
-
@key.value = @default_value
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe '#each_key' do; end # #each is an alias
|
126
|
-
|
127
|
-
describe '#is_section?' do
|
128
|
-
it 'is not a section' do
|
129
|
-
@key.is_section?.should be_false
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
end
|
136
|
-
|
137
|
-
describe '#cleanup' do; end
|
138
|
-
describe '#cleanup!' do; end
|
139
|
-
|
140
|
-
after :all do
|
141
|
-
@prefs.cleanup!
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require File.expand_path('../watirspec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe 'Element' do
|
4
|
-
|
5
|
-
before :each do
|
6
|
-
browser.url = fixture('boxes.html')
|
7
|
-
@one = window.find_by_id('one');
|
8
|
-
@two = window.find_by_id('two');
|
9
|
-
@three = window.find_by_id('three');
|
10
|
-
@four = window.find_by_id('four');
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#visual_hash' do
|
14
|
-
it 'returns a hash' do
|
15
|
-
@one.visual_hash.length.should == 34
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'returns identical hashes for visually identical elements' do
|
19
|
-
@one.visual_hash.should == @three.visual_hash
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'returns different hashes for visually different elements' do
|
23
|
-
@one.visual_hash.should_not == @two.visual_hash
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'returns correct hashes when querying several elements in sequence' do
|
27
|
-
@one.visual_hash.should == @three.visual_hash
|
28
|
-
@two.visual_hash.should == @four.visual_hash
|
29
|
-
@one.visual_hash.should_not == @two.visual_hash
|
30
|
-
@two.visual_hash.should_not == @three.visual_hash
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|