fluent 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +11 -0
- data/lib/fluent.rb +4 -0
- data/lib/fluent/factory.rb +20 -1
- data/lib/fluent/version.rb +1 -1
- metadata +62 -129
- data/.gitignore +0 -19
- data/.travis.yml +0 -14
- data/Gemfile +0 -5
- data/Rakefile +0 -13
- data/fluent.gemspec +0 -33
- data/spec/enclosers_spec.rb +0 -38
- data/spec/evaluators_spec.rb +0 -88
- data/spec/factory_spec.rb +0 -49
- data/spec/fluent_spec.rb +0 -40
- data/spec/generators/button_generators_spec.rb +0 -77
- data/spec/generators/cell_generators_spec.rb +0 -50
- data/spec/generators/checkbox_generators_spec.rb +0 -88
- data/spec/generators/div_generators_spec.rb +0 -49
- data/spec/generators/form_generators_spec.rb +0 -42
- data/spec/generators/heading_generators_spec.rb +0 -87
- data/spec/generators/hidden_generators_spec.rb +0 -49
- data/spec/generators/image_generators_spec.rb +0 -42
- data/spec/generators/label_generators_spec.rb +0 -49
- data/spec/generators/link_generators_spec.rb +0 -64
- data/spec/generators/list_item_generators_spec.rb +0 -53
- data/spec/generators/ordered_list_generators_spec.rb +0 -53
- data/spec/generators/paragraph_generators_spec.rb +0 -65
- data/spec/generators/radio_generators_spec.rb +0 -85
- data/spec/generators/select_list_generators_spec.rb +0 -120
- data/spec/generators/span_generators_spec.rb +0 -49
- data/spec/generators/table_generators_spec.rb +0 -49
- data/spec/generators/text_area_generators_spec.rb +0 -55
- data/spec/generators/text_field_generators_spec.rb +0 -81
- data/spec/generators/unordered_list_generators_spec.rb +0 -53
- data/spec/generators_spec.rb +0 -87
- data/spec/mock_app.rb +0 -31
- data/spec/platform_object_spec.rb +0 -32
- data/spec/spec_helper.rb +0 -19
- data/spec/web_element_spec.rb +0 -38
- data/spec/web_element_watir_spec.rb +0 -156
- data/spec/web_elements/button_spec.rb +0 -21
- data/spec/web_elements/cell_spec.rb +0 -13
- data/spec/web_elements/checkbox_spec.rb +0 -25
- data/spec/web_elements/div_spec.rb +0 -9
- data/spec/web_elements/form_spec.rb +0 -9
- data/spec/web_elements/heading_spec.rb +0 -28
- data/spec/web_elements/hidden_spec.rb +0 -9
- data/spec/web_elements/image_spec.rb +0 -9
- data/spec/web_elements/label_spec.rb +0 -9
- data/spec/web_elements/link_spec.rb +0 -9
- data/spec/web_elements/list_item_spec.rb +0 -9
- data/spec/web_elements/option_spec.rb +0 -9
- data/spec/web_elements/ordered_list_spec.rb +0 -42
- data/spec/web_elements/paragraph_spec.rb +0 -9
- data/spec/web_elements/radio_spec.rb +0 -25
- data/spec/web_elements/select_list_spec.rb +0 -45
- data/spec/web_elements/span_spec.rb +0 -9
- data/spec/web_elements/table_row_spec.rb +0 -47
- data/spec/web_elements/table_spec.rb +0 -54
- data/spec/web_elements/text_area_spec.rb +0 -27
- data/spec/web_elements/text_field_spec.rb +0 -29
- data/spec/web_elements/unordered_list_spec.rb +0 -42
@@ -1,13 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::Cell' do
|
4
|
-
|
5
|
-
it 'should register with a table definition tag' do
|
6
|
-
::Fluent::WebElements.get_class_for(:td).should == ::Fluent::WebElements::Cell
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should register with a table header tag' do
|
10
|
-
::Fluent::WebElements.get_class_for(:th).should == ::Fluent::WebElements::Cell
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'WebElements::CheckBox' do
|
4
|
-
let(:checkbox_object) { double('checkbox_object') }
|
5
|
-
let(:checkbox_definition) { ::Fluent::WebElements::CheckBox.new(checkbox_object, :platform => :watir_webdriver) }
|
6
|
-
|
7
|
-
it 'should be able to determine if the checkbox element is checked' do
|
8
|
-
checkbox_object.should_receive(:set?).and_return(true)
|
9
|
-
checkbox_definition.checked?
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should be able to check the checkbox' do
|
13
|
-
checkbox_object.should_receive(:set)
|
14
|
-
checkbox_definition.check
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should be able to uncheck the checkbox' do
|
18
|
-
checkbox_object.should_receive(:clear)
|
19
|
-
checkbox_definition.uncheck
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should register with a checkbox tag' do
|
23
|
-
::Fluent::WebElements.get_class_for(:input, :checkbox).should == ::Fluent::WebElements::CheckBox
|
24
|
-
end
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::Heading' do
|
4
|
-
|
5
|
-
it 'should register with a h1 tag' do
|
6
|
-
::Fluent::WebElements.get_class_for(:h1).should == ::Fluent::WebElements::Heading
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should register with a h2 tag' do
|
10
|
-
::Fluent::WebElements.get_class_for(:h2).should == ::Fluent::WebElements::Heading
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should register with a h3 tag' do
|
14
|
-
::Fluent::WebElements.get_class_for(:h3).should == ::Fluent::WebElements::Heading
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should register with a h4 tag' do
|
18
|
-
::Fluent::WebElements.get_class_for(:h4).should == ::Fluent::WebElements::Heading
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should register with a h5 tag' do
|
22
|
-
::Fluent::WebElements.get_class_for(:h5).should == ::Fluent::WebElements::Heading
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should register with a h6 tag' do
|
26
|
-
::Fluent::WebElements.get_class_for(:h6).should == ::Fluent::WebElements::Heading
|
27
|
-
end
|
28
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::OrderedList' do
|
4
|
-
|
5
|
-
it 'should register with a ordered list tag' do
|
6
|
-
::Fluent::WebElements.get_class_for(:ol).should == ::Fluent::WebElements::OrderedList
|
7
|
-
end
|
8
|
-
|
9
|
-
context 'on the watir platform' do
|
10
|
-
let(:ol_element) { double('ol_element') }
|
11
|
-
let(:watir_ordered_list) { Fluent::WebElements::OrderedList.new(ol_element, :platform => :watir_webdriver) }
|
12
|
-
|
13
|
-
it 'should return a list item when indexed' do
|
14
|
-
ol_element.stub(:ols).and_return([ol_element])
|
15
|
-
ol_element.stub(:find_elements).and_return(ol_element)
|
16
|
-
ol_element.stub(:map).and_return([ol_element])
|
17
|
-
ol_element.stub(:parent).and_return(ol_element)
|
18
|
-
ol_element.stub(:element).and_return(ol_element)
|
19
|
-
ol_element.stub(:==).and_return(true)
|
20
|
-
watir_ordered_list[1]
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should know how many list items it contains' do
|
24
|
-
ol_element.stub(:ols).and_return([ol_element])
|
25
|
-
ol_element.stub(:find_elements).and_return(ol_element)
|
26
|
-
ol_element.stub(:map).and_return([ol_element])
|
27
|
-
ol_element.stub(:parent).and_return(ol_element)
|
28
|
-
ol_element.stub(:element).and_return(ol_element)
|
29
|
-
ol_element.stub(:==).and_return(true)
|
30
|
-
watir_ordered_list.items.should == 1
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should iterate over the list items' do
|
34
|
-
watir_ordered_list.should_receive(:items).and_return(5)
|
35
|
-
watir_ordered_list.stub(:[])
|
36
|
-
count = 0
|
37
|
-
watir_ordered_list.each { |item| count += 1 }
|
38
|
-
count.should == 5
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'WebElements::Radio' do
|
4
|
-
let(:radio_object) { double('radio_object') }
|
5
|
-
let(:radio_definition) { ::Fluent::WebElements::Radio.new(radio_object, :platform => :watir_webdriver) }
|
6
|
-
|
7
|
-
it 'should be able to see if a radio is selected' do
|
8
|
-
radio_object.should_receive(:set?).and_return(true)
|
9
|
-
radio_definition.selected?
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should be able to select a radio' do
|
13
|
-
radio_object.should_receive(:set).and_return(true)
|
14
|
-
radio_definition.select
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should be able to clear a radio' do
|
18
|
-
radio_object.should_receive(:clear).and_return(true)
|
19
|
-
radio_definition.clear
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should register with a radio type' do
|
23
|
-
::Fluent::WebElements.get_class_for(:input, :radio).should == ::Fluent::WebElements::Radio
|
24
|
-
end
|
25
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'WebElements::SelectList' do
|
4
|
-
let(:select_list_object) { double('select_list_object') }
|
5
|
-
let(:select_list_definition) { ::Fluent::WebElements::SelectList.new(select_list_object, :platform => :watir_webdriver) }
|
6
|
-
let(:select_list_options) { [select_list_object, select_list_object] }
|
7
|
-
|
8
|
-
# select_list_actual == select_list_definition
|
9
|
-
|
10
|
-
it 'should determine if an option is selected' do
|
11
|
-
select_list_object.stub(:selected?).with('testing').and_return(true)
|
12
|
-
select_list_definition.selected?('testing')
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should be able to select an item by option' do
|
16
|
-
select_list_object.should_receive(:select).and_return(true)
|
17
|
-
select_list_definition.select('testing')
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should be able to select an item by value' do
|
21
|
-
select_list_object.should_receive(:select_value).and_return(true)
|
22
|
-
select_list_definition.select_value('testing')
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should return an array of selected options' do
|
26
|
-
select_list_object.stub(:selected_options).and_return(select_list_options)
|
27
|
-
select_list_object.stub(:text).and_return(select_list_object)
|
28
|
-
select_list_definition.selected_options.should == select_list_options
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should get the values for any selected options' do
|
32
|
-
select_list_object.stub(:selected_options).and_return(select_list_options)
|
33
|
-
select_list_object.stub(:value).and_return(select_list_object)
|
34
|
-
select_list_definition.selected_values.should == select_list_options
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should determine if an option is available in the list' do
|
38
|
-
select_list_object.stub(:include?).with('testing').and_return(true)
|
39
|
-
select_list_definition.include?('testing')
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should register with a select list tag' do
|
43
|
-
::Fluent::WebElements.get_class_for(:select).should == ::Fluent::WebElements::SelectList
|
44
|
-
end
|
45
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::TableRow' do
|
4
|
-
let(:table) { double('table') }
|
5
|
-
let(:table_cell) { double('table_cell') }
|
6
|
-
let(:table_row_object) { double('table_row_object') }
|
7
|
-
|
8
|
-
context 'on the watir platform' do
|
9
|
-
it 'should return a table cell when indexed by number' do
|
10
|
-
table_row = Fluent::WebElements::TableRow.new(table_row_object, :platform => :watir_webdriver)
|
11
|
-
|
12
|
-
table_row.stub(:columns).and_return(2)
|
13
|
-
table_row_object.should_receive(:[]).with(1).and_return(table_cell)
|
14
|
-
|
15
|
-
table_row[1].should be_instance_of Fluent::WebElements::Cell
|
16
|
-
end
|
17
|
-
|
18
|
-
# Determine why this is not working.
|
19
|
-
#it 'should return a table cell when indexed by string' do
|
20
|
-
#table_row = Fluent::WebElements::TableRow.new(table_row_object, :platform => :watir_webdriver)
|
21
|
-
|
22
|
-
#table.should_receive(:[]).and_return(table_cell)
|
23
|
-
#table.stub(:tag_name).and_return(table)
|
24
|
-
#table_row_object.stub(:parent).and_return(table)
|
25
|
-
#table_row_object.should_receive(:[]).with(0).and_return(table_cell)
|
26
|
-
|
27
|
-
#table_row['test'].should be_instance_of Fluent::WebElements::Cell
|
28
|
-
#end
|
29
|
-
|
30
|
-
it 'should return the number of columns' do
|
31
|
-
table_row = Fluent::WebElements::TableRow.new(table_row_object, :platform => :watir_webdriver)
|
32
|
-
table_row_object.stub(:wd).and_return(table_row_object)
|
33
|
-
table_row_object.should_receive(:find_elements).with(:xpath, './/child::td|th').and_return(table_row_object)
|
34
|
-
table_row_object.should_receive(:size).and_return(3)
|
35
|
-
table_row.columns.should == 3
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should iterate over the table columns' do
|
39
|
-
table_row = Fluent::WebElements::TableRow.new(table_row_object, :platform => :watir_webdriver)
|
40
|
-
table_row.should_receive(:columns).and_return(2)
|
41
|
-
table_row.stub(:[]).and_return(table_row_object)
|
42
|
-
count = 0
|
43
|
-
table_row.each { |e| count += 1 }
|
44
|
-
count.should == 2
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::Table' do
|
4
|
-
|
5
|
-
let(:table_object) { double('table_object') }
|
6
|
-
let(:table_row_object) { double('table_row_object') }
|
7
|
-
let(:table) { Fluent::WebElements::Table }
|
8
|
-
|
9
|
-
it 'should register with a table tag' do
|
10
|
-
::Fluent::WebElements.get_class_for(:table).should == ::Fluent::WebElements::Table
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'on the watir platform' do
|
14
|
-
let(:watir_table) { Fluent::WebElements::Table.new(table_object, :platform => :watir_webdriver) }
|
15
|
-
|
16
|
-
it 'should return a table row when indexed' do
|
17
|
-
table_object.stub(:[]).with(1).and_return(table_object)
|
18
|
-
watir_table[1].should be_instance_of Fluent::WebElements::TableRow
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should return the first row' do
|
22
|
-
table_object.stub(:[]).with(0).and_return(table_object)
|
23
|
-
watir_table.first_row.should be_instance_of Fluent::WebElements::TableRow
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should return the last row' do
|
27
|
-
table_object.stub(:[]).with(-1).and_return(table_object)
|
28
|
-
watir_table.last_row.should be_instance_of Fluent::WebElements::TableRow
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should return a row using text from the first column' do
|
32
|
-
table_object.stub(:[]).with('row_text').and_return(table_object)
|
33
|
-
table_object.should_receive(:rows).and_return(table_object)
|
34
|
-
table_object.should_receive(:find_index).and_return('row_text')
|
35
|
-
watir_table['row_text'].should be_instance_of Fluent::WebElements::TableRow
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should return the number of rows' do
|
39
|
-
table_object.should_receive(:wd).and_return(table_object)
|
40
|
-
table_object.should_receive(:find_elements).with(:xpath, './/child::tr').and_return(table_object)
|
41
|
-
table_object.should_receive(:size).and_return(2)
|
42
|
-
watir_table.rows.should == 2
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'should iterate over the table rows' do
|
46
|
-
watir_table.should_receive(:rows).and_return(2)
|
47
|
-
table_object.stub(:[]).and_return(table_object)
|
48
|
-
count = 0
|
49
|
-
watir_table.each { |e| count += 1 }
|
50
|
-
count.should == 2
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'Fluent::WebElements::TextArea' do
|
4
|
-
let(:text_area_object) { double('text_area_object') }
|
5
|
-
let(:text_area_definition) { ::Fluent::WebElements::TextArea.new(text_area_object, :platform => :watir_webdriver) }
|
6
|
-
|
7
|
-
it 'should register with a text area tag' do
|
8
|
-
::Fluent::WebElements.get_class_for(:textarea).should == ::Fluent::WebElements::TextArea
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should get the value of a text area' do
|
12
|
-
text_area_object.should_receive(:value).and_return('testing')
|
13
|
-
text_area_definition.value.should == 'testing'
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should set the value of a text area' do
|
17
|
-
text_area_object.should_receive(:set).with('testing')
|
18
|
-
text_area_definition.value = 'testing'
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should clear the text area' do
|
22
|
-
text_area_object.should_receive(:wd).and_return(text_area_object)
|
23
|
-
text_area_object.should_receive(:clear).and_return(true)
|
24
|
-
text_area_definition.clear
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe 'WebElements::TextField' do
|
4
|
-
let(:text_field_object) { double('text_field_object') }
|
5
|
-
let(:text_field_definition) { ::Fluent::WebElements::TextField.new(text_field_object, :platform => :watir_webdriver) }
|
6
|
-
|
7
|
-
it 'should append text to a text field' do
|
8
|
-
text_field_object.should_receive(:send_keys).with('testing')
|
9
|
-
text_field_definition.append 'testing'
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should set the value of a text field' do
|
13
|
-
text_field_object.should_receive(:set).with('testing')
|
14
|
-
text_field_definition.value = 'testing'
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should get the value of a text field' do
|
18
|
-
text_field_object.should_receive(:value).and_return('testing')
|
19
|
-
text_field_definition.value.should == 'testing'
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should register with a text tag' do
|
23
|
-
::Fluent::WebElements.get_class_for(:input, :text).should == ::Fluent::WebElements::TextField
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should register with a password tag' do
|
27
|
-
::Fluent::WebElements.get_class_for(:input, :password).should == ::Fluent::WebElements::TextField
|
28
|
-
end
|
29
|
-
end
|