Cedric
Cedric

Reputation: 977

How to define a keyword as a new test case

I'm currently developing a couple of test cases with robotframework to compare some excel value with value inside our database.

I have to do it inside a specific test case as it is deploy on zephyr. I am checking each value inside this test case by calling a homemade Keyword that does :

Run Keyword    Should Contain    ${valeurExcel1}    ${valeurBDD1}

Run Keyword Should Contain ${valeurExcel2} ${valeurBDD2}

etc...

I need every single one of those "Should Contain" to be display in a separated row in the report.html

It currently only appear as one row as it is one test case.

Is there anyway to specify to robot framework that i want him to consider every "Should Contain" as a unique test case and to display it in a row on the report.html ? (Maybe by tagging ?)

Upvotes: 0

Views: 187

Answers (1)

Laurent Bristiel
Laurent Bristiel

Reputation: 6935

No you can't. If you want a row for each "should contain" then each of those call should be made in its own test case.

But I think the problem lies in your "I have to do it inside a specific test case as it is deploy on zephyr". Whatever you need to do before/after a test case, can be done in a "suite setup" (and "suite teardown"). So you could have this kind of architecture:

*** Settings ***
Suite Setup  deploy SUT / Zephyr
Suite Teardown  shutdown SUT / Zephyr

*** Test Cases ***
tc1
    Run Keyword Should Contain ${valeurExcel1} ${valeurBDD1}

tc2  
    Run Keyword Should Contain ${valeurExcel2} ${valeurBDD2}

Upvotes: 1

Related Questions