Skip to content

quintagroup/quintagroup.robotframework.utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://travis-ci.org/quintagroup/quintagroup.robotframework.utils.png?branch=master

Quintagroup robotframework utils

Data file parser

Datafile library provides more convenient way to save some of your test data than robotframework variables tables do.

For example you have a file 'users.rst' where you save users accounts information:

**Accounts on site**

=========  ====  ========  =================
users      id    password  email
=========  ====  ========  =================
admin      Eric  passwr    [email protected]
manager    Jonh  passwr    [email protected]
publisher  Olga  passwr    [email protected]
reader     Jane  passwr    _table_:
\                          work; [email protected]|
\                          pesonal; [email protected]
=========  ====  ========  =================

and in test case you can parse this file and access its data in the following manner:

*** Settings ***
Library         quintagroup.robotframework.datafile.rst

*** Test Cases ***
Attribute alike access
    ${users}=  Read tables from file  ${CURDIR}/users.rst
    Should Be Equal  ${users.admin.id}  Eric
    Should Be Equal  ${users.manager.email}  [email protected]
    Should Be Equal  ${users.reader.id}  Jane
    Should Be Equal As String  ${users.reader.email}  [['work', '[email protected]'], ['pesonal', '[email protected]']]
    Should Be Equal As String  ${users.reader.email}[0]  ['work', '[email protected]']