| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 4 |
<title>test.robot</title> |
| 5 |
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Robot) - Theme (Breeze Dark)"/> |
| 6 |
</head><body style="background-color:#232629;color:#cfcfc2"><pre> |
| 7 |
<span style="color:#da4453;">*** Comments ***</span> |
| 8 |
<span style="color:#7a7c7d;">Some comments go here</span> |
| 9 |
<span style="color:#7a7c7d;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a quam erat.</span> |
| 10 |
<span style="color:#7a7c7d;">Nam ante lorem, placerat et est a, blandit rutrum magna. Vivamus congue ipsum eget neque posuere, nec egestas risus cursus. Proin nec interdum orci.</span> |
| 11 |
<span style="color:#7a7c7d;">Vivamus blandit, elit sed vehicula lobortis, orci massa malesuada nibh, at rutrum lacus quam a metus. Donec velit magna, pulvinar eget metus eu, aliquet sagittis ante.</span> |
| 12 |
<span style="color:#7a7c7d;"> ... Donec egestas neque vel libero finibus hendrerit. Nam tempus quam ut mi interdum vulputate. Mauris ac auctor magna.</span> |
| 13 |
<span style="color:#7a7c7d;">Maecenas sollicitudin, tortor nec auctor pellentesque, sapien neque accumsan enim, quis porttitor magna est non nibh.</span> |
| 14 |
<span style="color:#7a7c7d;">Pellentesque facilisis luctus nulla, ut dignissim ligula vestibulum ac. Sed sit amet eros non turpis congue facilisis vitae vitae orci.</span> |
| 15 |
<span style="color:#7a7c7d;">Morbi et lobortis nibh. Proin blandit, diam ut blandit aliquam, ligula diam posuere lorem, sed malesuada quam massa eu elit. S</span> |
| 16 |
<span style="color:#7a7c7d;">uspendisse ultrices velit nec mauris laoreet, eget tristique tortor maximus.</span> |
| 17 |
|
| 18 |
<span style="color:#da4453;">*** Settings ***</span> |
| 19 |
<span style="color:#7f8c8d;">Documentation</span><span style="color:#7a7c7d;"> Simple example demonstrating syntax highlighting.</span> |
| 20 |
<span style="color:#7a7c7d;">... Multiple lines.</span> |
| 21 |
<span style="color:#7a7c7d;">... Thanks to https://spage.fi/highlight-robot !</span> |
| 22 |
<span style="color:#7f8c8d;">Library </span>ExampleLibrary |
| 23 |
<span style="color:#7f8c8d;">Test Setup </span>Test Setup Keyword argument argument with <span style="color:#27aeae;">${VARIABLE}</span> |
| 24 |
<span style="color:#7f8c8d;">Test Teardown </span>Test Keyword Teardown argument argument with <span style="color:#27aeae;">${VARIABLE}</span> |
| 25 |
<span style="color:#7f8c8d;">Suite Setup </span>Big Suite Setup <span style="color:#27aeae;">${ARG}</span> argument with <span style="color:#27aeae;">${VARIABLE}</span> |
| 26 |
<span style="color:#7f8c8d;">Suite Teardown </span>Teardown keyword argument argument with <span style="color:#27aeae;">${VARIABLE}</span> |
| 27 |
<span style="color:#7a7c7d;"># Comment in here too</span> |
| 28 |
<span style="color:#7f8c8d;">Resource </span><span style="color:#27aeae;">${RESOURCES}</span>/file<span style="color:#3f8058;">.</span>txt |
| 29 |
<span style="color:#7f8c8d;">Variables </span><span style="color:#27aeae;">${VARIABLES}</span>/file<span style="color:#3f8058;">.</span>txt |
| 30 |
|
| 31 |
<span style="color:#da4453;">*** Variables ***</span> |
| 32 |
<span style="color:#27aeae;">${VARIABLE}</span> Variable value |
| 33 |
<span style="color:#27aeae;">@{LIST}</span> List variable here |
| 34 |
<span style="color:#27aeae;">&{DICT}</span> Key1<span style="color:#3f8058;">=</span>Value1 Key2<span style="color:#3f8058;">=</span>Value2 |
| 35 |
|
| 36 |
<span style="color:#da4453;">*** Test Cases ***</span> |
| 37 |
<span style="color:#8e44ad;">First example</span> |
| 38 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Documentation</span><span style="color:#3f8058;">]</span><span style="color:#7a7c7d;"> Most amazing</span> |
| 39 |
<span style="color:#7a7c7d;"> ... documentation</span> |
| 40 |
Initialize System |
| 41 |
Do Something |
| 42 |
<span style="color:#7a7c7d;"># Comment</span> |
| 43 |
Result Should Be <span style="color:#27aeae;">${42}</span> |
| 44 |
Test if something and else something |
| 45 |
A cool suite keyword that takes a string |
| 46 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Teardown</span><span style="color:#3f8058;">]</span> Cleanup System <span style="color:#7a7c7d;"># Being a good citizen</span> |
| 47 |
|
| 48 |
<span style="color:#8e44ad;">Test if something and else something</span> |
| 49 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Documentation</span><span style="color:#3f8058;">]</span><span style="color:#7a7c7d;"> Do not change colors in middle of kw/tc name</span> |
| 50 |
<span style="color:#3f8058;">[</span><span style="color:#7f8c8d;">Setup</span><span style="color:#3f8058;">] </span><span style="color:#f44f4f;"> Small Keyword Setup</span> |
| 51 |
|
| 52 |
Kw for if something and else something |
| 53 |
Do a thing <span style="color:#27aeae;">${thing}</span> |
| 54 |
Run a for loop |
| 55 |
Run a while loop to end |
| 56 |
<span style="color:#7a7c7d;">#A comment</span> |
| 57 |
Kw for if something and else something |
| 58 |
<span style="color:#27aeae;">${status}</span> <span style="color:#3f8058;">=</span> BuiltIn<span style="color:#3f8058;">.</span>Evaluate 0 < <span style="color:#27aeae;">${result}</span> < 10 |
| 59 |
Then print <span style="color:#27aeae;">${status}</span> |
| 60 |
|
| 61 |
<span style="color:#8e44ad;">Second </span><span style="color:#27aeae;">${variable}</span><span style="color:#8e44ad;"> example</span> |
| 62 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Documentation</span><span style="color:#3f8058;">]</span><span style="color:#7a7c7d;"> Oneliner</span> |
| 63 |
<span style="color:#3f8058;">[</span><span style="color:#7f8c8d;">Template</span><span style="color:#3f8058;">] </span><span style="color:#f44f4f;"> Keyword</span> |
| 64 |
<span style="color:#3f8058;">[</span><span style="color:#7f8c8d;">Tags</span><span style="color:#3f8058;">] </span><span style="color:#f44f4f;"> aaa bbb ccc</span> |
| 65 |
argument1 argument2 |
| 66 |
argument <span style="color:#27aeae;">${VARIABLE}</span> |
| 67 |
<span style="color:#27aeae;">@{LIST}</span> |
| 68 |
|
| 69 |
<span style="color:#8e44ad;">Three </span><span style="color:#27aeae;">${var}</span><span style="color:#8e44ad;"> example </span><span style="color:#27aeae;">${var2}</span><span style="color:#8e44ad;"> last </span><span style="color:#27aeae;">${var3}</span> |
| 70 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Documentation</span><span style="color:#3f8058;">]</span><span style="color:#7a7c7d;"> Oneliner</span> |
| 71 |
<span style="color:#3f8058;">[</span><span style="color:#7f8c8d;">Tags</span><span style="color:#3f8058;">] </span><span style="color:#f44f4f;"> tag1 tag2</span> |
| 72 |
<span style="color:#f44f4f;"> ... more tags</span> |
| 73 |
Given system is initialized |
| 74 |
When something is done |
| 75 |
<span style="color:#7a7c7d;"># Comment</span> |
| 76 |
<span style="color:#7a7c7d;"># Another Comment</span> |
| 77 |
<span style="color:#7a7c7d;"># Oops this comment is here</span> |
| 78 |
<span style="color:#7a7c7d;"># This comment is way over here!</span> |
| 79 |
And things are ok |
| 80 |
|
| 81 |
Then result should be <span style="color:#f44f4f;">"42"</span> but not <span style="color:#27aeae;">${var1}</span> <span style="color:#7a7c7d;">#Anything inside "" should be a string</span> |
| 82 |
Another result should be <span style="color:#f44f4f;">'23'</span> <span style="color:#7a7c7d;">#also for ''</span> |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
<span style="color:#da4453;">*** Keywords ***</span> |
| 87 |
<span style="font-weight:bold;">Result Should Be</span> |
| 88 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Arguments</span><span style="color:#3f8058;">]</span> <span style="color:#27aeae;">${expected}</span> |
| 89 |
<span style="color:#27aeae;">${actual}</span> <span style="color:#3f8058;">=</span> Get Value |
| 90 |
Should be Equal <span style="color:#27aeae;">${actual}</span> <span style="color:#27aeae;">${expected}</span> |
| 91 |
|
| 92 |
<span style="font-weight:bold;">Then result should be </span><span style="color:#27aeae;">${expected}</span> |
| 93 |
Result Should Be <span style="color:#27aeae;">${expected}</span> |
| 94 |
this is also a <span style="color:#27aeae;">$variable</span> |
| 95 |
<span style="color:#fdbc4b;font-weight:bold;">IF</span> <span style="color:#27aeae;">$var_in_py_expr1</span> <span style="color:#3f8058;">==</span> <span style="color:#27aeae;">$var_in_py_expr2</span> |
| 96 |
Call Keyword |
| 97 |
<span style="color:#fdbc4b;font-weight:bold;">ELSE</span> |
| 98 |
<span style="color:#7a7c7d;">#nothing!!</span> |
| 99 |
Do nothing |
| 100 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 101 |
|
| 102 |
<span style="font-weight:bold;">Kw for if something and else something</span> |
| 103 |
<span style="color:#fdbc4b;font-weight:bold;">WHILE</span> <span style="color:#27aeae;">${var}</span> <span style="color:#3f8058;">=</span> <span style="color:#27aeae;">${True}</span> |
| 104 |
<span style="color:#fdbc4b;font-weight:bold;">IF</span> <span style="color:#27aeae;">$var_in_py_expr1</span> <span style="color:#3f8058;">==</span> <span style="color:#27aeae;">$var_in_py_expr2</span> |
| 105 |
Call Keyword |
| 106 |
<span style="color:#fdbc4b;font-weight:bold;">ELSE</span> |
| 107 |
<span style="color:#7a7c7d;">#nothing!!</span> |
| 108 |
Do nothing |
| 109 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 110 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 111 |
|
| 112 |
<span style="font-weight:bold;">Log items</span> |
| 113 |
<span style="color:#3f8058;"> [</span><span style="color:#7f8c8d;">Arguments</span><span style="color:#3f8058;">]</span> <span style="color:#27aeae;">@{items}</span> <span style="color:#27aeae;">${log_values}</span><span style="color:#3f8058;">=</span>True |
| 114 |
<span style="color:#fdbc4b;font-weight:bold;">IF</span> not <span style="color:#27aeae;">${items}</span> |
| 115 |
Log to console No items<span style="color:#3f8058;">.</span> |
| 116 |
<span style="color:#fdbc4b;font-weight:bold;">ELSE</span> <span style="color:#fdbc4b;font-weight:bold;">IF</span> len<span style="color:#3f8058;">(</span><span style="color:#27aeae;">${items}</span><span style="color:#3f8058;">)</span> <span style="color:#3f8058;">==</span> 1 |
| 117 |
<span style="color:#fdbc4b;font-weight:bold;">IF</span> <span style="color:#27aeae;">${log_values}</span> |
| 118 |
Log to console One item: <span style="color:#27aeae;">${items}</span><span style="color:#3f8058;">[</span>0<span style="color:#3f8058;">]</span> |
| 119 |
<span style="color:#fdbc4b;font-weight:bold;">ELSE</span> |
| 120 |
Log to console One item<span style="color:#3f8058;">.</span> |
| 121 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 122 |
<span style="color:#fdbc4b;font-weight:bold;">ELSE</span> |
| 123 |
Log to console <span style="color:#27aeae;">${</span>{len<span style="color:#3f8058;">(</span><span style="color:#27aeae;">${items}</span><span style="color:#3f8058;">)</span>}} items<span style="color:#3f8058;">.</span> |
| 124 |
<span style="color:#fdbc4b;font-weight:bold;">IF</span> <span style="color:#27aeae;">${log_values}</span> |
| 125 |
<span style="color:#fdbc4b;font-weight:bold;">FOR</span> <span style="color:#27aeae;">${index}</span> <span style="color:#27aeae;">${item}</span> <span style="color:#fdbc4b;font-weight:bold;">IN</span> <span style="color:#fdbc4b;font-weight:bold;">ENUMERATE</span> <span style="color:#27aeae;">@{items}</span> start<span style="color:#3f8058;">=</span>1 |
| 126 |
Log to console Item <span style="color:#27aeae;">${index}</span>: <span style="color:#27aeae;">${item}</span> |
| 127 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 128 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 129 |
<span style="color:#fdbc4b;font-weight:bold;">END</span> |
| 130 |
|
| 131 |
|
| 132 |
<span style="color:#da4453;">*** Tasks ***</span> |
| 133 |
<span style="color:#0099ff;font-weight:bold;">Process invoice</span> |
| 134 |
Read information from PDF |
| 135 |
Validate information <span style="color:#f44f4f;">"asd"</span> |
| 136 |
Submit information to backend system |
| 137 |
Validate information is visible in web UI |
| 138 |
|
| 139 |
</pre></body></html> |