{"id":28564010,"url":"https://github.com/appium/ruby_lib_core","last_synced_at":"2025-06-10T13:09:21.693Z","repository":{"id":26454450,"uuid":"108925136","full_name":"appium/ruby_lib_core","owner":"appium","description":"Core library for the Ruby client","archived":false,"fork":false,"pushed_at":"2025-06-05T05:47:57.000Z","size":80542,"stargazers_count":37,"open_issues_count":9,"forks_count":23,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-06-05T07:43:23.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"appium"}},"created_at":"2017-10-31T00:45:36.000Z","updated_at":"2025-06-05T05:47:59.000Z","dependencies_parsed_at":"2023-10-01T07:21:58.222Z","dependency_job_id":"1ad7df5c-45c4-4385-b2e4-0e76788206d4","html_url":"https://github.com/appium/ruby_lib_core","commit_stats":{"total_commits":896,"total_committers":8,"mean_commits":112.0,"dds":0.1104910714285714,"last_synced_commit":"a3db411aba0626418f37c6c2b75c6ede0bd646c8"},"previous_names":[],"tags_count":150,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fruby_lib_core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fruby_lib_core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fruby_lib_core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fruby_lib_core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appium","download_url":"https://codeload.github.com/appium/ruby_lib_core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appium%2Fruby_lib_core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259080990,"owners_count":22802404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T13:09:17.711Z","updated_at":"2025-06-10T13:09:21.684Z","avatar_url":"https://github.com/appium.png","language":"Ruby","funding_links":["https://opencollective.com/appium"],"categories":[],"sub_categories":[],"readme":"# AppiumLibCore\n\n[![Gem Version](https://badge.fury.io/rb/appium_lib_core.svg)](https://badge.fury.io/rb/appium_lib_core)\n\n[![Runs lint and unit tests](https://github.com/appium/ruby_lib_core/actions/workflows/unittest.yml/badge.svg)](https://github.com/appium/ruby_lib_core/actions/workflows/unittest.yml)\n[![Functional Tests](https://github.com/appium/ruby_lib_core/actions/workflows/functional-test.yml/badge.svg)](https://github.com/appium/ruby_lib_core/actions/workflows/functional-test.yml)\n\n\nThis library is a Ruby client for Appium.  The gem is available via [appium_lib_core](https://rubygems.org/gems/appium_lib_core).\n\nThis library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings) and adapts WebDriver APIs for Appium. [ruby_lib](https://github.com/appium/ruby_lib) calls all of Appium/Selenium related APIs via this core library. It works instance based driver.\n\n# Documentation\n\n- https://www.rubydoc.info/gems/appium_lib_core\n    - You can find working API examples in test code, [test/functional](test/functional)\n- Appium 2.0\n    - https://appium.github.io/appium/docs/en/2.0/ (Not completed yet)\n\n# Migration from v4 to v5\n\nPlease read [`[5.0.0]`](CHANGELOG.md#500---2021-11-05) section in [CHANGELOG](CHANGELOG.md)\n\n# Related library\n- https://github.com/appium/ruby_lib\n\n# How to start\n## Run tests\n### Unit Tests\nRun unit tests which check each method and command, URL, using the webmock.\n\n```bash\n$ bundle install\n$ bundle exec parallel_test test/unit/\n```\n\nor\n\n```bash\n$ bundle install\n$ bundle exec rake test:unit\n```\n\n### Functional Tests\nRun functional tests which require the Appium server and real device, Simulator/Emulator.\n\n- Start Appium server (Appium 2.0 base)\n```bash\n$ npm install --location=global appium\n$ appium driver install xcuitest\n$ appium driver install uiautomator2 # etc\n$ appium --relaxed-security # To run all tests in local\n```\n\n- Conduct tests\n```bash\n$ bundle install\n$ rake test:func:android # Andorid, uiautomator2\n$ APPIUM_DRIVER=espresso rake test:func:android # Andorid, uiautomator2\n$ rake test:func:ios     # iOS\n```\n\n#### Real device for iOS\n\n- You should pre-install [UICatalog](https://github.com/appium/ios-uicatalog) in iOS with a particular `bundleId`\n    - Set the `bundleId` instead of `app` in `test/test_helper#ios`\n\n```bash\n# Create derivedDataPath in \"/tmp/#{org_id}\" and reuse xctestrun in the directory\n$ REAL=true BUNDLE_ID='target-bundleid' WDA_BUNDLEID=\"ios.appium.WebDriverAgentRunner\" ORG_ID=XXXXXXX rake test:func:ios\n\n# Run with xcconfig file. The template is in 'test/functional/ios/temp.xcconfig'\n# The PROVISIONING_PROFILE is in '~/Library/MobileDevice/Provisioning\\ Profiles/'\n$ REAL=true XCODE_CONFIG_FILE='/path/to/xcconfig' ORG_ID=XXXXXXX rake test:func:ios\n```\n\n#### Run parallel tests with parallel_tests gem\n#### Android\n\n```\n# Generate 3 emulators. Running 3 emulators require much machine power.\n# It requires an image which is for Google Play and x86 CPU architecture's image.\n$ bundle exec rake android:gen_device\n$ PARALLEL=1 bundle exec parallel_test test/functional/android -n 3\n```\n\n##### iOS\n- Create iPhone simulators named `iPhone Xs Max- 8100` and `iPhone Xs Max - 8101`\n- Run iOS functional tests with below command\n\n```\n$ PARALLEL=1 bundle exec parallel_test test/functional/ios -n 2\n```\n\n## CI\n\n- Runs on CI environment (on Azure)\n    - Non `IGNORE_VERSION_SKIP` or `IGNORE_VERSION_SKIP=true` runs all tests ignoring `skip` them by Appium versions\n    - `IGNORE_VERSION_SKIP=false` skips the following tests if the Appium version is lower than the requirement\n\n```\n$ IGNORE_VERSION_SKIP=true CI=true bundle exec rake test:func:android\n```\n\n## Run a test case\n1. Launch the Appium server locally.\n2. Run the following script.\n\n- `test.rb`\n    ```ruby\n    require 'rubygems'\n    require 'appium_lib_core'\n\n    opts = {\n      capabilities: { # Append capabilities\n        platformName: 'ios',\n        platformVersion: '18.4',\n        deviceName: 'iPhone 16 Plus',\n        # app: '/path/to/MyiOS.app',  # Without 'app' capability, an appium session starts with the home screen\n        automationName: 'XCUITest'\n      },\n      appium_lib: {\n        wait: 30\n      }\n    }\n    @core = Appium::Core.for(opts) # create a core driver with `opts`\n    @driver = @core.start_driver\n\n    # Launch iPhone Simulator and `MyiOS.app`\n    @driver.find_element(:accessibility_id, 'some accessibility') # find an element\n    ```\n- Run the script\n    ```bash\n    # shell 1\n    $ appium --log-level warn:error # show only warning and error logs\n\n    # shell 2\n    $ ruby test.rb\n    ```\n\n[Appium::Core.for](https://rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Driver#for-class_method) documentation has more example to build a new driver instance.\n\nMore examples are in [test/functional](test/functional)\n\nAs of version 5.8.0, the client can attach to an existing session. The main purpose is for debugging.\n\n```ruby\n# @driver is the driver instance of an existing session\nattached_driver = ::Appium::Core::Driver.attach_to @driver.session_id, url: 'http://127.0.0.1:4723', automation_name: 'XCUITest', platform_name: 'ios'\nassert attached_driver.session_id == @driver.session_id\nattached_driver.page_source\n```\n\n### Capabilities\n\nRead [Appium/Core/Driver](https://rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Driver) to catch up with available capabilities.\nCapabilities affect only ruby_lib is [Appium/Core/Options](https://rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Options).\n\n\n### Gives custom listener\n\nAn example to define a customer listener with [Selenium::WebDriver::Support::AbstractEventListener](https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/Support/AbstractEventListener.html)\n\n```ruby\nclass CustomListener \u003c ::Selenium::WebDriver::Support::AbstractEventListener\n  // something\nend\ncapabilities: {\n  platformName: :ios,\n  platformVersion: '11.0',\n  deviceName: 'iPhone Simulator',\n  automationName: 'XCUITest',\n  app: '/path/to/MyiOS.app'\n},\nappium_lib: {\n  listener: CustomListener.new\n}\n@core = Appium::Core.for capabilities: capabilities, appium_lib: appium_lib\n@core.start_driver\n```\n\n# Development\n- Demo app\n    - https://android.googlesource.com/platform/development/+/master/samples/ApiDemos\n\n# Release\nUse [appium_thor](https://github.com/appium/appium_thor) to release this gem.\n\n```bash\n$ thor bump # bumpy,\n$ thor release\n```\n\n# Contribution\n1. Fork it ( https://github.com/appium/ruby_lib_core/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n# License\nApache License v2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fruby_lib_core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappium%2Fruby_lib_core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappium%2Fruby_lib_core/lists"}