Robot Framework Does Is Library
Project description
DoesIsLibrary for Robot Framework
Introduction
RobotFramework library which extends imported libraries with Does and Is keywords.
RobotFramework libraries provides assertion keywords, usually named like Something Should Exist, Another Thing Should Be Eqal, Yet Another Should Not Exist, Some Should Not Be Equal. This library extracts such keywords from libraries imported in suite, and extends libraries from where those keywords come from with Does and Is keywords, like:
Orginal keyword - Newly created keyword Something Should Exist - Does Somethin Exist Another Thing Should Be Eqal - Is Another Thing Equal Yet Another Should Not Exist - Does Yest Another Not Exist Some Should Not Be Equal - Is Some Not Equal
Orginal Keywords PASS or FAIL depending of assertion is met or not, while newly created keyword returns True
or False
Use Case is shown in follwing example:
Usage
WithoutLibrary.robot
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
NoLibrary
${are_equal}= Run Keyword And Return Status Should Be Equal As Numbers 10 10
Run Keyword If '${are_equal}'=='True' Log Equal!
Open Browser http://example.local gc
${is_element_visible}= Run Keyword And Return Status Element Should Be Visible id=locator
Run Keyword If '${is_element_visible}'=='True' Click Element id=locator
WithLibrary.robot
*** Settings ***
Library SeleniumLibrary
Library DoesIsLibrary
*** Test Cases ***
WithLibrary
${are_equal}= Is Equal As Numbers 10 10
Run Keyword If '${are_equal}'=='True' Log Equal!
Open Browser http://example.local gc
${is_element_visible}= Is Element Visible id=locator
Run Keyword If '${is_element_visible}'=='True' Click Element id=locator
Library Does not provide almost all "static" keywords, except List Is Keywords
and List Does keywords
which place names of newly dynamically generated keywords in RF log.html file.
- Information about keywords can be found on the Keyword Documentation page.
How it works and limitations
Library is looking for imported libraries from Settings section during start suite phase and then looks for keyword having 'should' in keyword name. Then new keywords are created for each imported library respectively.
As (for now) new keyword generation is triggerd in suite setup phase, new keywords will not be generated for libraries imported with RF built in keyword Import Library
Requirements
- Robot Framework
Installation
Using pip
The recommended installation tool is pip.
Install pip. Enter the following:
pip install robotframework-doesislibrary
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file robotframework_doesislibrary-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: robotframework_doesislibrary-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4437de15b586f11ba2ecc02d1bd6ecc416e91589359830bd6d37405a3d10de71 |
|
MD5 | f6addaff437ff2dcd8d4c3048386a49f |
|
BLAKE2b-256 | bb9e179408992894b7b96a55036887b6058ea3518dab4ca7970ec4fff5d79c2e |