Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Gem Version Build Status

Testdroid API Client for Ruby

Installation

# Gemfile
gem "testdroid-api-client"
> bundle install

Sample client usage - Authenticate

require 'testdroid-api-client'

client = TestdroidAPI::Client.new('admin@localhost', 'admin')

Sample usage - get projects

 @user = client.authorize
 projects = @user.projects.list

Get project by id

project_id = 123
project123 = @user.projects.get(project_id)
#output project name
p "Project name #{project123.name}"

Get project by name

project = @user.projects.list({:filter => "s_name_eq_MyProject"})[0]

Get available frameworks

frameworks = @user.available_frameworks.list

Find specific framework

framework = @user.available_frameworks.list({:filter => "s_osType_eq_ANDROID;s_name_like_%Instrumentation"})[0]

Upload files

file_app = @user.files.upload(File.join(File.dirname(__FILE__), "BitbarSampleApp.apk"))
file_test = @user.files.upload(File.join(File.dirname(__FILE__), "BitbarSampleAppTest.apk"))

Start test run

test_run = @user.runs.create("{\"osType\": \"ANDROID\", \"projectId\": #{project.id}, \"frameworkId\":#{framework_id},
  \"deviceIds\": #{id_list}, \"files\": [{\"id\": #{file_app.id}, \"action\": \"INSTALL\" },
  {\"id\": #{file_test.id}, \"action\": \"RUN_TEST\" }]}")

#See full list of params: https://docs.bitbar.com/testing/api/tests/index.html#details-about-the-configuration-fields

Download all files from test run

test_run.device_sessions.list({:limit => 0}).each { |ds| ds.download_all_files("YOUR_PATH") }

Get all input files

files = @user.files
files.list({:limit => 40,:filter => "s_direction_eq_INPUT"}).each { 
    |f| puts "File id: #{f.id} name: #{f.name}" }

See https://cloud.bitbar.com/cloud/swagger-ui.html for more details about API V2

About

No description, website, or topics provided.

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.