{"id":15018726,"url":"https://github.com/robotframework/statuschecker","last_synced_at":"2025-04-06T20:09:37.650Z","repository":{"id":41348182,"uuid":"51146888","full_name":"robotframework/statuschecker","owner":"robotframework","description":"Tool for validating that executed Robot Framework test cases have expected statuses and log messages.","archived":false,"fork":false,"pushed_at":"2025-02-09T14:36:16.000Z","size":196,"stargazers_count":28,"open_issues_count":1,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T19:08:44.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotframework.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-05T13:05:32.000Z","updated_at":"2025-03-29T17:43:54.000Z","dependencies_parsed_at":"2024-06-21T02:16:43.853Z","dependency_job_id":"ddeb5102-8cc6-4535-b481-a38c7f79040c","html_url":"https://github.com/robotframework/statuschecker","commit_stats":{"total_commits":171,"total_committers":10,"mean_commits":17.1,"dds":0.6198830409356726,"last_synced_commit":"7a0b582082036e3c39e89e04a2bcf160a5d68cb4"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotframework%2Fstatuschecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotframework%2Fstatuschecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotframework%2Fstatuschecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotframework%2Fstatuschecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotframework","download_url":"https://codeload.github.com/robotframework/statuschecker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543589,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:52:22.295Z","updated_at":"2025-04-06T20:09:37.631Z","avatar_url":"https://github.com/robotframework.png","language":"Python","readme":"StatusChecker\n=============\n\n.. contents::\n   :local:\n\nIntroduction\n------------\n\nStatusChecker is a tool for validating that executed `Robot Framework`_\ntests have expected statuses and log messages. It is mainly useful\nfor Robot Framework library developers who want to test their libraries\nusing Robot Framework.\n\nStatusChecker project is hosted at GitHub_ and downloads are at PyPI_.\n\n.. _Robot Framework: http://robotframework.org\n.. _GitHub: https://github.com/robotframework/statuschecker\n.. _PyPI: https://pypi.python.org/pypi/robotstatuschecker\n.. _pip: http://pip-installer.org\n\nInstallation instructions\n-------------------------\n\nThe easiest way to install StatusChecker is by using pip_::\n\n    pip install robotstatuschecker\n\nAlternatively you can get the code by cloning the project from\nGitHub_ or downloading the source distribution from PyPI_ and\nextracting it. After that you can install the tool with::\n\n    python setup.py install\n\nUsage\n-----\n\nAs a tool::\n\n    python -m robotstatuschecker output.xml\n    python -m robotstatuschecker output.xml checked.xml\n\nThe first argument is the file to check and the latter is where to save\nthe results. If only one argument is given, that file is modified in place.\nIf you want to get log and report files, you need to generate them separately\nwith the ``rebot`` tool.\n\nAs a pre-Rebot modifier::\n\n    robot --prerebotmodifier robotstatuschecker.StatusChecker tests.robot\n    rebot --prerebotmodifier robotstatuschecker.StatusChecker output.xml\n    rebot --prerebotmodifier robotstatuschecker.StatusChecker --output checked.xml output.xml\n\nWhen used as part of execution with ``robot``, results are checked before\nlog and report files are generated, but the output.xml file is not modified.\nThe same is true also with ``rebot`` by default, but it is possible to use\nthe ``--output`` option to specify where to save the modified results.\n\nProgrammatically:\n\n.. sourcecode:: python\n\n    from robotstatuschecker import process_output\n\n    process_output('output.xml', 'checked.xml')\n\nAlso in this usage the second argument is optional and the input file is\nmodified in place if it is not given.\n\nDefining expected test status\n-----------------------------\n\nBy default, all tests are expected to *PASS* and have no message.\nChanging the expected status to *FAIL* is done by having the word\n``FAIL`` (case-sensitive) somewhere in the test documentation.\nThe expected error message must then follow the ``FAIL`` marker.\n\nIf the test is expected to be skipped, you can change the expected status\nto *SKIP* by adding the word ``SKIP`` in the documentation. Also in\nthis case the expected message must follow the marker. If a test is\nexpected to *PASS* with a certain message, the word ``PASS`` must be\nadded to its documentation explicitly and the expected message given\nafter that.\n\nThe expected message can also be specified as a regular expression by\nprefixing it with ``REGEXP:``. The specified regular expression\nmust match the error message fully. Having spaces between the status,\nthe message and the possible regular expression prefix is optional.\n\nAn alternative to using regular expressions is using glob patterns where\n``*`` matches anything (including newline) and ``?`` matches any single\ncharacter. This is can be accomplished by starting the expected message\nwith ``GLOB:``.\n\nFinally, it is possible to test that the message starts with something\nby prefixing the expected message with ``STARTS:``.\n\nThe following examples illustrate different ways to define test\nstatuses and messages:\n\n.. sourcecode:: robotframework\n\n    *** Test Cases ***\n    Implicit PASS\n        Log    Hello!\n\n    Explicit PASS with message\n        [Documentation]    PASS Expected message\n        Pass Execution    Expected message\n\n    Expected FAIL\n        [Documentation]    FAIL Expected failure\n        Fail    Expected failure\n\n    Expected SKIP\n        [Documentation]    Text before marker is ignored SKIP Expected skip\n        Skip    Expected skip\n\n    Message using REGEXP\n        [Documentation]    FAIL REGEXP: (IOError|OSError): .*\n        Fail    IOError: Unknown error\n\n    Message using GLOB\n        [Documentation]    FAIL GLOB: ??Error: *\n        Fail    IOError: Unknown error\n\n    Message using STARTS\n        [Documentation]    FAIL STARTS: IOError:\n        Fail    IOError: Unknown error\n\n\nDefining expected log messages\n------------------------------\n\nIn addition to verifying test statuses and messages, it possible to verify\nmessages logged by keywords. Expected log messages are defined in the test\ndocumentation using this syntax::\n\n   LOG x.y.z LEVEL Actual message\n\nThe syntax consists of the following parts:\n\n- ``LOG`` marker (case-sensitive).\n- Locator used for finding the message. Locators typically consists of 1-based\n  indices like ``2.1.3`` matching items in test and keyword body. In addition\n  to that, they can contain ``setup`` and ``teardown`` markers mathing test and\n  keyword setup and teardown.\n- Optional, case-sensitive log level. If omitted, the level is ``INFO``.\n  Special value ``ANY`` can be used to accept any level.\n- The actual log message. Possible leading and trailing whitespace is ignored.\n  Special value ``NONE`` (case-sensitive) can be used to indicate that there\n  should be no log message.\n\nThe locator can either point directly to the message to be verified or\nto the parent element of the message. In the latter case the actual message\nis expected to be the first item in parent's body. If the message index\nis not known, it is possible use the asterisk as a wildcard like ``2.*``\nto match any message. When a locator points directly to a message, it is\npossible to use ``:`` as the message separator instead of ``.``, but this\nsupport is deprecated and may be removed in the future.\n\nIf test status and message is also tested, they must be specified before\nthe ``LOG`` marker using the syntax explained in the previous section.\nIf there are multiple message to be tested, the ``LOG`` marker can be used\nmultiple times. In such cases it is often a good idea to split the documentation\nto multiple lines.\n\n.. sourcecode:: robotframework\n\n    *** Test cases ***\n    Locator points to message parent\n        [Documentation]    LOG 1 Hello! LOG 2 first LOG 3.1 Nested!\n        Log    Hello!\n        Log Many    first    second    third\n        User Keyword\n\n    Locator points to directly to message\n        [Documentation]    Splitting can enhance readability. This text is ignored.\n        ...    LOG 1.1 Hello!\n        ...    LOG 2.2 second\n        ...    LOG 3.1.1 Nested!\n        Log    Hello!\n        Log Many    first    second    third\n        User Keyword\n\n    Message in setup and teardown\n        [Documentation]\n        ...    LOG    setup         Hello!\n        ...    LOG    teardown.1    Nested!\n        [Setup]    Log    Hello!\n        No Operation\n        [Teardown]    User Keyword\n\n    Wildcard\n        [Documentation]    LOG 1.* first\n        Log Many    first    second    third\n\n    No message\n        [Documentation]\n        ...    LOG    1.1    one\n        ...    LOG    1.2    two\n        ...    LOG    1.3    NONE\n        Log Many    one    two\n\n    Log levels\n        [Documentation]\n        ...    LOG    1    DEBUG    first\n        ...    LOG    2    INFO     second\n        ...    LOG    3    ANY      third\n        Log    first    level=DEBUG\n        Log    second   level=INFO\n        Log    third    level=DEBUG\n\n    Test status and log message\n        [Documentation]    FAIL    Expected failure\n        ...    LOG    1    INFO    Hello!\n        ...    LOG    2    FAIL    Expected failure\n        Log    Hello!\n        Fail    Expected failure\n\n    *** Keywords ***\n    User Keyword\n        Log    Nested!\n\nIf the message is not known exactly, it is possible to match it as a regular\nexpression or glob pattern or to give just the beginning of the message.\nThis is accomplished by prefixing the message with ``REGEXP:``, ``GLOB:``\nor ``STARTS:``, respectively, exactly like when `defining expected test status`_.\n\n.. sourcecode:: robotframework\n\n    *** Test cases ***\n    Log message using REGEXP\n        [Documentation]    LOG 1 REGEXP: Hello, .*!\n        Log    Hello, Robots!\n\n    Log message using GLOB\n        [Documentation]    LOG 1 GLOB: Hello, *!\n        Log    Hello, Robots!\n\n    Log message using STARTS\n        [Documentation]    LOG 1 STARTS: Hello\n        Log    Hello, Robots!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotframework%2Fstatuschecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotframework%2Fstatuschecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotframework%2Fstatuschecker/lists"}