Skip to main content

Robot Framework Libdoc Extension that generates imbus TestBench Library import formats.

Project description

Libdoc2TestBench

Robot Framework Libdoc Extension that generates imbus TestBench Enterprise Library import formats. It can be used to generate Testbench interactions from Robotframework keywords.


Installation:

To install this package you can use pip:

pip install robotframework-libdoc2testbench

Notice: This extension requires Robot Framework 4.0.0 or later and does not work with earlier versions.


Usage:

There are four main use cases:

  • Importing official robotframework librarys
  • Importing custom robotframework librarys
  • Importing resource files
  • Importing multiple librarys and resource files at once

Importing official robotframework librarys

LibDoc2TestBench command demo

The basic usage just needs the Libdoc2TestBench command and a Robot Framework Library as input and saves a zip-file named project-dump.zip in the current working directory containing the needed information for the import.

Libdoc2TestBench <LIBRARY>

<LIBRARY> corresponds to the name that you would use to import the library into a robot framework file. Browser is an example for <LIBRARY>. By using a second positional argument you can additionally specify the output filename:

Libdoc2TestBench <LIBRARY> <output.zip>

Afterwards the generated zip-file can be imported via the Import Project... command in the Project Management view of the imbus TestBench:

Import Project Demo

In the Test Elements view you can now see your imported RF library as different interactions and datatypes:

Test Element View

The imported Testelements can be copied into another testbench project. When copying, it is important that the test elements remain in the same subdivisions. The name of the root subdivision can be renamed with the --libraryroot option.

Importing custom robotframework librarys

Libdoc2Testbench can be used to import your own robotframework librarys.

Example for a custom library:

class mycustomlibrary(object):
    def print_hello_world(self):
        print("Hello World")

Example Libdoc2Testbench usage:

Libdoc2TestBench mycustomlibrary.py

Importing resource files

Libdoc2Testbench can be used to import resource files.

Example for a resource file:

*** Keywords ***
print hello world
  log Hello World

Example Libdoc2Testbench usage:

Libdoc2TestBench -a myresource.resource

Importing multiple librarys and resource files at once

Libdoc2Testbench can be used to import multiple librarys and resource files at once. A special robot framework section is used for this use case.

Example for a import List:

*** Import List ***
BrowserLibrary
BuiltIn
mycustomlibrary.py
myresource.resource

Example Libdoc2Testbench usage:

Libdoc2TestBench -a importlist.robot

Command line arguments

There are several optional arguments, that follow the structure of the robot.libdoc module. When generating imports from a RF library, these values should already be set up correctly. You may overwrite the docformat and other meta data by setting the associated arguments written below.

Arguments Description Allowed Values
-h, --help show the help message and exit
-a, --attachment Defines if a resource file will be attached to all interactions.
-F FORMAT, --docformat FORMAT Specifies the source documentation format. Possible values are Robot Framework's documentation format, HTML, plain text, and reStructuredText. The default value can be specified in library source code and the initial default value is ROBOT. ROBOT HTML TEXT REST
--libraryroot LIBRARYROOT Defines which subdivision name contains libraries.
--libversion LIBVERSION Sets the version of the documented library or resource written in the description.
-n NAME, --name NAME Sets the name of the documented library or resource.
-r REPOSITORY, --repository REPOSITORY Sets the repository id of the TestBench import. The default is itba.
--resourceroot RESOURCEROOT Defines which subdivision name contains resources.
-s SPECFORMAT, --specdocformat SPECFORMAT Specifies the documentation format used with XML and JSON spec files. RAW means preserving the original documentation format and HTML means converting documentation to HTML. The default is HTML. HTML RAW
-t TEMP, --temp TEMP Path to write temporary files to.
-x, --xml Writes a single xml-file instead of the zipfile.
--version, --info Writes the Libdoc2TestBench, Robot Framework and Python version to console.

Change log

  • 1.0rc2
    • ADDED optional arguments for:
      • xml-file output (instead of zip-file)
      • custom temporary directory
      • changing the repository id in the xml-header
      • custom primary key enumeration start
      • info command for printing Libdoc2TestBench/Robot Framework/Python version to console
      • support for resource-files (attachment support coming soon)
    • FIX:
      • only create _Datatype subdivison in libraries when data types are present
      • Resource subdivison is now in the correct parent subdivision
      • Updated README.md / package help-messages to reflect changes
  • 1.0rc1
    • first release candidate

License

Distributed under the Apache-2.0 license. See LICENSE for more information.


Dependencies


Contributing

Code style: black For consistent code formatting, please use Black - The Uncompromising Code Formatter with the following arguments in the root directory:

black -l 100 -S .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-libdoc2testbench-1.2b4.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file robotframework-libdoc2testbench-1.2b4.tar.gz.

File metadata

File hashes

Hashes for robotframework-libdoc2testbench-1.2b4.tar.gz
Algorithm Hash digest
SHA256 425f25385bde649485a13362b1fbfca9499dddc0923982d79812c314665282ca
MD5 bc23fc10f206973a92086ad1141a0ecc
BLAKE2b-256 cad4c9b2f185ec81ec921472ca3003f37797a8cf6d109c8f1fe5bd3fc21b28ae

See more details on using hashes here.

File details

Details for the file robotframework_libdoc2testbench-1.2b4-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_libdoc2testbench-1.2b4-py3-none-any.whl
Algorithm Hash digest
SHA256 f8b8563a24e81ca1740ea150203e04dac9dc2980c39b19c320b8de1c293cc97e
MD5 b19274c0c7d2be90af770b06a89b4e75
BLAKE2b-256 2523aa6ed86a8a237ceb977a36237782e1fb27d02607774756f369e8a000d93e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page