mirror of
https://github.com/appium/appium.git
synced 2026-05-07 11:30:21 -05:00
Added additional details to the simple test.
Added a Readme.
This commit is contained in:
@@ -2,3 +2,5 @@ source "http://www.rubygems.org"
|
||||
|
||||
gem "rspec"
|
||||
gem "selenium-webdriver"
|
||||
gem "cucumber"
|
||||
gem "rspec-expectations"
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
GEM
|
||||
remote: http://www.rubygems.org/
|
||||
specs:
|
||||
builder (3.1.4)
|
||||
childprocess (0.3.7)
|
||||
ffi (~> 1.0, >= 1.0.6)
|
||||
cucumber (1.2.1)
|
||||
builder (>= 2.1.2)
|
||||
diff-lcs (>= 1.1.3)
|
||||
gherkin (~> 2.11.0)
|
||||
json (>= 1.4.6)
|
||||
diff-lcs (1.1.3)
|
||||
ffi (1.3.1)
|
||||
gherkin (2.11.5)
|
||||
json (>= 1.4.6)
|
||||
json (1.7.6)
|
||||
multi_json (1.5.0)
|
||||
rspec (2.12.0)
|
||||
rspec-core (~> 2.12.0)
|
||||
@@ -26,5 +35,7 @@ PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cucumber
|
||||
rspec
|
||||
rspec-expectations
|
||||
selenium-webdriver
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
Ruby Examples
|
||||
=============
|
||||
|
||||
Before you test
|
||||
---------------
|
||||
All these commands are done from a terminal window. If you've already done a step, you can safely ignore that command.
|
||||
|
||||
Open this directory: cd APPIUM-LOCATION/sample-code/examples/ruby
|
||||
|
||||
Install Ruby: "\curl -L https://get.rvm.io | bash -s stable --ruby"
|
||||
|
||||
Install Bundler: gem install bundle
|
||||
|
||||
Install Gems: bundle install
|
||||
|
||||
You're ready to go!
|
||||
|
||||
simple\_test.rb
|
||||
--------------
|
||||
A sanity check and simple example of driving a calculator app. Run this to see
|
||||
the bare minimum you need to get a test running for Appium.
|
||||
|
||||
Run the test by making sure Appium is running in another terminal, then from
|
||||
the terminal you opened above, running 'rspec simple\_test.rb'
|
||||
|
||||
For more information, check out the comments at the top of simple\_test.rb
|
||||
|
||||
u\_i\_catalog.rb
|
||||
--------------
|
||||
A demonstration of various things you can do with Appium. Check this if you
|
||||
need a recipe for a specific task, or just to see how simple and powerful iOS
|
||||
testing can be.
|
||||
|
||||
Run the test by making sure Appium is running in another terminal, then from the terminal you opened above, running 'rspec u\_i\_catalog.rb'
|
||||
|
||||
For more information, check out the comments at the top of u\_i\_catalog.rb
|
||||
|
||||
Cucumber
|
||||
--------
|
||||
Cucumber is a Behaviour Driven Design framework that lots of people are keen
|
||||
on.
|
||||
|
||||
To run the Cucumber examples, you'll need to change directory to the cucumber
|
||||
directory (cd APPIUM-LOCATION/sample-code/examples/ruby/cucumber) and then,
|
||||
from the commandline, run 'cucumber'.
|
||||
|
||||
For more information, check out the comments at the top of the files in the
|
||||
cucumber directory.
|
||||
@@ -37,3 +37,7 @@ end
|
||||
def selenium
|
||||
@driver ||= Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => server_url)
|
||||
end
|
||||
|
||||
at_exit do
|
||||
@driver.quit
|
||||
end
|
||||
|
||||
@@ -51,10 +51,14 @@ def server_url
|
||||
end
|
||||
|
||||
describe "Computation" do
|
||||
before(:each) do
|
||||
before :all do
|
||||
@driver = Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => server_url)
|
||||
end
|
||||
|
||||
after :all do
|
||||
@driver.quit
|
||||
end
|
||||
|
||||
it "should add two numbers" do
|
||||
values = [rand(10), rand(10)]
|
||||
expected_sum = values.reduce(&:+)
|
||||
|
||||
Reference in New Issue
Block a user