rufus 0.7 → 0.8
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.
- checksums.yaml +8 -8
- data/RufusApp/RufusApp/en.lproj/RUViewController.xib +11 -19
- data/config.yml +4 -3
- data/features/step_definitions/driver_steps.rb +1 -1
- data/features/step_definitions/view_steps.rb +6 -0
- data/features/support/screens/home_page.rb +1 -0
- data/features/view.feature +8 -0
- data/lib/rufus.rb +5 -5
- data/lib/rufus/accessors/view.rb +7 -8
- data/lib/rufus/driver.rb +41 -118
- data/lib/rufus/drivers/driver_base.rb +212 -0
- data/lib/rufus/drivers/driver_factory.rb +41 -0
- data/lib/rufus/drivers/iOS_device.rb +4 -4
- data/lib/rufus/drivers/iOS_faster_device.rb +37 -0
- data/lib/rufus/drivers/iOS_faster_simulator.rb +37 -0
- data/lib/rufus/drivers/iOS_simulator.rb +4 -6
- data/lib/rufus/parser.rb +81 -0
- data/rufus.gemspec +1 -1
- data/spec/drivers_specs/driver_factory_spec.rb +38 -0
- data/spec/drivers_specs/driver_spec.rb +3 -372
- data/spec/drivers_specs/iOS_device_spec.rb +70 -12
- data/spec/drivers_specs/iOS_faster_device_spec.rb +105 -0
- data/spec/drivers_specs/iOS_faster_simulator_spec.rb +113 -0
- data/spec/drivers_specs/iOS_simulator_spec.rb +69 -13
- data/spec/parser_spec.rb +116 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/view_spec.rb +14 -22
- metadata +11 -2
data/spec/view_spec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'spec_helper'
|
|
5
5
|
describe Rufus::Accessors::View do
|
6
6
|
|
7
7
|
context 'checking for existence' do
|
8
|
-
let(:view){Rufus::Accessors::View.new(:
|
8
|
+
let(:view){Rufus::Accessors::View.new(:name => 'testView')}
|
9
9
|
let(:view_by_text){Rufus::Accessors::View.new(:text => "textViewText")}
|
10
10
|
let(:selenium){double('Selenium::WebDriver')}
|
11
11
|
let(:element){double('Selenium element')}
|
@@ -16,73 +16,65 @@ describe Rufus::Accessors::View do
|
|
16
16
|
|
17
17
|
context 'element exists' do
|
18
18
|
it 'reports that element exists' do
|
19
|
-
selenium.should_receive(:
|
19
|
+
selenium.should_receive(:exists?).with(:name => 'testView').and_return(true)
|
20
20
|
view.exists?.should be_true
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
context 'element does not exist' do
|
25
25
|
it 'reports that the element does not exist' do
|
26
|
-
selenium.should_receive(:
|
26
|
+
selenium.should_receive(:exists?).with(:name => 'testView').and_return(false)
|
27
27
|
view.exists?.should be_false
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
context 'clicking an element' do
|
32
32
|
it 'can click an element' do
|
33
|
-
selenium.should_receive(:
|
34
|
-
element.should_receive(:click)
|
33
|
+
selenium.should_receive(:click).with({:name =>'testView'})
|
35
34
|
view.click
|
36
35
|
end
|
37
36
|
end
|
38
37
|
|
39
38
|
context 'telling if a view is displayed' do
|
40
39
|
it 'can tell if a view is displayed' do
|
41
|
-
selenium.should_receive(:
|
42
|
-
element.should_receive(:displayed?).and_return(true)
|
40
|
+
selenium.should_receive(:displayed?).with({:name =>'testView'}).and_return(true)
|
43
41
|
view.displayed?.should be_true
|
44
42
|
end
|
45
43
|
it 'can tell if a view is not displayed' do
|
46
|
-
selenium.should_receive(:
|
47
|
-
element.should_receive(:displayed?).and_return(false)
|
44
|
+
selenium.should_receive(:displayed?).with({:name =>'testView'}).and_return(false)
|
48
45
|
view.displayed?.should be_false
|
49
46
|
end
|
50
47
|
end
|
51
48
|
|
52
49
|
context 'telling if a view is enabled' do
|
53
50
|
it 'can tell if a view is enabled' do
|
54
|
-
selenium.should_receive(:
|
55
|
-
element.should_receive(:enabled?).and_return(true)
|
51
|
+
selenium.should_receive(:enabled?).with({:name =>'testView'}).and_return(true)
|
56
52
|
view.enabled?.should be_true
|
57
53
|
end
|
58
54
|
it 'can tell if a view is not enabled' do
|
59
|
-
selenium.should_receive(:
|
60
|
-
element.should_receive(:enabled?).and_return(false)
|
55
|
+
selenium.should_receive(:enabled?).with({:name =>'testView'}).and_return(false)
|
61
56
|
view.enabled?.should be_false
|
62
57
|
end
|
63
58
|
end
|
64
59
|
|
65
60
|
context 'getting text from a view' do
|
66
61
|
it 'can get the text of a view' do
|
67
|
-
selenium.should_receive(:
|
68
|
-
element.should_receive(:text).and_return("some text")
|
62
|
+
selenium.should_receive(:text).with({:name =>'testView'}).and_return('some text')
|
69
63
|
view.text.should eq("some text")
|
70
64
|
end
|
71
65
|
end
|
72
66
|
|
73
67
|
context 'sending text input to a view' do
|
74
68
|
it 'can send text input to a view' do
|
75
|
-
selenium.should_receive(:
|
76
|
-
element.should_receive(:send_keys).with("keyboard entries")
|
69
|
+
selenium.should_receive(:type).with('keyboard entries', 'testView').and_return(element)
|
77
70
|
view.send_keys("keyboard entries")
|
78
71
|
end
|
79
72
|
end
|
80
73
|
|
81
74
|
context 'getting the class of a view' do
|
82
|
-
it 'can get the UIAutomation class
|
83
|
-
|
84
|
-
|
85
|
-
view.class.should eql('UIStaticText')
|
75
|
+
it 'can get the UIAutomation class representation of view' do
|
76
|
+
selenium.should_receive(:class).with({:name =>'testView'}).and_return('UIAStaticText')
|
77
|
+
view.class.should eql('UIAStaticText')
|
86
78
|
end
|
87
79
|
end
|
88
80
|
|
@@ -96,7 +88,7 @@ describe Rufus::Accessors::View do
|
|
96
88
|
|
97
89
|
it 'tells selenium to search by text' do
|
98
90
|
view_by_text.should_receive(:selenium).and_return(selenium)
|
99
|
-
selenium.should_receive(:
|
91
|
+
selenium.should_receive(:exists?).with({:text=>'textViewText'}).and_return(element)
|
100
92
|
view_by_text.exists?
|
101
93
|
end
|
102
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rufus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: page_navigation
|
@@ -353,16 +353,25 @@ files:
|
|
353
353
|
- lib/rufus/accessors/table.rb
|
354
354
|
- lib/rufus/accessors/view.rb
|
355
355
|
- lib/rufus/driver.rb
|
356
|
+
- lib/rufus/drivers/driver_base.rb
|
357
|
+
- lib/rufus/drivers/driver_factory.rb
|
356
358
|
- lib/rufus/drivers/iOS_device.rb
|
359
|
+
- lib/rufus/drivers/iOS_faster_device.rb
|
360
|
+
- lib/rufus/drivers/iOS_faster_simulator.rb
|
357
361
|
- lib/rufus/drivers/iOS_simulator.rb
|
358
362
|
- lib/rufus/navigation.rb
|
363
|
+
- lib/rufus/parser.rb
|
359
364
|
- rakefile
|
360
365
|
- rufus.gemspec
|
361
366
|
- spec/accessors_spec.rb
|
367
|
+
- spec/drivers_specs/driver_factory_spec.rb
|
362
368
|
- spec/drivers_specs/driver_spec.rb
|
363
369
|
- spec/drivers_specs/iOS_device_spec.rb
|
370
|
+
- spec/drivers_specs/iOS_faster_device_spec.rb
|
371
|
+
- spec/drivers_specs/iOS_faster_simulator_spec.rb
|
364
372
|
- spec/drivers_specs/iOS_simulator_spec.rb
|
365
373
|
- spec/navigation_spec.rb
|
374
|
+
- spec/parser_spec.rb
|
366
375
|
- spec/rufus_spec.rb
|
367
376
|
- spec/spec_helper.rb
|
368
377
|
- spec/table_spec.rb
|