跳转到主要内容

数据文件库,提供比robotframework变量表更方便的方式来保存一些测试数据

项目描述

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

Quintagroup robotframework utils

数据文件解析器

数据文件库提供了一种比robotframework变量表更方便的方式来保存一些测试数据。

例如,您有一个名为‘users.rst’的文件,其中保存用户账户信息

**Accounts on site**

=========  ====  ========  =================
users      id    password  email
=========  ====  ========  =================
admin      Eric  passwr    eric@example.com
manager    Jonh  passwr    jonh@example.com
publisher  Olga  passwr    olga@example.com
reader     Jane  passwr    _table_:
\                          work; jane@work.com|
\                          pesonal; jane@pesonal.com
=========  ====  ========  =================

在测试用例中,您可以按照以下方式解析此文件并访问其数据

*** 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}  jonh@example.com
    Should Be Equal  ${users.reader.id}  Jane
    Should Be Equal As String  ${users.reader.email}  [['work', 'jane@work.com'], ['pesonal', 'jane@pesonal.com']]
    Should Be Equal As String  ${users.reader.email}[0]  ['work', 'jane@work.com']

变更日志

1.0 (2013-12-16)

  • 初始发布

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

quintagroup.robotframework.utils-1.0.zip (23.5 kB 查看散列)

上传时间:

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面