Skip to content

Instantly share code, notes, and snippets.

@GLMeece
Last active August 19, 2023 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GLMeece/7817c038e6a10338864cb0b19db42582 to your computer and use it in GitHub Desktop.
Save GLMeece/7817c038e6a10338864cb0b19db42582 to your computer and use it in GitHub Desktop.
Robot Framework VS Code snippets; place in your .vscode directory
{
"Test Suite": {
"prefix": "suite",
"body": [
"*** Settings ***",
"Documentation ${1:What does this testing suite cover?}\n",
"Library String # just an example",
"Library \\${EXECDIR\\}/path/to/CUSTOM_LIBRARY.py",
"Resource \\${EXECDIR\\}/path/to/NAME_OF_ANOTHER.resource\n",
"Suite Setup SETUP_HERE",
"Suite Teardown TEARDOWN_HERE\n\n",
"*** Variables ***",
"\\${SOME_TEXT\\} Hello",
"\\${AN_INT\\} \\${42}",
"@{A_LIST} All Cows Eat Grass",
"&{A_DICT} StrKey=A string IntKey=\\${22\\}\n\n",
"*** Test Cases ***",
"EXAMPLE TEST CASE (use 'tc' snippet instead)",
" [Documentation] DOCS HERE",
" [Tags] TAGS_HERE",
" [Setup] SETUP_HERE",
" No Operation",
" [Teardown] TEARDOWN_HERE\n\n",
"*** Keywords ***",
"EXAMPLE KEYWORD (use 'kw' snippet instead)",
" [Documentation] Move this to resource file later",
" [Arguments] \\${param_1\\} \\${param_2\\} # if args are needed...",
" No Operation\n\n",
"*** Comments ***",
"These comments are entirely ignored! Write a pie recipe if you want!\n"
],
"description": "Create new Test Suite"
},
"Resource File": {
"prefix": "rsrc",
"body": [
"*** Settings ***",
"Documentation ${1:What does this resource file provide?}\n",
"Library String # just an example",
"Library \\${EXECDIR\\}/path/to/CUSTOM_LIBRARY.py",
"Resource \\${EXECDIR\\}/path/to/NAME_OF_ANOTHER.resource\n\n",
"*** Variables ***",
"\\${SOME_TEXT\\} Hello",
"\\${AN_INT\\} \\${42}",
"@{A_LIST} All Cows Eat Grass",
"&{A_DICT} StrKey=A string IntKey=\\${22\\}\n\n",
"*** Keywords ***",
"EXAMPLE KEYWORD (use 'kw' snippet instead)",
" [Documentation] Move this to resource file later",
" [Arguments] \\${param_1\\} \\${param_2\\} # if args are needed...",
" No Operation\n\n",
"*** Comments ***",
"These comments are entirely ignored! Write a pie recipe if you want!\n"
],
"description": "Create new Resource File"
},
"New Keyword": {
"prefix": "kw",
"body": [
"${1:_type_keyword_name_here_}",
" [Documentation] ${2:_describe_keyword_function_}",
" [Arguments] \\${param_1\\} \\${param_2\\} # if args are needed...",
" No Operation # keyword steps go here...",
" # RETURN SOME_VALUE # if a value should be returned...\n"
],
"description": "Create new Keyword"
},
"New Test Case": {
"prefix": "tc",
"body": [
"${1:_type_test_case_number_} : ${2:_test_description_here_}",
" [Documentation] Test case $1",
" [Tags] $1 more_tags_galore",
" # [Setup] Setup Keyword # Optional - use as needed",
" Log Test case $1 console=True",
" No Operation",
" # [Teardown] Teardown Keyword # Optional - use as needed\n"
],
"description": "Create new Test Case"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment