Skip to content

Commit 7b698ca

Browse files
authored
update readme (#7)
1 parent feb7f00 commit 7b698ca

File tree

1 file changed

+46
-22
lines changed

1 file changed

+46
-22
lines changed

README.md

+46-22
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,93 @@
22

33
[![Gem Version](https://badge.fury.io/rb/appium_lib_core.svg)](https://badge.fury.io/rb/appium_lib_core)
44

5+
6+
[![Build Status](https://travis-ci.org/appium/ruby_lib_core.svg?branch=master)](https://travis-ci.org/appium/ruby_lib_core)
7+
58
# Documentation
69

710
- http://www.rubydoc.info/github/appium/ruby_lib_core
811

9-
# Used main library
12+
# Related library
1013
- https://github.com/appium/ruby_lib
1114

1215
# How to start
13-
## Start Appium server
14-
15-
```bash
16-
$ npm install -g appium
17-
$ appium
18-
```
19-
2016
## Run tests
2117
### Unit Tests
18+
Run unit tests which check each method and commands, URL, using the webmock.
2219

2320
```bash
2421
$ bundle install
2522
$ rake test:unit
2623
```
2724

2825
### Functional Tests
26+
Run functional tests which require the Appium server and real device, Simulator/Emulator.
2927

30-
```bash
28+
- Start Appium server
29+
```bash
30+
$ npm install -g appium
31+
$ appium
32+
```
33+
34+
- Conduct tests
35+
```bash
3136
$ bundle install
3237
$ rake test:func:android # Andorid
3338
$ rake test:func:ios # iOS
3439
```
3540

36-
# How to use this core library
37-
1. Launch the appium server locally.
41+
## Run a test case
42+
1. Launch the Appium server locally.
3843
2. Run the following script.
3944

40-
```ruby
45+
- `test.rb`
46+
```ruby
4147
require 'rubygems'
4248
require 'appium_lib_core'
4349

4450
opts = {
45-
caps: {
46-
platformName: :ios,
47-
platformVersion: '11.0',
48-
deviceName: 'iPhone Simulator',
49-
automationName: 'XCUITest',
50-
app: '/path/to/MyiOS.app'
51-
},
52-
appium_lib: {
53-
}
54-
}
51+
caps: {
52+
platformName: :ios,
53+
platformVersion: '11.0',
54+
deviceName: 'iPhone Simulator',
55+
automationName: 'XCUITest',
56+
app: '/path/to/MyiOS.app'
57+
},
58+
appium_lib: {
59+
wait: 30
60+
}
61+
}
5562
@core = Appium::Core.for(self, opts) # create a core driver with `opts` and extend methods into `self`
5663
@driver = @core.start_driver
5764

5865
# Launch iPhone Simulator and `MyiOS.app`
5966
@driver.find_element(:accessibility_id, 'some accessibility') # find an element
6067
```
6168

69+
- Run the script
70+
```bash
71+
# shell 1
72+
$ appium
73+
74+
# shell 2
75+
$ ruby test.rb
76+
```
77+
6278
# Release
79+
Use [appium_thor](https://github.com/appium/appium_thor) to release this gem.
6380

6481
```bash
6582
$ bundle exec thor bump # bumpy, bumpz
6683
$ bundle exec thor release
6784
```
6885

86+
# Contribution
87+
1. Fork it ( https://github.com/appium/ruby_lib_core/fork )
88+
2. Create your feature branch (git checkout -b my-new-feature)
89+
3. Commit your changes (git commit -am 'Add some feature')
90+
4. Push to the branch (git push origin my-new-feature)
91+
5. Create new Pull Request
92+
6993
# License
7094
Apache License v2

0 commit comments

Comments
 (0)