Skip to content

cprinos/robot-remote-server-rb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robot Remote Server for the Robot Framework in Ruby

This is a Ruby gem for the Ruby implementation of RobotRemoteServer that comes with Robot Framework.

This gem is compatible with Robot Framework versions 2.1 and later. For earlier versions, you will need to include the Remote Library explicitly, but it should be compatible in that scenario as well.

Overview

Per its official documentation, “Robot Framework is a generic keyword-driven test automation framework.” Natively, it supports testing libraries in Python and Java. However, Robot Framework also provides a “Remote Library” which allows for two things (again, per the official documentation):

  • It is possible to have test libraries running on different machines than where Robot Framework itself is executed. This allows interesting possibilities for distributed testing.

  • Test libraries can be implemented using any language that supports XML-RPC protocol. Robot Framework currently contains generic remote servers for Python/Jython and Ruby, and the plan is to implement generic servers for other languages like Java and Perl in the future.

Installation

The simplest method of installation is to install the gem directly from Rubygems.org:

gem install robot_remote_server

If you want to hack on the remote server directly and then build your own gem, you can do so with the gem command:

gem build robot_remote_server
gem install robot_remote_server-{version}.gem

Or by installing the echoe gem and using the following rake tasks:

rake build
rake install

Usage

For information on the Remote Library interface in Robot Framework, read the following from the official Robot Framework wiki: code.google.com/p/robotframework/wiki/RemoteLibrary

This gem provides a remote server implemented in Ruby, which allows you to write your own testing library (i.e. your own keywords) using Ruby and Ruby libraries.

In your test library, you need to include the gem:

require 'robot_remote_server'

Then you’ll have the RobotRemoteServer class available to your code. Per the example in Robot Framework itself, you could include that in a file as follows:

if __FILE__ == $0
  require 'rubygems'
  require 'robot_remote_server'
  require 'example_library'
  RobotRemoteServer.new(ExampleLibrary.new,
                          host = 'localhost',
                          port = 8270,
                          yardoc_file = '.yardoc'),
                          yardoc_options = [[:docstring, ''], [:file, 'File'], [:source, 'Source Code']])
end

You’ll notice a few options are available to you:

host

The domain name or address at which the server will serve content. If you’re unsure, use ‘localhost’

port

You can optionally change the port on which the server runs. It default to 8270, as those are the ASCII character codes for R and F (Robot Framework)

yardoc_file

The file-based cache that yardoc generated when you ran it for your testing library. Without this, the remote library cannot access documentation or method signatures from your remote testing library.

yardoc_options

A multi-dimensional array of options, which allow you to tweak which parts of the documentation are printed and in what order. The first element of each child array is a symbol representing a method to which YARD::CodeObject::Base will respond. The second value is an “optional” human-readable label to be printed just before the output of the method. If you don’t want a label, provide an empty string ” as the second value.

About

Ruby gem of Robot Framework remote server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%