easycsvmap-reactor

Robot framework keywords to read/write values of CSV file

License

License

Categories

Categories

React User Interface Web Frameworks CSV Data Data Formats Reactor Container Microservices Reactive libraries
GroupId

GroupId

com.github.jep42
ArtifactId

ArtifactId

easycsvmap-reactor
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

pom
Description

Description

easycsvmap-reactor
Robot framework keywords to read/write values of CSV file
Project URL

Project URL

https://github.com/JeP42/robotframework-easycsvmap
Source Code Management

Source Code Management

https://github.com/JeP42/robotframework-easycsvmap

Download easycsvmap-reactor

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jep42/easycsvmap-reactor/ -->
<dependency>
    <groupId>com.github.jep42</groupId>
    <artifactId>easycsvmap-reactor</artifactId>
    <version>0.0.5</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.jep42/easycsvmap-reactor/
implementation 'com.github.jep42:easycsvmap-reactor:0.0.5'
// https://jarcasting.com/artifacts/com.github.jep42/easycsvmap-reactor/
implementation ("com.github.jep42:easycsvmap-reactor:0.0.5")
'com.github.jep42:easycsvmap-reactor:pom:0.0.5'
<dependency org="com.github.jep42" name="easycsvmap-reactor" rev="0.0.5">
  <artifact name="easycsvmap-reactor" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.jep42', module='easycsvmap-reactor', version='0.0.5')
)
libraryDependencies += "com.github.jep42" % "easycsvmap-reactor" % "0.0.5"
[com.github.jep42/easycsvmap-reactor "0.0.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • easycsvmap
  • robotremoteserver
  • roboteasycsvmap

Build Status codecov Quality Gate Maven Central Docker Cloud Build Status

robotframework-easycsvmap

Description

The library provides keywords for Robot Framework to handle CSV files. It enables test case developers to select the cells of a CSV via flexible selector expressions e.g. by specifying the column name instead of column index. In most cases this is more intuitive than selecting cells via column index and it simplifies the work with CSVs especially for CSVs with a large number of columns. Moreover, the selector expressions support usage of regular expressions to select particular rows via a custom search string. The library supports sessions to be able to work with multiple CSV files in parallel.

Keywords

See the keyword documentation for information about the provided keywords.

Usage

Since the library is implemented in Java it can be used together with Jython just by importing the library within the test file. To be able to use it with Python the library has to be imported as remote library (refer to the RobotFrameworkUserGuide for more information about Remote Libraries). Be aware that the Java remote server implementation jrobotremoteserver does not support different library scopes (ROBOT_LIBRARY_SCOPE), hence the scope of the library is always GLOBAL.

Jython

*** Settings ***
Library    com.github.jep42.roboteasycsv.RobotEasyCsv

Remote Library Server

*** Settings ***
Library    Remote    http://localhost:8270/RobotEasyCsv

Robot Testcase

Assume a CSV file ${TEMPDIR}/userdata.csv with the following content:

firstname;lastname;email;sex
Peter;Pan;[email protected];male
Tinker;Bell;[email protected];female
James;Hook;[email protected];male
Reading CSV values

A common scenario is to read values from a CSV (e.g. to perform checks on it).

*** Test Cases ***
Check CSV Values
    ...
    Parse Csv From File    ${csvSessionId}    ${TEMPDIR}/userdata.csv    0
    {name}=    Get First Csv Value    ${csvSessionId}    {1}.lastname
    Should Be Equal 	${name} 	Pan
    {name}=    Get First Csv Value    ${csvSessionId}    {2}.lastname
    Should Be Equal 	${name} 	Bell
    ...
Changing CSV values

Another common scenario is to change values of a CSV (e.g. to test upload/download scenarios) or to add rows.

*** Test Cases ***
Change CSV Values
    ...
    Parse Csv From File    ${csvSessionId}    ${TEMPDIR}/userdata.csv    0
    Set Csv Values    ${csvSessionId}    {1}.email    [email protected]
    Set Csv Values    ${csvSessionId}    [email=^captain.*$].firstname    LittleJames
    Add Row    ${csvSessionId}    Wendy    Darling    [email protected]    female
    Save Csv To File    ${csvSessionId}    ${TEMPDIR}/userdata_updated.csv
    ...

Dependencies

  • org.robotframework:javalib-core:1.2.1 (Download from Maven Central)
  • net.sf.opencsv:opencsv:2.3 (Download from Maven Central)
  • com.google.code.findbugs:jsr305:2.0.1 (Download from Maven Central)
  • org.slf4j:slf4j-api:1.7.21 (Download from Maven Central)
  • [only for sub-module remoteserver] com.github.ombre42:jrobotremoteserver:3.0 (Download from Maven Central)

Build from source

  • Clone the repository
  • Execute mvn install on the root folder of the project to build the reactor which consist of two modules
  • Sub-module "easycsvmap": The keyword library
  • Sub-module "remoteserver": The remote server which already contains the keyword library

Versions

Version
0.0.5
0.0.4