All Downloads are FREE. Search and download functionalities are using the official Maven repository.

robotframework-2.7.7.atest.robot.testdoc.testdoc.txt Maven / Gradle / Ivy

The newest version!
*** Settings ***
Force Tags    regression   pybot   jybot
Resource      atest_resource.txt

*** Variables ***
${CMD}    ${INTERPRETER} ${CURDIR}${/}..${/}..${/}..${/}src${/}robot${/}testdoc.py
${INPUT 1}    ${CURDIR}${/}..${/}..${/}testdata${/}misc${/}pass_and_fail.txt
${INPUT 2}    ${CURDIR}${/}..${/}..${/}testdata${/}misc${/}suites
${INPUT 3}    ${CURDIR}${/}..${/}..${/}testdata${/}testdoc
${OUTFILE}    %{TEMPDIR}${/}testdoc-output.html


*** Test Cases ***
One input
    ${output}=    Run TestDoc    ${INPUT 1}
    Testdoc Should Contain    "name":"Pass And Fail"    "title":"Pass And Fail"    "numberOfTests":2
    Output Should Contain Outfile    ${output}

Variables and imports are not processes
    ${output}=    Run TestDoc    ${INPUT 3}
    Testdoc Should Contain    "name":"Testdoc"    "title":"Testdoc"    "numberOfTests":1
    Output Should Contain Outfile    ${output}

Many inputs
    ${output}=    Run TestDoc    --exclude t1 --title MyDoc ${INPUT 1} ${INPUT2} ${INPUT 3}
    Testdoc Should Contain    "name":"Pass And Fail & Suites & Testdoc"    "title":"MyDoc"    "numberOfTests":7
    Testdoc Should Not Contain    "name":"Suite4 First"
    Output Should Contain Outfile    ${output}

Invalid usage
    ${output}=    Run TestDoc    ${EMPTY}    252
    Should Be Equal    ${output}    Expected at least 2 arguments, got 1.${USAGE TIP}


*** Keyword ***
Run TestDoc
    [Arguments]    ${args}    ${expected rc}=0
    ${rc}    ${output}=   Run And Return Rc And Output  ${CMD} ${args} ${OUTFILE}
    Should Be Equal As Numbers   ${rc}    ${expected rc}
    [Return]    ${output}

Testdoc Should Contain
    [Arguments]    @{expected}
    ${testdoc}=    Get File    ${OUTFILE}
    : FOR     ${exp}    IN   @{expected}
    \    Should Contain    ${testdoc}   ${exp}

Testdoc Should Not Contain
    [Arguments]    @{expected}
    ${testdoc}=    Get File    ${OUTFILE}
    : FOR     ${exp}    IN   @{expected}
    \    Should Not Contain    ${testdoc}   ${exp}

Output Should Contain Outfile
    [Arguments]    ${output}
    [Documentation]    Printed outfile may be in different formats.
    ...                IronPython seems to like c:\olddos~1\format~2.ext
    Should Not Contain    ${output}    ERROR
    File Should Exist    ${output}
    Remove File    ${OUTFILE}
    File Should Not Exist    ${output}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy