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,65 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class ParagraphGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
paragraph :purpose, id: 'purpose'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { ParagraphGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'paragraph generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the paragraph' do
|
16
|
-
watir_definition.should respond_to(:purpose_object)
|
17
|
-
watir_definition.should respond_to(:purpose_element)
|
18
|
-
watir_definition.should respond_to(:purpose_paragraph)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the paragraph' do
|
22
|
-
watir_definition.should respond_to(:purpose)
|
23
|
-
watir_definition.should respond_to(:purpose_exists?)
|
24
|
-
watir_definition.should respond_to(:purpose_visible?)
|
25
|
-
watir_definition.should respond_to(:purpose?)
|
26
|
-
watir_definition.should respond_to(:purpose_?)
|
27
|
-
watir_definition.should respond_to(:purpose_paragraph_exists?)
|
28
|
-
watir_definition.should respond_to(:purpose_paragraph_visible?)
|
29
|
-
watir_definition.should respond_to(:purpose_paragraph?)
|
30
|
-
watir_definition.should respond_to(:purpose_paragraph_?)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'when used by the watir platform' do
|
35
|
-
it 'should locate the paragraph' do
|
36
|
-
watir_browser.should_receive(:p).and_return(watir_browser)
|
37
|
-
web_element = watir_definition.purpose_object
|
38
|
-
web_element.should_not be_nil
|
39
|
-
web_element.should be_instance_of Fluent::WebElements::Paragraph
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should return the text of a paragraph' do
|
43
|
-
watir_browser.should_receive(:p).and_return(watir_browser)
|
44
|
-
watir_browser.should_receive(:text).and_return('testing')
|
45
|
-
watir_definition.purpose.should == 'testing'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should determine if a paragraph exists' do
|
49
|
-
watir_browser.should_receive(:p).exactly(3).times.and_return(watir_browser)
|
50
|
-
watir_browser.should_receive(:exists?).exactly(3).times.and_return(watir_browser)
|
51
|
-
watir_definition.purpose_paragraph_exists?.should be_true
|
52
|
-
watir_definition.purpose_exists?.should be_true
|
53
|
-
watir_definition.purpose?.should be_true
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should determine if a paragraph is visible' do
|
57
|
-
watir_browser.should_receive(:p).exactly(3).times.and_return(watir_browser)
|
58
|
-
watir_browser.should_receive(:present?).exactly(3).times.and_return(watir_browser)
|
59
|
-
watir_definition.purpose_paragraph_visible?.should be_true
|
60
|
-
watir_definition.purpose_visible?.should be_true
|
61
|
-
watir_definition.purpose_?.should be_true
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class RadioGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
radio :female, name: 'gender'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { RadioGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'radio generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the radio' do
|
16
|
-
watir_definition.should respond_to(:female_object)
|
17
|
-
watir_definition.should respond_to(:female_element)
|
18
|
-
watir_definition.should respond_to(:female_radio)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the radio' do
|
22
|
-
watir_definition.should respond_to(:select_female)
|
23
|
-
watir_definition.should respond_to(:set_female)
|
24
|
-
watir_definition.should respond_to(:female_set?)
|
25
|
-
watir_definition.should respond_to(:female_selected?)
|
26
|
-
watir_definition.should respond_to(:female_exists?)
|
27
|
-
watir_definition.should respond_to(:female_visible?)
|
28
|
-
watir_definition.should respond_to(:female_enabled?)
|
29
|
-
watir_definition.should respond_to(:female?)
|
30
|
-
watir_definition.should respond_to(:female_?)
|
31
|
-
watir_definition.should respond_to(:female!)
|
32
|
-
watir_definition.should respond_to(:female_radio?)
|
33
|
-
watir_definition.should respond_to(:female_radio_?)
|
34
|
-
watir_definition.should respond_to(:female_radio!)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'when used by the watir platform' do
|
39
|
-
it 'should locate the radio' do
|
40
|
-
watir_browser.should_receive(:radio).and_return(watir_browser)
|
41
|
-
web_element = watir_definition.female_radio
|
42
|
-
web_element.should_not be_nil
|
43
|
-
web_element.should be_instance_of Fluent::WebElements::Radio
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'should determine if a radio is set' do
|
47
|
-
watir_browser.should_receive(:radio).twice.and_return(watir_browser)
|
48
|
-
watir_browser.should_receive(:set?).twice.and_return(watir_browser)
|
49
|
-
watir_definition.female_selected?.should be_true
|
50
|
-
watir_definition.female_set?.should be_true
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'should set a radio' do
|
54
|
-
watir_browser.should_receive(:radio).twice.and_return(watir_browser)
|
55
|
-
watir_browser.should_receive(:set).twice.and_return(watir_browser)
|
56
|
-
watir_definition.select_female
|
57
|
-
watir_definition.set_female
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'should determine if a radio exists' do
|
61
|
-
watir_browser.should_receive(:radio).exactly(3).times.and_return(watir_browser)
|
62
|
-
watir_browser.should_receive(:exists?).exactly(3).times.and_return(watir_browser)
|
63
|
-
watir_definition.female_radio_exists?.should be_true
|
64
|
-
watir_definition.female_exists?.should be_true
|
65
|
-
watir_definition.female?.should be_true
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'should determine if a radio is visible' do
|
69
|
-
watir_browser.should_receive(:radio).exactly(3).times.and_return(watir_browser)
|
70
|
-
watir_browser.should_receive(:present?).exactly(3).times.and_return(watir_browser)
|
71
|
-
watir_definition.female_radio_visible?.should be_true
|
72
|
-
watir_definition.female_visible?.should be_true
|
73
|
-
watir_definition.female_?.should be_true
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'should determine if a radio is enabled' do
|
77
|
-
watir_browser.should_receive(:radio).exactly(3).times.and_return(watir_browser)
|
78
|
-
watir_browser.should_receive(:enabled?).exactly(3).times.and_return(watir_browser)
|
79
|
-
watir_definition.female_radio_enabled?.should be_true
|
80
|
-
watir_definition.female_enabled?.should be_true
|
81
|
-
watir_definition.female!.should be_true
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class SelectListGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
select_list :list, id: 'list'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { SelectListGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'select list generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the select list' do
|
16
|
-
watir_definition.should respond_to(:list_object)
|
17
|
-
watir_definition.should respond_to(:list_element)
|
18
|
-
watir_definition.should respond_to(:list_select_list)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the select list' do
|
22
|
-
watir_definition.should respond_to(:list)
|
23
|
-
watir_definition.should respond_to(:list=)
|
24
|
-
watir_definition.should respond_to(:list_value?)
|
25
|
-
watir_definition.should respond_to(:list_options?)
|
26
|
-
watir_definition.should respond_to(:list_exists?)
|
27
|
-
watir_definition.should respond_to(:list_visible?)
|
28
|
-
watir_definition.should respond_to(:list_enabled?)
|
29
|
-
watir_definition.should respond_to(:list?)
|
30
|
-
watir_definition.should respond_to(:list_?)
|
31
|
-
watir_definition.should respond_to(:list!)
|
32
|
-
watir_definition.should respond_to(:list_select_list?)
|
33
|
-
watir_definition.should respond_to(:list_select_list_?)
|
34
|
-
watir_definition.should respond_to(:list_select_list!)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'when used by the watir platform' do
|
39
|
-
it 'should locate the select list' do
|
40
|
-
watir_browser.should_receive(:select_list).and_return(watir_browser)
|
41
|
-
web_element = watir_definition.list_object
|
42
|
-
web_element.should_not be_nil
|
43
|
-
web_element.should be_instance_of Fluent::WebElements::SelectList
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'should select an option from the select list' do
|
47
|
-
watir_browser.should_receive(:select_list).and_return watir_browser
|
48
|
-
watir_browser.should_receive(:select).with('testing')
|
49
|
-
watir_definition.list = 'testing'
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'should retrieve the current selected option from the select list' do
|
53
|
-
selected = 'testing'
|
54
|
-
selected.should_receive(:text).and_return('testing')
|
55
|
-
watir_browser.should_receive(:select_list).and_return(watir_browser)
|
56
|
-
watir_browser.should_receive(:selected_options).and_return([selected])
|
57
|
-
watir_definition.list.should == 'testing'
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'should retrieve the current value of a selected option' do
|
61
|
-
watir_browser.should_receive(:select_list).and_return(watir_browser)
|
62
|
-
watir_browser.should_receive(:value).and_return('testing')
|
63
|
-
watir_definition.list_value?.should == 'testing'
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'should retrieve a list of of selection options' do
|
67
|
-
option1 = double('option')
|
68
|
-
option2 = double('option')
|
69
|
-
option1.should_receive(:text).and_return('list_item_1')
|
70
|
-
option2.should_receive(:text).and_return('list_item_2')
|
71
|
-
select_element = double('select')
|
72
|
-
select_element.should_receive(:options).twice.and_return([option1, option2])
|
73
|
-
watir_definition.should_receive(:list_object).and_return(select_element)
|
74
|
-
watir_definition.list_options?.should == ['list_item_1','list_item_2']
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'should return an option when indexed' do
|
78
|
-
list_element = double('select_list')
|
79
|
-
options = [list_element, list_element]
|
80
|
-
web_element = Fluent::WebElements::SelectList.new(list_element, :platform => :watir_webdriver)
|
81
|
-
list_element.should_receive(:wd).and_return(list_element)
|
82
|
-
list_element.should_receive(:find_elements).with(:xpath, './/child::option').and_return(options)
|
83
|
-
web_element[0].should be_instance_of Fluent::WebElements::Option
|
84
|
-
end
|
85
|
-
|
86
|
-
it 'should return an array of options when indexed' do
|
87
|
-
list_element = double('select_list')
|
88
|
-
options = [list_element, list_element]
|
89
|
-
web_element = Fluent::WebElements::SelectList.new(list_element, :platform => :watir_webdriver)
|
90
|
-
list_element.should_receive(:wd).and_return(list_element)
|
91
|
-
list_element.should_receive(:find_elements).with(:xpath, './/child::option').and_return(options)
|
92
|
-
web_element.options.size.should == 2
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'should determine if a select list exists' do
|
96
|
-
watir_browser.should_receive(:select_list).exactly(3).times.and_return(watir_browser)
|
97
|
-
watir_browser.should_receive(:exists?).exactly(3).times.and_return(watir_browser)
|
98
|
-
watir_definition.list_select_list_exists?.should be_true
|
99
|
-
watir_definition.list_exists?.should be_true
|
100
|
-
watir_definition.list?.should be_true
|
101
|
-
end
|
102
|
-
|
103
|
-
it 'should determine if a select list is visible' do
|
104
|
-
watir_browser.should_receive(:select_list).exactly(3).times.and_return(watir_browser)
|
105
|
-
watir_browser.should_receive(:present?).exactly(3).times.and_return(watir_browser)
|
106
|
-
watir_definition.list_select_list_visible?.should be_true
|
107
|
-
watir_definition.list_visible?.should be_true
|
108
|
-
watir_definition.list_?.should be_true
|
109
|
-
end
|
110
|
-
|
111
|
-
it 'should determine if a select list is enabled' do
|
112
|
-
watir_browser.should_receive(:select_list).exactly(3).times.and_return(watir_browser)
|
113
|
-
watir_browser.should_receive(:enabled?).exactly(3).times.and_return(watir_browser)
|
114
|
-
watir_definition.list_select_list_enabled?.should be_true
|
115
|
-
watir_definition.list_enabled?.should be_true
|
116
|
-
watir_definition.list!.should be_true
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class SpanGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
span :inline, id: 'inline'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { SpanGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'span generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the span' do
|
16
|
-
watir_definition.should respond_to(:inline_object)
|
17
|
-
watir_definition.should respond_to(:inline_element)
|
18
|
-
watir_definition.should respond_to(:inline_span)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the span' do
|
22
|
-
watir_definition.should respond_to(:inline)
|
23
|
-
watir_definition.should respond_to(:inline_exists?)
|
24
|
-
watir_definition.should respond_to(:inline_visible?)
|
25
|
-
watir_definition.should respond_to(:inline?)
|
26
|
-
watir_definition.should respond_to(:inline_?)
|
27
|
-
watir_definition.should respond_to(:inline_span_exists?)
|
28
|
-
watir_definition.should respond_to(:inline_span_visible?)
|
29
|
-
watir_definition.should respond_to(:inline_span?)
|
30
|
-
watir_definition.should respond_to(:inline_span_?)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'when used by the watir platform' do
|
35
|
-
it 'should locate the span' do
|
36
|
-
watir_browser.should_receive(:span).and_return(watir_browser)
|
37
|
-
web_element = watir_definition.inline_span
|
38
|
-
web_element.should_not be_nil
|
39
|
-
web_element.should be_instance_of Fluent::WebElements::Span
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should return the text of a span' do
|
43
|
-
watir_browser.should_receive(:span).and_return(watir_browser)
|
44
|
-
watir_browser.should_receive(:text).and_return('testing')
|
45
|
-
watir_definition.inline.should == 'testing'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class TableGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
table :accounts, id: 'accounts'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { TableGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'table generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the table' do
|
16
|
-
watir_definition.should respond_to(:accounts_object)
|
17
|
-
watir_definition.should respond_to(:accounts_element)
|
18
|
-
watir_definition.should respond_to(:accounts_table)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the table' do
|
22
|
-
watir_definition.should respond_to(:accounts)
|
23
|
-
watir_definition.should respond_to(:accounts_exists?)
|
24
|
-
watir_definition.should respond_to(:accounts_visible?)
|
25
|
-
watir_definition.should respond_to(:accounts?)
|
26
|
-
watir_definition.should respond_to(:accounts_?)
|
27
|
-
watir_definition.should respond_to(:accounts_table_exists?)
|
28
|
-
watir_definition.should respond_to(:accounts_table_visible?)
|
29
|
-
watir_definition.should respond_to(:accounts_table?)
|
30
|
-
watir_definition.should respond_to(:accounts_table_?)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'when used by the watir platform' do
|
35
|
-
it 'should locate the table' do
|
36
|
-
watir_browser.should_receive(:table).and_return(watir_browser)
|
37
|
-
web_element = watir_definition.accounts_table
|
38
|
-
web_element.should_not be_nil
|
39
|
-
web_element.should be_instance_of Fluent::WebElements::Table
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should return the text of a table' do
|
43
|
-
watir_browser.should_receive(:table).and_return(watir_browser)
|
44
|
-
watir_browser.should_receive(:text).and_return('testing')
|
45
|
-
watir_definition.accounts.should == 'testing'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class TextAreaGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
text_area :summary, id: 'summary'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { TextAreaGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'text area generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the text area' do
|
16
|
-
watir_definition.should respond_to(:summary_object)
|
17
|
-
watir_definition.should respond_to(:summary_element)
|
18
|
-
watir_definition.should respond_to(:summary_text_area)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the text area' do
|
22
|
-
watir_definition.should respond_to(:summary)
|
23
|
-
watir_definition.should respond_to(:summary_exists?)
|
24
|
-
watir_definition.should respond_to(:summary_visible?)
|
25
|
-
watir_definition.should respond_to(:summary?)
|
26
|
-
watir_definition.should respond_to(:summary_?)
|
27
|
-
watir_definition.should respond_to(:summary_text_area_exists?)
|
28
|
-
watir_definition.should respond_to(:summary_text_area_visible?)
|
29
|
-
watir_definition.should respond_to(:summary_text_area?)
|
30
|
-
watir_definition.should respond_to(:summary_text_area_?)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'when used by the watir platform' do
|
35
|
-
it 'should locate the text area' do
|
36
|
-
watir_browser.should_receive(:textarea).and_return(watir_browser)
|
37
|
-
web_element = watir_definition.summary_object
|
38
|
-
web_element.should_not be_nil
|
39
|
-
web_element.should be_instance_of Fluent::WebElements::TextArea
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should retrieve text from the text area' do
|
43
|
-
watir_browser.should_receive(:textarea).and_return(watir_browser)
|
44
|
-
watir_browser.should_receive(:value).and_return('testing')
|
45
|
-
watir_definition.summary.should == 'testing'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should enter text into a text area' do
|
49
|
-
watir_browser.should_receive(:textarea).and_return(watir_browser)
|
50
|
-
watir_browser.should_receive(:set).with('testing')
|
51
|
-
watir_definition.summary = 'testing'
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
class TextFieldGenerators
|
4
|
-
include Fluent
|
5
|
-
|
6
|
-
text_field :name, id: 'name'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Fluent::Generators do
|
10
|
-
let(:watir_browser) { mock_browser_for_watir }
|
11
|
-
let(:watir_definition) { TextFieldGenerators.new(watir_browser) }
|
12
|
-
|
13
|
-
describe 'text field generators' do
|
14
|
-
context 'when declared on a page definition' do
|
15
|
-
it 'should generate methods for referencing the text field' do
|
16
|
-
watir_definition.should respond_to(:name_object)
|
17
|
-
watir_definition.should respond_to(:name_element)
|
18
|
-
watir_definition.should respond_to(:name_text_field)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should generate methods for interacting with the text field' do
|
22
|
-
watir_definition.should respond_to(:name)
|
23
|
-
watir_definition.should respond_to(:name=)
|
24
|
-
watir_definition.should respond_to(:name_exists?)
|
25
|
-
watir_definition.should respond_to(:name_visible?)
|
26
|
-
watir_definition.should respond_to(:name_enabled?)
|
27
|
-
watir_definition.should respond_to(:name?)
|
28
|
-
watir_definition.should respond_to(:name_?)
|
29
|
-
watir_definition.should respond_to(:name!)
|
30
|
-
watir_definition.should respond_to(:name_text_field?)
|
31
|
-
watir_definition.should respond_to(:name_text_field_?)
|
32
|
-
watir_definition.should respond_to(:name_text_field!)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context 'when used by the watir platform' do
|
37
|
-
it 'should locate the text field' do
|
38
|
-
watir_browser.should_receive(:text_field).and_return(watir_browser)
|
39
|
-
web_element = watir_definition.name_object
|
40
|
-
web_element.should_not be_nil
|
41
|
-
web_element.should be_instance_of Fluent::WebElements::TextField
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should enter text into a text field' do
|
45
|
-
watir_browser.should_receive(:text_field).and_return(watir_browser)
|
46
|
-
watir_browser.should_receive(:set).with('testing')
|
47
|
-
watir_definition.name = 'testing'
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'should retrieve text from the text field' do
|
51
|
-
watir_browser.should_receive(:text_field).and_return(watir_browser)
|
52
|
-
watir_browser.should_receive(:value).and_return('testing')
|
53
|
-
watir_definition.name.should == 'testing'
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should determine if a text field exists' do
|
57
|
-
watir_browser.should_receive(:text_field).exactly(3).times.and_return(watir_browser)
|
58
|
-
watir_browser.should_receive(:exists?).exactly(3).times.and_return(watir_browser)
|
59
|
-
watir_definition.name_text_field_exists?.should be_true
|
60
|
-
watir_definition.name_exists?.should be_true
|
61
|
-
watir_definition.name?.should be_true
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'should determine if a text field is visible' do
|
65
|
-
watir_browser.should_receive(:text_field).exactly(3).times.and_return(watir_browser)
|
66
|
-
watir_browser.should_receive(:present?).exactly(3).times.and_return(watir_browser)
|
67
|
-
watir_definition.name_text_field_visible?.should be_true
|
68
|
-
watir_definition.name_visible?.should be_true
|
69
|
-
watir_definition.name_?.should be_true
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'should determine if a text field is enabled' do
|
73
|
-
watir_browser.should_receive(:text_field).exactly(3).times.and_return(watir_browser)
|
74
|
-
watir_browser.should_receive(:enabled?).exactly(3).times.and_return(watir_browser)
|
75
|
-
watir_definition.name_text_field_enabled?.should be_true
|
76
|
-
watir_definition.name_enabled?.should be_true
|
77
|
-
watir_definition.name!.should be_true
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|