rufus 0.8 → 0.8.1
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/.travis.yml +1 -1
- data/README.md +2 -1
- data/lib/rufus/drivers/driver_base.rb +8 -0
- data/rakefile +6 -1
- data/rufus.gemspec +1 -1
- data/spec/rufus_spec.rb +11 -18
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjM1NDY1NDI2OGJiODkwMThiY2E5ZmQ5MTFkZjliMTZmYjQwNzk3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTJjM2ZjMThjNjAxODIyNmU4MDIyNjI3MDI3OGUzMjQ0OGQ5M2M5Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzljZjRjMzE5N2Y3NTI0NDMwMGVhNzU3YjA1Mjc4NjE0NzNiMjkzYzE2MTM2
|
10
|
+
MTBjNDMzM2EzNmE3OTE4OTU1M2IwYjZmMjU2YzI0ZmMxYWQ4ZjBjNGZkZmUx
|
11
|
+
MGFlZWFkOTAxNTVhZjEwOTEyMDcxYWNmNjIzMjBjMjBlNzFmNmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWRlYjExNzgzNGRmOTkwMTQzYjAzM2Y4OGFjZWVkM2JmYWRjMzZkZWU4YTUy
|
14
|
+
N2U1YjI1NmJlNDAyZjdlMGMwMTBlYzk5MjEwODkxMWE4ZjkwZDMxNmRlOTQ5
|
15
|
+
MzM0NDJhNDVmYzFjYTg5ZWY3ZDVjZjQxYTY2YzIwZTEyYjBjYjM=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Last Updated: 10-
|
1
|
+
Last Updated: 12-10-2013
|
2
2
|
|
3
3
|
This project is intended to facilitate automated testing on iOS devices using cucumber, appium and the Page Object pattern.
|
4
4
|
|
@@ -40,6 +40,7 @@ QUICK START GUIDE
|
|
40
40
|
use_physical: true #run on physical device?
|
41
41
|
sim_app_path: $HOME/Library/Developer/Xcode/DerivedData/<UNIQUE>/Build/Products/Debug-iphonesimulator/YourApp.app
|
42
42
|
device: iPhoneSimulator
|
43
|
+
optimized: true #use faster lookup strategy
|
43
44
|
````
|
44
45
|
- Start appium server in new terminal window
|
45
46
|
|
@@ -176,6 +176,14 @@ module Rufus
|
|
176
176
|
selenium.execute_script 'mobile: scrollTo', {'element' => id}
|
177
177
|
end
|
178
178
|
|
179
|
+
def touch_and_hold(element, duration)
|
180
|
+
selenium.execute_script 'mobile: tap', element, duration
|
181
|
+
end
|
182
|
+
|
183
|
+
def tap(x, y)
|
184
|
+
selenium.execute_script 'mobile: tap', :x => x, :y => y
|
185
|
+
end
|
186
|
+
|
179
187
|
def screenshot(name)
|
180
188
|
selenium.save_screenshot name
|
181
189
|
end
|
data/rakefile
CHANGED
@@ -5,11 +5,16 @@ require 'erb'
|
|
5
5
|
require 'childprocess'
|
6
6
|
|
7
7
|
desc "Start appium and run features"
|
8
|
-
task :test => [:build_sim, :install_sim, :appium_sim, :specs, :features, :stop_sim_server]
|
8
|
+
task :test => [:load_rspec, :build_sim, :install_sim, :appium_sim, :specs, :features, :stop_sim_server]
|
9
9
|
|
10
10
|
desc "Running specs appium server"
|
11
11
|
RSpec::Core::RakeTask.new(:specs)
|
12
12
|
|
13
|
+
desc "loads rspec"
|
14
|
+
task :load_rspec do
|
15
|
+
`gem install rspec`
|
16
|
+
end
|
17
|
+
|
13
18
|
desc "build RufusApp for simulator"
|
14
19
|
task :build_sim do
|
15
20
|
Dir.chdir("./RufusApp") do
|
data/rufus.gemspec
CHANGED
data/spec/rufus_spec.rb
CHANGED
@@ -86,37 +86,30 @@ describe Rufus do
|
|
86
86
|
|
87
87
|
context 'elements without accessors' do
|
88
88
|
|
89
|
-
let(:selenium){'mock
|
89
|
+
let(:selenium){'mock driver factory'}
|
90
|
+
let(:raw_selenium){'raw selenium driver'}
|
90
91
|
let(:mock_element){'mock selenium element'}
|
92
|
+
let(:elements){'mock list of elements'}
|
93
|
+
|
94
|
+
before(:each) do
|
95
|
+
selenium.should_receive(:send).with(:driver).and_return(raw_selenium)
|
96
|
+
end
|
91
97
|
|
92
98
|
it 'can find an element by name' do
|
93
|
-
|
99
|
+
raw_selenium.should_receive(:find).with(:name => 'rufusButton').and_return(mock_element)
|
94
100
|
mock_element.should_receive(:click)
|
95
101
|
click(:name => 'rufusButton')
|
96
102
|
end
|
97
|
-
end
|
98
|
-
|
99
|
-
context 'getting the raw page data' do
|
100
|
-
|
101
|
-
let(:selenium){'mock selenium driver'}
|
102
|
-
let(:elements){'mock list of elements'}
|
103
|
-
|
104
103
|
it 'can get the raw page data' do
|
105
|
-
|
104
|
+
raw_selenium.should_receive(:page_source).and_return("source data")
|
106
105
|
page_source.should eq("source data")
|
107
106
|
end
|
108
|
-
|
109
107
|
it 'can get a list of buttons' do
|
110
|
-
|
108
|
+
raw_selenium.should_receive(:elements_by_tag).with('UIAButton')
|
111
109
|
elements_of_type 'UIAButton'
|
112
110
|
end
|
113
|
-
|
114
|
-
end
|
115
|
-
|
116
|
-
context 'scrolling' do
|
117
|
-
let(:selenium){'mock selenium driver'}
|
118
111
|
it 'can swipe to the right' do
|
119
|
-
|
112
|
+
raw_selenium.should_receive(:scroll_to).with(:name => 'elementName')
|
120
113
|
scroll_to(:name => 'elementName')
|
121
114
|
end
|
122
115
|
end
|