|
2 | 2 |
|
3 | 3 | [](https://badge.fury.io/rb/appium_lib_core)
|
4 | 4 |
|
| 5 | + |
| 6 | +[](https://travis-ci.org/appium/ruby_lib_core) |
| 7 | + |
5 | 8 | # Documentation
|
6 | 9 |
|
7 | 10 | - http://www.rubydoc.info/github/appium/ruby_lib_core
|
8 | 11 |
|
9 |
| -# Used main library |
| 12 | +# Related library |
10 | 13 | - https://github.com/appium/ruby_lib
|
11 | 14 |
|
12 | 15 | # How to start
|
13 |
| -## Start Appium server |
14 |
| - |
15 |
| -```bash |
16 |
| -$ npm install -g appium |
17 |
| -$ appium |
18 |
| -``` |
19 |
| - |
20 | 16 | ## Run tests
|
21 | 17 | ### Unit Tests
|
| 18 | +Run unit tests which check each method and commands, URL, using the webmock. |
22 | 19 |
|
23 | 20 | ```bash
|
24 | 21 | $ bundle install
|
25 | 22 | $ rake test:unit
|
26 | 23 | ```
|
27 | 24 |
|
28 | 25 | ### Functional Tests
|
| 26 | +Run functional tests which require the Appium server and real device, Simulator/Emulator. |
29 | 27 |
|
30 |
| -```bash |
| 28 | +- Start Appium server |
| 29 | + ```bash |
| 30 | +$ npm install -g appium |
| 31 | +$ appium |
| 32 | +``` |
| 33 | + |
| 34 | +- Conduct tests |
| 35 | + ```bash |
31 | 36 | $ bundle install
|
32 | 37 | $ rake test:func:android # Andorid
|
33 | 38 | $ rake test:func:ios # iOS
|
34 | 39 | ```
|
35 | 40 |
|
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. |
38 | 43 | 2. Run the following script.
|
39 | 44 |
|
40 |
| -```ruby |
| 45 | +- `test.rb` |
| 46 | + ```ruby |
41 | 47 | require 'rubygems'
|
42 | 48 | require 'appium_lib_core'
|
43 | 49 |
|
44 | 50 | 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 | +} |
55 | 62 | @core = Appium::Core.for(self, opts) # create a core driver with `opts` and extend methods into `self`
|
56 | 63 | @driver = @core.start_driver
|
57 | 64 |
|
58 | 65 | # Launch iPhone Simulator and `MyiOS.app`
|
59 | 66 | @driver.find_element(:accessibility_id, 'some accessibility') # find an element
|
60 | 67 | ```
|
61 | 68 |
|
| 69 | +- Run the script |
| 70 | +```bash |
| 71 | +# shell 1 |
| 72 | +$ appium |
| 73 | + |
| 74 | +# shell 2 |
| 75 | +$ ruby test.rb |
| 76 | +``` |
| 77 | + |
62 | 78 | # Release
|
| 79 | +Use [appium_thor](https://github.com/appium/appium_thor) to release this gem. |
63 | 80 |
|
64 | 81 | ```bash
|
65 | 82 | $ bundle exec thor bump # bumpy, bumpz
|
66 | 83 | $ bundle exec thor release
|
67 | 84 | ```
|
68 | 85 |
|
| 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 | + |
69 | 93 | # License
|
70 | 94 | Apache License v2
|
0 commit comments