Robot Framework

Introduce Robot Framewrok.

mindmap Robot Framework Test Suite Test Case Library

from robot.libraries.BuiltIn import BuiltIn

class acpu_interactive(interactive):
    ROBOT_LIBRARY_SCOPE = 'GLOBAL'

    def __init__(self, host, usr, passwd, uart, timeout=1):
        self.builtin = BuiltIn()

    @not_keyword
    def recv(self) -> str:
        try:
            output = super().recv()
            return output
        except TimeoutError:
            self.builtin.run_keyword('reboot soc')

RFLS is a VS Code extension support for Robot Framework. Here is the configuration I am currently using.

{
    "files.eol": "\n",
    "robot.codeLens.run.enable": true,
    "robot.completions.keywords.argumentsSeparator": " | ",
    "robot.completions.section_headers.form": "plural",
    "robot.flowExplorerTheme": "dark",
    "robot.lint.robocop.enabled": false,
    "robot.loadVariablesFromArgumentsFile": "",
    "robot.loadVariablesFromVariablesFile": "",
    "robot.lint.variables": true,
    "robot.libraries.libdoc.needsArgs": [
        "remote",
        "fakerlib"
    ],
    "robot.variables": {
        "LIBS": "${workspaceRoot}/lib",
        "RESOURCES": "${workspaceRoot}/resource"
    },
    "robot.pythonpath": [
        "${workspaceRoot}/lib"
    ],
}

  • robot.variables can be used to resolve Unable to statically resolve variable when using custom variable.
  • robot.pythonpath can be used to resolve Undefined keyword when using custom library.[a]