All Projects → robotframework → PythonLibCore

robotframework / PythonLibCore

Licence: Apache-2.0 license
Tools to ease creating larger test libraries for Robot Framework using Python

Programming Languages

python
139335 projects - #7 most used programming language
RobotFramework
109 projects

Projects that are alternatives of or similar to PythonLibCore

page-modeller
⚙️ Browser DevTools extension for modelling web pages for automation.
Stars: ✭ 66 (+43.48%)
Mutual labels:  test-automation, robotframework
robot-framework-docker
Docker image to run robot framework acceptance testing in a docker container
Stars: ✭ 24 (-47.83%)
Mutual labels:  test-automation, robotframework
robotframework-excel
Robot-framework auto-test excel
Stars: ✭ 15 (-67.39%)
Mutual labels:  test-automation, robotframework
Robotframework Appiumlibrary
AppiumLibrary is an appium testing library for RobotFramework
Stars: ✭ 259 (+463.04%)
Mutual labels:  test-automation, robotframework
Mockito Scala
Mockito for Scala language
Stars: ✭ 231 (+402.17%)
Mutual labels:  test-automation
Qt4i
QTA driver for iOS app
Stars: ✭ 191 (+315.22%)
Mutual labels:  test-automation
Tork
💞 Tests your Ruby code, in parallel, as you change it
Stars: ✭ 185 (+302.17%)
Mutual labels:  test-automation
Nosmoke
A cross platform UI crawler which scans view trees then generate and execute UI test cases.
Stars: ✭ 178 (+286.96%)
Mutual labels:  test-automation
kentan
A modular test data generator for TypeScript
Stars: ✭ 38 (-17.39%)
Mutual labels:  test-automation
Doraemon
Doraemon-接口自动化测试工具
Stars: ✭ 237 (+415.22%)
Mutual labels:  test-automation
Gauge
Light weight cross-platform test automation
Stars: ✭ 2,622 (+5600%)
Mutual labels:  test-automation
Winappdriver
Windows Application Driver
Stars: ✭ 2,577 (+5502.17%)
Mutual labels:  test-automation
Cdp4j
cdp4j - Chrome DevTools Protocol for Java
Stars: ✭ 232 (+404.35%)
Mutual labels:  test-automation
Hitchhiker
a Restful Api test tool
Stars: ✭ 2,175 (+4628.26%)
Mutual labels:  test-automation
robotkernel
Robot Framework IPython kernel for Jupyter Notebook and JupyterLab
Stars: ✭ 69 (+50%)
Mutual labels:  robotframework
Botium Core
The Selenium for Chatbots - Bots Testing Bots
Stars: ✭ 181 (+293.48%)
Mutual labels:  test-automation
Werdlists
⌨️ Wordlists, Dictionaries and Other Data Sets for Writing Software Security Test Cases
Stars: ✭ 216 (+369.57%)
Mutual labels:  test-automation
Skrape.it
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
Stars: ✭ 231 (+402.17%)
Mutual labels:  test-automation
Element
💦Load test your app using real web browsers
Stars: ✭ 204 (+343.48%)
Mutual labels:  test-automation
Regressor
Generate specs for your rails application the easy way. Regressor generates model and controller specs based on validations, associations, enums, database, routes, callbacks. Use regressor to capture your rails application behaviour.
Stars: ✭ 204 (+343.48%)
Mutual labels:  test-automation

Python Library Core

Tools to ease creating larger test libraries for Robot Framework using Python. The Robot Framework hybrid and dynamic library API gives more flexibility for library than the static library API, but they also sets requirements for libraries which needs to be implemented in the library side. PythonLibCore eases the problem by providing simpler interface and handling all the requirements towards the Robot Framework library APIs.

Code is stable and version 1.0 is already used by SeleniumLibrary and WhiteLibrary. The version 2.0 support changes in the Robot Framework 3.2.

https://github.com/robotframework/PythonLibCore/workflows/CI/badge.svg?branch=master

Usage

There are two ways to use PythonLibCore, either by HybridCore or by using DynamicCore. HybridCore provides support for the hybrid library API and DynamicCore provides support for dynamic library API. Consult the Robot Framework User Guide, for choosing the correct API for library.

Regardless which library API is chosen, both have similar requirements.

  1. Library must inherit either the HybridCore or DynamicCore.
  2. Library keywords must be decorated with Robot Framework @keyword decorator.
  3. Provide a list of class instances implementing keywords to library_components argument in the HybridCore or DynamicCore __init__.

It is also possible implement keywords in the library main class, by marking method with @keyword as keywords. It is not requires pass main library instance in the library_components argument.

All keyword, also keywords implemented in the classes outside of the main library are available in the library instance as methods. This automatically publish library keywords in as methods in the Python public API.

The example in below demonstrates how the PythonLibCore can be used with a library.

Example

"""Main library."""

from robotlibcore import DynamicCore

from mystuff import Library1, Library2


class MyLibrary(DynamicCore):
    """General library documentation."""

    def __init__(self):
        libraries = [Library1(), Library2()]
        DynamicCore.__init__(self, libraries)

    @keyword
    def keyword_in_main(self):
        pass
"""Library components."""

from robotlibcore import keyword


class Library1(object):

    @keyword
    def example(self):
        """Keyword documentation."""
        pass

    @keyword
    def another_example(self, arg1, arg2='default'):
        pass

    def not_keyword(self):
        pass


class Library2(object):

    @keyword('Custom name')
    def this_name_is_not_used(self):
        pass

    @keyword(tags=['tag', 'another'])
    def tags(self):
        pass

Plugin API

It is possible to create plugin API to a library by using PythonLibCore. This allows extending library with external Python classes. Plugins can be imported during library import time, example by defining argumet in library __init__ which allows defining the plugins. It is possible to define multiple plugins, by seperating plugins with with comma. Also it is possible to provide arguments to plugin by seperating arguments with semicolon.

from robot.api.deco import keyword  # noqa F401

from robotlibcore import DynamicCore, PluginParser

from mystuff import Library1, Library2


class PluginLib(DynamicCore):

    def __init__(self, plugins):
        plugin_parser = PluginParser()
        libraries = [Library1(), Library2()]
        parsed_plugins = plugin_parser.parse_plugins(plugins)
        libraries.extend(parsed_plugins)
        DynamicCore.__init__(self, libraries)

When plugin class can look like this:

class MyPlugi:

    @keyword
    def plugin_keyword(self):
        return 123

Then Library can be imported in Robot Framework side like this:

Library    ${CURDIR}/PluginLib.py    plugins=${CURDIR}/MyPlugin.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].