Snooz82 / robotframework-datadriver

Library to provide Data-Driven testing with CSV tables to Robot Framework
Apache License 2.0
131 stars 37 forks source link

All tests of a suite are run, if include tag not available in data file #92

Open philipp2023 opened 11 months ago

philipp2023 commented 11 months ago

Test:

*** Settings ***
Library           String
Library           DataDriver

Test Template     Verify Pwd Length
Default Tags         RegressionTest    SmokeTest    foo   noTestShallBeRun

*** Test Cases ***
Login with user '${username}' and password '${password}'    Default    UserData

*** Keywords ***
Verify Pwd Length
    [Arguments]    ${username}   ${password}

    ${pwdLength} =    Get Length    ${password}
    Should Be True    ${pwdLength} > 5

Data file:

*** Test Cases ***;${username};${password};[Tags];[Documentation]
Right user empty pass;demo;${EMPTY};1;This is a test case documentation of the first one.
Right user wrong pass;demo;FooBar;2,3,foo;This test case has the Tags 2,3 and foo
;${EMPTY};mode;1,2,3,4;This test case has a generated name based on template name.
;${EMPTY};${EMPTY};;
;${EMPTY};FooBar;;
;FooBar;mode;foo,1;
;FooBar;${EMPTY};foo;
Should Pass (SmokeTest);FooBar;FooBar;SmokeTest,anotherTag;

If tag exists in data file, --include works

Img1

If tag does not exist in data file, all tests are run

Img2

Expected

No tests are run.