├── .gitignore ├── AppiumLibrary-Demo ├── Android-Case.robot ├── app │ ├── ContactManager.apk │ └── TestApp.app │ │ ├── Default-568h@2x.png │ │ ├── GestureTestViewController.nib │ │ ├── objects-8.0+.nib │ │ ├── objects.nib │ │ └── runtime.nib │ │ ├── Info.plist │ │ ├── PkgInfo │ │ ├── TestApp │ │ └── en.lproj │ │ ├── InfoPlist.strings │ │ ├── Localizable.strings │ │ └── MyViewControllerViewController.nib │ │ ├── objects-8.0+.nib │ │ ├── objects.nib │ │ └── runtime.nib └── iOS-Case.robot ├── AutoItDemo ├── CalculatorGUIMap.py ├── Calculator_Test_Cases.html ├── __init__.html └── tests │ ├── resource.txt │ ├── testsuite-alert.txt │ ├── testsuite-updown.txt │ ├── text.rar │ └── text2.rar ├── DatabaseDemo ├── Database-sqlite.txt ├── database.txt └── demo.db ├── LICENSE ├── README.md ├── RF-Libraries-Demo ├── 7.2-BuiltIn │ ├── 1-Convert.robot │ ├── 2-Verify.robot │ ├── 3-Variables.robot │ ├── 4-RunKeyword.robot │ ├── 5-Control.robot │ ├── 6-Misc.robot │ └── 7-Evaluate.robot ├── 7.3-String │ └── string.robot ├── 7.4-Collections │ └── Collections.robot ├── 7.5-OperatingSystem │ ├── OperatingSystem.robot │ └── sample.txt ├── 7.6-Process │ └── Process.robot ├── 7.7-XML │ ├── XML.robot │ └── save.xml ├── 7.8-Others │ ├── DateTime.robot │ ├── Dialog.robot │ ├── Remote.robot │ ├── Screenshot.robot │ ├── Telnet.robot │ └── examplelibrary.py └── __init__.robot ├── RequestsDemo └── request.txt ├── Selenium2Library-demo ├── 1-browser.robot ├── 2-elements.robot └── 3-Others.robot ├── TestLibrary └── ExampleLibrary │ ├── doc │ ├── ExampleLibrary.OtherLibrary.html │ └── ExampleLibrary.html │ ├── src │ └── ExampleLibrary.py │ └── test │ └── acceptance │ ├── testExampleLibrary.robot │ └── testOtherLibrary.robot ├── demo-website ├── demo.db ├── demodao.py ├── flaskdemo.py ├── static │ ├── jquery-ui.css │ ├── jquery-ui.js │ ├── jquery.js │ ├── text.rar │ └── text2.rar └── templates │ ├── deliver.html │ ├── iframe.html │ ├── index.html │ ├── layout.html │ ├── payfor.html │ └── updown.html ├── fencengDemo ├── flow.txt ├── keyword.txt └── suite.txt └── rf-book-case ├── test ├── Suite-2-10.robot ├── Suite-2-11.robot ├── Suite-2-8.robot ├── Suite-2-9.robot ├── Suite-3-4 │ ├── Step2.robot │ ├── Step3.robot │ ├── elements.robot │ ├── step1.robot │ └── testflow.robot ├── newresource.txt └── 测试套件.robot └── testproject └── testsuite1.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | -------------------------------------------------------------------------------- /AppiumLibrary-Demo/Android-Case.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library AppiumLibrary 3 | 4 | *** Test Cases *** 5 | case1-noid 6 | Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=4.2.2 deviceName=192.168.56.101:5555 app=${CURDIR}${/}app${/}ContactManager.apk appPackage=com.example.android.contactmanager 7 | Click Element accessibility_id=Add Contact 8 | ${source} Get Source 9 | Log ${source} 10 | Sleep 5s 11 | Input Text xpath=//android.widget.TableRow[contains(@index,3)]/android.widget.EditText Jacky Qi 12 | Input Text xpath=//android.widget.TableRow[contains(@index,5)]/android.widget.EditText 13800138000 13 | Input Text xpath=//android.widget.TableRow[contains(@index,7)]/android.widget.EditText qitaos@gmail.com 14 | Click Element accessibility_id=Save 15 | 16 | case2-hasid 17 | Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=4.2.2 deviceName=192.168.56.101:5555 app=${CURDIR}${/}app${/}ContactManager.apk appPackage=com.example.android.contactmanager 18 | Click Element accessibility_id=Add Contact 19 | ${source} Get Source 20 | Log ${source} 21 | Sleep 5s 22 | Input Text id=com.example.android.contactmanager:id/contactNameEditText Jacky Qi 23 | Input Text id=com.example.android.contactmanager:id/contactPhoneEditText 13800138000 24 | Input Text id=com.example.android.contactmanager:id/contactEmailEditText qitaos@gmail.com 25 | Click Element accessibility_id=Save 26 | -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/ContactManager.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/ContactManager.apk -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/Default-568h@2x.png -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/objects-8.0+.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/objects-8.0+.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/objects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/objects.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/runtime.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/GestureTestViewController.nib/runtime.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/Info.plist -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/TestApp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/TestApp -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects-8.0+.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects-8.0+.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/runtime.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AppiumLibrary-Demo/app/TestApp.app/en.lproj/MyViewControllerViewController.nib/runtime.nib -------------------------------------------------------------------------------- /AppiumLibrary-Demo/iOS-Case.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library AppiumLibrary 3 | 4 | *** Test Cases *** 5 | case1 6 | Open Application http://localhost:4723/wd/hub alias=Myapp1 platformName=iOS platformVersion=9.0 deviceName=iPhone 6 app=${CURDIR}${/}app${/}TestApp.app 7 | Input Text name=TextField1 13 8 | Input Text name=TextField2 22 9 | Click Button Compute Sum 10 | Click Button done 11 | Click Button show alert 12 | Click Button OK 13 | Comment Long Press //UIAApplication[1]/UIAWindow[2]/UIASlider[1] 14 | Swipe 178 356 133 356 15 | Comment contact alert 16 | Comment location alert 17 | Comment disabled button 18 | Comment Test Gesture 19 | Comment Crash 20 | Comment more, symbols 21 | Comment Next keyboard 22 | Comment Dictate 23 | Comment done 24 | -------------------------------------------------------------------------------- /AutoItDemo/CalculatorGUIMap.py: -------------------------------------------------------------------------------- 1 | """ 2 | Package: AutoItLibrary 3 | Module: Test 4 | Purpose: This is a Robot Framework variable file according to the specifications provided here: 5 | http://robotframework.googlecode.com/svn/tags/robotframework-2.1/doc/userguide/RobotFrameworkUserGuide.html#variable-files 6 | It defines a Python dictionary variable "GUIMAP" that is used by the AutoItLibrary Robot 7 | Framework tests to map useful Windows Calculator GUI object names (such as the keypad keys) to 8 | their underlying Windows GUI object names required by AutoIt. 9 | 10 | Copyright (c) 2009-2010 Texas Instruments 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. 23 | """ 24 | __author__ = "Martin Taylor " 25 | __version__ = "1.1" 26 | # 27 | # Map logical names of buttons to the implemented names in the Windows Calculator 28 | # GUIMAP_51 is the mapping for Calculator version 5.1 (WinXP version) 29 | # 30 | GUIMAP_51 = {"0" : "Button45", 31 | "1" : "Button44", 32 | "2" : "Button49", 33 | "3" : "Button54", 34 | "4" : "Button43", 35 | "5" : "Button48", 36 | "6" : "Button53", 37 | "7" : "Button42", 38 | "8" : "Button47", 39 | "9" : "Button52", 40 | "/" : "Button57", 41 | "*" : "Button58", 42 | "-" : "Button59", 43 | "+" : "Button60", 44 | "=" : "Button65", 45 | 46 | "Hex" : "Button5", 47 | "Dec" : "Button6", 48 | "Oct" : "Button7", 49 | "Bin" : "Button8", 50 | 51 | "Qword" : "Button14", 52 | "Dword" : "Button15", 53 | "Word" : "Button16", 54 | "Byte" : "Button17", 55 | 56 | "C" : "Button74", 57 | "Clear" : "Button74", 58 | } 59 | # 60 | # GUIMAP_60 is the mapping for Calculator version 6.0 (WinVista version) 61 | # 62 | GUIMAP_60 = {"0" : "Button45", 63 | "1" : "Button44", 64 | "2" : "Button49", 65 | "3" : "Button54", 66 | "4" : "Button43", 67 | "5" : "Button48", 68 | "6" : "Button53", 69 | "7" : "Button42", 70 | "8" : "Button47", 71 | "9" : "Button52", 72 | "/" : "Button57", 73 | "*" : "Button58", 74 | "-" : "Button59", 75 | "+" : "Button60", 76 | "=" : "Button65", 77 | 78 | "Hex" : "Button5", 79 | "Dec" : "Button6", 80 | "Oct" : "Button7", 81 | "Bin" : "Button8", 82 | 83 | "Qword" : "Button14", 84 | "Dword" : "Button15", 85 | "Word" : "Button16", 86 | "Byte" : "Button17", 87 | 88 | "C" : "Button74", 89 | "Clear" : "Button74", 90 | } 91 | # 92 | # GUIMAP_61 is the mapping for Calculator version 6.1 (Win7 version) 93 | # 94 | GUIMAP_61 = {"0" : "Button6", 95 | "1" : "Button5", 96 | "2" : "Button11", 97 | "3" : "Button16", 98 | "4" : "Button4", 99 | "5" : "Button10", 100 | "6" : "Button15", 101 | "7" : "Button3", 102 | "8" : "Button9", 103 | "9" : "Button14", 104 | "/" : "Button20", 105 | "*" : "Button21", 106 | "-" : "Button22", 107 | "+" : "Button23", 108 | "=" : "Button28", 109 | 110 | "Hex" : "Button1", 111 | "Dec" : "Button2", 112 | "Oct" : "Button3", 113 | "Bin" : "Button4", 114 | 115 | "Qword" : "Button5", 116 | "Dword" : "Button6", 117 | "Word" : "Button7", 118 | "Byte" : "Button8", 119 | 120 | "C" : "Button13", 121 | "Clear" : "Button13", 122 | } 123 | # 124 | # Map application-specific names of menu items to the sequence of 125 | # ALT keys used to access these menu items, since the Windows Calculator 126 | # doesn't really use a "Menu" GUI object to implement its menus 127 | # and AutoIt can't see these as GUI objects. 128 | # 129 | # MENUMAP_51 is the mapping for Calculator version 5.1 (WinXP version) 130 | # 131 | MENUMAP_51 = {"View Standard" : "VT", 132 | "View Scientific" : "VS", 133 | "View Decimal" : "VD", 134 | "View Hex" : "VH", 135 | "View Digit grouping" : "VI", 136 | "Edit Copy" : "EC", 137 | "Edit Paste" : "EP", 138 | "Exit" : "{F4}" 139 | } 140 | # 141 | # MENUMAP_60 is the mapping for Calculator version 6.0 (WinVista version) 142 | # 143 | MENUMAP_60 = {"View Standard" : "VT", 144 | "View Scientific" : "VS", 145 | "View Decimal" : "VD", 146 | "View Hex" : "VH", 147 | "View Digit grouping" : "VI", 148 | "Edit Copy" : "EC", 149 | "Edit Paste" : "EP", 150 | "Exit" : "{F4}" 151 | } 152 | # 153 | # MENUMAP_61 is the mapping for Calculator version 6.1 (Win7 version) 154 | # 155 | MENUMAP_61 = {"View Standard" : "VT", 156 | "View Scientific" : "VS", 157 | "View Decimal" : "VD", 158 | "View Hex" : "VP", 159 | "View Digit grouping" : "VI", 160 | "Edit Copy" : "EC", 161 | "Edit Paste" : "EP", 162 | "Exit" : "{F4}" 163 | } 164 | # 165 | # -------------------------------- End of file -------------------------------- 166 | -------------------------------------------------------------------------------- /AutoItDemo/Calculator_Test_Cases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 48 | Calculator Test Cases 49 | 50 | 51 |

Calculator Test Cases

52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
Setting
DocumentationTests the AutoItLibrary by using various AutoIt keywords on the GUI of the Windows Calculator application.
Suite SetupStart Calculator
Suite TeardownStop Calculator
Test SetupClear Calculator
LibraryAutoItLibrary${OUTPUTDIR}10${True}
LibraryCollections
LibraryString
VariablesCalculatorGUIMap.py
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 |
Test Case
Integer Addition[Documentation]Get "The Answer" by addition.
Click Buttons4 1 + 1 =
Win Wait计算器
${Ans} =Get Answer
Should Be Equal As Numbers${Ans}42
Integer Subtraction[Documentation]Get "The Answer" by subtraction.
Click Buttons4 5 - 3 =
Win Wait计算器42
${Ans} =Get Answer
Should Be Equal As Numbers${Ans}42
Integer Multiplication[Documentation]Get "The Answer" by multiplication.
Click Buttons6 * 7 =
Win Wait计算器42
${Ans} =Get Answer
Should Be Equal As Numbers${Ans}42
Integer Division[Documentation]Get "The Answer" by division.
Click Buttons5 4 6 / 1 3 =
Win Wait计算器42
${Ans} =Get Answer
Should Be Equal As Numbers${Ans}42
Hex Addition[Documentation]Test Hex addition.
[Setup]Set Hex Mode
SendDE01F100
Send{+}
SendABCDEF
Send=
Win Wait计算器DEADBEEF
${Ans} =Get Answer
Should Be Equal As Strings${Ans}DEADBEEF
Hex Subtraction[Documentation]Test Hex subtraction.
[Setup]Set Hex Mode
Clip PutDF598CDE
Select Calculator Menu ItemEdit Paste
Win Wait计算器DF598CDE
Send-
Clip PutABCDEF
Select Calculator Menu ItemEdit Paste
Win Wait计算器ABCDEF
Send=
Win Wait计算器DEADBEEF
${Ans} =Get Answer
Should Be Equal As Strings${Ans}DEADBEEF
Test Screen Capture On FAIL[Documentation]Test that a screenshot is taken and included in the report file when an AutoItLibrary keyword fails.\n
449 | This test will always fail.
[Tags]ExpectedFAIL
[Setup]Set Hex Mode
SendDE01F100
Send{+}
SendABCDEF
Send=
Win Wait计算器3
simpleControl Click计算器${EMPTY}Button4
sleep2s
Control Click计算器${EMPTY}Button23
sleep2s
Control Click计算器${EMPTY}Button14
sleep2s
Control Click计算器${EMPTY}Button28
sleep2s
Send{ALTDOWN}
Sleep1
SendEC
Send{ALTUP}
${Answer} =Clip Get
Should Be Equal As Numbers${Answer}13
613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 |
Keyword
Clear Calculator[Documentation]Click the Clear button in the Windows Calculator
Win ActivateCalculator
Click ButtonClear
Start Calculator[Documentation]Start the Windows Calculator application and set the default settings that the rest of the tests expect.
Runcalc.exe
Wait For Active Window计算器
Get Calculator Version
Select Calculator Menu ItemView Scientific
Wait For Active Window计算器
CommentWe want "Digit Grouping" off but there's no way to examine the check beside the menu item. So we need to try recognizing some displayed digits to see if its on or off and then change it if necessary.
Send12345
${Result}${ErrMsg} =Run Keyword And Ignore ErrorWin Wait
...计算器123453
Run Keyword If"${Result}" == "FAIL"Select Calculator Menu ItemView Digit grouping
Win Wait计算器12345
Click ButtonClear
Stop Calculator[Documentation]Shut down the Windows Calculator application.
Win Activate计算器
CommentSelect Calculator Menu ItemExit
Win Close计算器
Click Button[Arguments]${ButtonText}
[Documentation]Click a button by its text name, using the Calculator GUI Map.
${ButtonName} =Get From Dictionary${GUIMAP}${ButtonText}
sleep2s
Control Click计算器${EMPTY}${ButtonName}
Click Buttons[Arguments]${ButtonNames}
[Documentation]Click a sequence of buttons by their text names, using the Calculator GUI Map.\n
823 | Button text names should be separated by white space.
@{Buttons} =Split String${ButtonNames}
: FOR${ButtonName}IN@{Buttons}
Click Button${ButtonName}
Select Calculator Menu Item[Arguments]${MenuItem}
[Documentation]The Windows Calculator application doesn't really use a Windows GUI Menu to implement its menus. Therefore AutoIt can't see the menus as menu GUI objects. The only way to access the Calculator menus is via the ALT key sequences. In Win XP the Calculator menu ALT key letters are underlined, and thus available, all the time. Microsoft, in their wisdom, changed this in Win Vista so that you have to press the ALT key and "wait a bit" before the ALT key letters are underlined on the GUI. When they're not underlined, they don't work. Since AutoIt can send ALT key sequences VERY FAST, a sequence such as !VS (ALT+V+S) doesn't work on Win Vista, while it does work on Win XP. To get around this problem, and to make menu item selection more "tester friendly" we provide this keyword. It takes the name of a menu item as defined in the MENUMAP dictionary in the CalculatorGUIMap.py file. The MENUMAP dictionary items translate the application oriented menu name into the sequence of ALT keys to access that menu item. To make this work on Win XP and Win Vista, this keyword sends the ALT key first, waits a bit, then sends the sequence of keys from the MENUMAP. Complicated, but welcome to the wierd world of Windows GUI testing!
${AltKeys} =Get From Dictionary${MENUMAP}${MenuItem}
Send{ALTDOWN}
Sleep1
Send${AltKeys}
Send{ALTUP}
Get Calculator Version[Documentation]Get the version of the Windows Calculator. Version 5.1 is WinXP, Version 6.1 is Win7.\n
911 | Set the suite variables to match the found version.
Send{ALTDOWN}
Sleep1
Sendha
Send{ALTUP}
Win Wait Active关于“计算器”
${WinText} =Control Get Text关于“计算器”${EMPTY}
...Static3
${WinText2} =Run Keyword If"版本" not in "${WinText}"Control Get Text
...关于“计算器”Static4
${WinText} =Set Variable If"版本" in "${WinText2}"${WinText2}
...${WinText}
Run Keyword If"版本" not in "${WinText}"FailCannot find Calculator version
${GUIMAP} =Set Variable If"5.1" in "${WinText}"${GUIMAP_51}
${GUIMAP} =Set Variable If"6.0" in "${WinText}"${GUIMAP_60}
...${GUIMAP}
${GUIMAP} =Set Variable If"6.1" in "${WinText}"${GUIMAP_61}
...${GUIMAP}
Run Keyword If${GUIMAP} == NoneFailCalculator version not supported: ${WinText}
Set Suite Variable${GUIMAP}
${MENUMAP} =Set Variable If"5.1" in "${WinText}"${MENUMAP_51}
${MENUMAP} =Set Variable If"6.0" in "${WinText}"${MENUMAP_60}
...${MENUMAP}
${MENUMAP} =Set Variable If"6.1" in "${WinText}"${MENUMAP_61}
...${MENUMAP}
Set Suite Variable${MENUMAP}
Control Click关于“计算器”Button1
Set Hex Mode[Documentation]Put the calculator in Hex arithmetic Dword mode.
Select Calculator Menu ItemView Hex
Click ButtonsHex Dword
Sleep1 sec
Get Answer[Documentation]Get the answer via the clipboard, since the control is not accessible in the 6.1 version (it used to be "Edit1" in the 5.1 version).
Select Calculator Menu ItemEdit Copy
${Answer} =Clip Get
[Return]${Answer}
1162 | 1163 | 1164 | -------------------------------------------------------------------------------- /AutoItDemo/__init__.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 48 | Demotrain 49 | 50 | 51 |

Demotrain

52 | 53 | 54 | 55 | 56 |
Setting
57 | 58 | 59 | -------------------------------------------------------------------------------- /AutoItDemo/tests/resource.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Selenium2Library 3 | Library AutoItLibrary 4 | Library OperatingSystem 5 | 6 | *** Keywords *** 7 | 打开网页 8 | Open Browser http://localhost:8000/updown/ ie 9 | 10 | 关闭网页 11 | Close All Browsers 12 | 13 | 关闭对话框 14 | [Arguments] ${title} ${text}= 15 | [Documentation] 关闭对话框 16 | Win Wait ${title} ${text} 30 17 | ${ret}= Control Get Text ${EMPTY} ${EMPTY} Static2 18 | Log ${ret} 19 | Control CLICK ${EMPTY} ${EMPTY} Button1 20 | Comment Win Close ${title} 21 | [Return] ${ret} 22 | 23 | 判断平台 24 | ${sys} Evaluate sys.platform == 'darwin' sys 25 | Pass Execution If '${sys}'=='True' Mac系统不支持该案例 26 | -------------------------------------------------------------------------------- /AutoItDemo/tests/testsuite-alert.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Setup 打开网页 3 | Test Teardown 关闭网页 4 | Library AutoItLibrary 5 | Resource resource.txt 6 | 7 | *** Test Cases *** 8 | 处理对话框 9 | Click Button pay 10 | Sleep 2s 11 | ${mes} Confirm Action 12 | Sleep 2s 13 | Choose Cancel On Next Confirmation 14 | click button paycon 15 | Sleep 2s 16 | ${mes} Confirm Action 17 | Sleep 2s 18 | ${confirm} Get Element Attribute r@innerText 19 | Choose Ok On Next Confirmation 20 | Click Button paycon 21 | Sleep 2s 22 | ${mes} Confirm Action 23 | Sleep 2s 24 | ${confirm} Get Element Attribute r@innerText 25 | 26 | 处理对话框AutoIt 27 | 判断平台 28 | Click Button pay 29 | ${mes} 关闭对话框 来自网页的消息 30 | Sleep 3s 31 | Click Button paycon 32 | ${mes} 关闭对话框 来自网页的消息 33 | Sleep 2s 34 | ${confirm} Get Element Attribute r@innerText 35 | -------------------------------------------------------------------------------- /AutoItDemo/tests/testsuite-updown.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Setup 打开网页 3 | Test Teardown 关闭网页 4 | Library AutoItLibrary 5 | Resource resource.txt 6 | 7 | *** Test Cases *** 8 | upload-case 9 | Choose File file ${CURDIR}${/}text.rar 10 | ${file} Get Value file 11 | Sleep 3s 12 | 13 | upload-autoit 14 | 判断平台 15 | Sleep 5 16 | ${TITLE} Get Title 17 | ${cx} Get Horizontal Position choose 18 | ${cy} Get Vertical Position choose 19 | Comment mouse move ${cx} ${cy} 20 | ${conx} control Get Pos X \ \ Internet Explorer_Server1 21 | ${cony} control Get Pos Y \ \ Internet Explorer_Server1 22 | Comment mouse move ${conx} ${cony} 23 | ${ix} win Get Pos X ${TITLE} 24 | ${iy} win Get Pos Y ${TITLE} 25 | ${mx} Evaluate int(${cx})+int(${ix})+int(${conx})+18 26 | ${my} Evaluate int(${cy})+int(${iy})+int(${cony})+38 27 | Sleep 2 28 | Comment mouse move ${mx} ${my} 29 | Mouse Click LEFT ${mx} ${my} 30 | Win Wait 选择要加载的文件 \ 20 31 | Win Activate 选择要加载的文件 32 | Control Set Text \ \ Edit1 ${CURDIR}${/}text.rar 33 | Sleep 2 34 | Control Click \ \ Button1 35 | Sleep 3 36 | ${filepath} Get Element Attribute r@innerText 37 | 38 | download-case 39 | 判断平台 40 | Sleep 3s 41 | Click Link 下载测试 42 | Sleep 3s 43 | Win Wait 文件下载 \ 15 44 | Win Activate 文件下载 45 | Control Click \ \ Button2 46 | Sleep 3s 47 | Win Wait 另存为 \ 15 48 | Win Activate 另存为 49 | Control Set Text \ \ Edit1 ${CURDIR}${/}text2.rar 50 | Control Click \ \ Button1 51 | Sleep 3s 52 | ${confirm} Win Exists 确认另存为 53 | Run Keyword If ${confirm}==1 Win Activate 确认另存为 54 | Run Keyword If ${confirm}==1 Control Click \ \ Button1 55 | Sleep 4s 56 | Win Wait 下载完毕 57 | Win Activate 下载完毕 58 | Win Close 下载完毕 59 | Sleep 2s 60 | -------------------------------------------------------------------------------- /AutoItDemo/tests/text.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AutoItDemo/tests/text.rar -------------------------------------------------------------------------------- /AutoItDemo/tests/text2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/AutoItDemo/tests/text2.rar -------------------------------------------------------------------------------- /DatabaseDemo/Database-sqlite.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library DatabaseLibrary 3 | 4 | *** Test Cases *** 5 | sqlite3-test1 6 | Connect To Database Using Custom Params sqlite3 '${CURDIR}${/}demo.db' #CREATE TABLE order_item(id integer primary key, name text, quantity integer) 7 | Comment ${a} Delete All Rows From Table order_item 8 | ${table} Query select * from sqlite_master where type = 'table' 9 | ${a} Row Count select * from order_item where name='范德萨防守打法撒' 10 | Comment ${a} description select * from order_item 11 | ${id} Query select max(id)+1 from order_item 12 | ${id} Evaluate '${id}'.replace('None','1') 13 | ${id} Evaluate ${id} 14 | ${d} Execute Sql String insert into order_item values (${id[0][0]},'product${id[0][0]}', ${id[0][0]}) 15 | ${ao} Query select * from order_item 16 | Log Many ${ao[-1]} 17 | ${check1} Run Keyword And Ignore Error Check If Not Exists In Database select * from order_item where id=1 18 | ${check2} Run Keyword And Ignore Error Check If Exists In Database select * from order_item where id=10000 19 | Comment ${a} Delete All Rows From Table order_item 20 | Disconnect From Database 21 | 22 | sqlite3-test2 23 | Connect To Database Using Custom Params sqlite3 '${CURDIR}${/}demo.db' 24 | ${id} Query select * from order_item 25 | Log ${id[0][1]} 26 | Disconnect From Database 27 | -------------------------------------------------------------------------------- /DatabaseDemo/database.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library DatabaseLibrary 3 | 4 | *** Test Cases *** 5 | oracle-test1 6 | Connect To Database Using Custom Params cx_Oracle 'pub_test', 'pub_test', 'd0cfs' 7 | ${row} Row Count select * from pubtest_pa18infor_mas 8 | @{rs} Execute Sql String begin pub_test.pkg_test_cgi.proc_cgi_proRpyPlan(); end; 9 | Log many @{rs} 10 | ${row} Row Count select * from pubtest_pa18infor_mas 11 | Disconnect From Database 12 | 13 | oracle-test2 14 | Connect To Database Using Custom Params cx_Oracle 'pub_test', 'pub_test', ' (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=d0cfs.dbdev.paic.com.cn)(Port=1526))(CONNECT_DATA=(SID=d0cfs)))' 15 | @{rs} Query select * from pubtest_pa18infor_mas 16 | Log many @{rs} 17 | Log @{rs}[0][0] 18 | ${num} Query select gen_num(6) from dual 19 | Log ${num[0][0]} 20 | Disconnect From Database 21 | 22 | *** Keywords *** 23 | 数据库 24 | [Arguments] ${user}='pub_test' ${pass}='pub_test' ${tsn}='d0cfs' 25 | Connect To Database Using Custom Params cx_Oracle ${user}, ${pass}, ${tsn} 26 | @{rs} Execute Sql String begin pub_test.pkg_test_cgi.proc_cgi_proRpyPlan(); end; 27 | Log many @{rs} 28 | Disconnect From Database 29 | -------------------------------------------------------------------------------- /DatabaseDemo/demo.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/DatabaseDemo/demo.db -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rf-demos 2 | 这里放了目前演示的一些自动化测试案例的例子,包含演示需要用到的demo。 3 | 4 | # demo-website 5 | 这是demo网站,首先需要安装flask 6 | 7 | 1. pip安装 8 | 9 | 如果使用pip安装会比较方便,特别是在mac电脑上,为了保证例子能正常运行,大家需要安装四个东东,flask、flask-httpauth、flask_restful、python-simplexml。感谢群友“飞一会”指出缺失的库。 10 | 只需要运行如下命令 11 | 12 | ``` 13 | #mac 14 | sudo pip install flask 15 | sudo pip install flask-httpauth 16 | sudo pip install flask_restful 17 | sudo pip install python-simplexml 18 | #windows 19 | pip install flask 20 | pip install flask-httpauth 21 | pip install flask_restful 22 | pip install python-simplexml 23 | ``` 24 | 25 | 2. setuptools安装 26 | 27 | 如果你的pip不好用或者网络受限制,那么只能下载单独的源码包进行安装。 28 | 29 | 下面这些都可以在https://pypi.python.org/pypi/ 上面找到,而且甚至不用搜索,直接在pypi后加上库名字即可。例如flask,他的地址在https://pypi.python.org/pypi/flask ,下载源码后解压缩,进入解压缩目录,输入命令: 30 | 31 | ``` 32 | #mac 33 | sudo python setup.py install 34 | 35 | #windows 36 | python setup.py install 37 | 38 | ``` 39 | 40 | 下面列的这些都是需要下载下来手动安装的(缩进是表明依赖关系)。如果觉得很麻烦还是去搞pip安装吧。 41 | 42 | * flask 43 | * Werkzeug 44 | * Jinja2 45 | * MarkupSafe 46 | * itsdangerous 47 | * click 48 | * flask-httpauth 49 | * flask_restful * aniso8601 * six * pytz * python-simplexml 50 | 51 | 52 | 3. 启动demo网站 53 | 54 | 启动网站服务的命令是 55 | 56 | ``` 57 | python flaskdemo.py 58 | ``` 59 | 60 | 运行成功后会看到如下提示: 61 | 62 | ``` 63 | * Running on http://127.0.0.1:8000/ (Press CTRL+C to quit) 64 | * Restarting with stat 65 | ``` 66 | 67 | 4. 打开网站 68 | 69 | 打开http://127.0.0.1:8000/ 或者 http://localhost:8000/ 就可以看到页面了。 70 | 71 | 5. 目录结构 72 | 73 | - - - 74 | 75 | fencengDemo:web测试案例分层的demo案例。 76 | * 需要启动demo网站后才可运行 77 | 78 | - - - 79 | 80 | AutoItDemo:AutoItLibrary的demo案例。 81 | * Calculator Test Cases是AutoItLibrary官方的demo,只能值Windows下运行。我修改成中文Windows可以运行,如果是英文Windows可以直接找原版demo运行。 82 | * test目录是结合Selenium2Library的web测试案例(包括对话框处理和上传下载)。所有案例在windows下都可以运行,在Mac上只有2个Suite的第一个案例可以运行,其他案例在Mac上也会pass,但是会提示"Mac系统不支持该案例"。在Mac上运行之前要修改一下“打开网页”里面使用的浏览器。 83 | * test的案例需要启动demo网站后才可运行 84 | 85 | - - - 86 | 87 | DatabaseDemo:DatabaseLibrary的demo案例。 88 | * oracle案例运行不了,需要你有oracle环境并且安装了cx_Oracle,同时也要修改sql脚本为你的表 89 | * sqlite3案例可以直接运行。 90 | 91 | - - - 92 | 93 | RequestsDemo:RequestsLibrary的demo案例,需要启动demo网站后才可运行 94 | 95 | - - - 96 | 97 | rf-video:录制了2个视频,一个是AutoIt的视频,一个是Oracle数据库的视频。不过放在github上太大了,影响大家下载案例,所以我放到其他地方了,http://share.weiyun.com/0e5cee9ac473925263fe9432743826a6 98 | 99 | - - - 100 | 101 | rf-book-case:是正在写的robotframework的书里的里的例子 102 | 103 | - - - 104 | 105 | Selenium2Library-demo:Selenium2Library的demo案例,默认是ie打开,如果使用其他浏览器请自行修改。需要启动demo网站后才可运行。 106 | 107 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/1-Convert.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | ${a} Set Variable 100 4 | ${integer} Convert To Integer ${a} 5 | ${number} Convert To Number ${a} 6 | ${binary} Convert To Binary ${a} 7 | ${octal} Convert To Octal ${a} 8 | ${hex} Convert To Hex ${a} 9 | ${string} Convert To String ${a} 10 | ${bytes} Convert To Bytes ${a} 11 | ${boolean} Convert To Boolean ${a} 12 | 13 | Case2 14 | ${a} Set Variable 100 15 | ${integer} Convert To Integer ${a} 2 16 | ${binary} Convert To Binary ${a} 8 17 | ${octal} Convert To Octal ${a} 16 18 | ${hex} Convert To Hex ${a} 10 19 | ${string} Convert To String ${a} 20 | ${bytes} Convert To Bytes ${a} 21 | ${boolean} Convert To Boolean ${a} 22 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/2-Verify.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | Fail 停止当前Case 4 | Log 不会打印 5 | 6 | Case2 7 | Fatal Error 停止所有Case 8 | Log 后面的案例都会停止 9 | 10 | Case3 11 | Should Not Be Empty A 12 | Should Be Empty ${EMPTY} 13 | Should Not Be True 0 14 | Should Be True 1 15 | Should Not Be Equal 1 2 16 | Should Be Equal 2 2 17 | Should Be Equal As Integers 3 3 18 | Should Not Be Equal As Integers 4 5 19 | Should Be Equal As Numbers 4.0 4 20 | Should Not Be Equal As Numbers 4.1 4.2 21 | Should Be Equal As Strings ab ab 22 | Should Not Be Equal As Strings A B 23 | Should Start With HELLO HE 24 | Should Not Start With HELLO LLO 25 | Should End With HELLO LO 26 | Should Not End With HELLO L 27 | Should Contain HELLO L 28 | Should Not Contain HELLO X 29 | Should Contain X Times HELLO L 2 30 | Should Match AAAB A*B 31 | Should Not Match AA3 A?B 32 | Should Match Regexp 2 \\d 33 | Should Not Match Regexp a \\d 34 | 35 | Case4 36 | ${count} Get Count hello world o 37 | @{list} Create List 1 2 38 | ${len} Get Length ${list} 39 | Length Should Be ${list} ${len} 40 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/3-Variables.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | ${var} Set Variable a 4 | ${var2} Set Variable If '${var}'<> '0' 9 5 | Set Test Variable ${testvar} test 6 | Set Suite Variable ${suitevar} suite 7 | Set Global Variable ${globalvar} global 8 | ${getvar} Get Variables 9 | ${varval} Get Variable Value ${var} 10 | ${varval} Get Variable Value ${var3} ${var2} 11 | Log Variables 12 | Variable Should Exist ${testvar} 13 | Variable Should Not Exist ${qtvar} 14 | ${globalvar} Replace Variables ${testvar} 15 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/4-RunKeyword.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | ${var} Set Variable log 4 | Run Keyword ${var} abc 5 | Run Keywords ${var} abc 6 | ... AND ${var} EFG 7 | Run Keyword If '${var}' == 'log' ${var} iflog 8 | Run Keyword Unless '${var}' == 'test' ${var} unless 9 | Run Keyword And Ignore Error Fail ignore 10 | ${status} Run Keyword And Return Status kw1 selenium 11 | Run Keyword And Continue On Failure Fail 12 | Run Keyword And Expect Error * Fail 13 | Repeat Keyword 2 kw1 repeat 14 | Wait Until Keyword Succeeds 30s 5s kw1 15 | 16 | *** Keywords *** 17 | kw1 18 | [Arguments] ${input}= 19 | log ${input} 20 | [Return] ${input} 21 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/5-Control.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | :FOR ${in} IN RANGE 5 4 | \ log ${in} 5 | \ Run Keyword If ${in} == 3 Continue For Loop 6 | \ log cfloop=${in} 7 | :FOR ${in} IN RANGE 5 8 | \ log ${in} 9 | \ Continue For Loop If ${in} == 2 10 | \ log cfloopif=${in} 11 | :FOR ${in} IN RANGE 5 12 | \ log ${in} 13 | \ Run Keyword If ${in} == 3 Exit For Loop 14 | \ log exitloop=${in} 15 | :FOR ${in} IN RANGE 5 16 | \ log ${in} 17 | \ Exit For Loop If ${in} == 2 18 | \ log exitloopif=${in} 19 | Pass Execution pass后面的不会执行 20 | Pass Execution If 21 | 22 | Case2 23 | @{LIST} Create List bbb baz 24 | ${index} = Find-Index baz @{LIST} 25 | Should Be Equal ${index} ${1} 26 | ${index} = Find-Index non existing @{LIST} 27 | Should Be Equal ${index} ${-1} 28 | Log ${index} 29 | 30 | *** Keywords *** 31 | Find-Index 32 | [Arguments] ${element} @{items} 33 | ${index} = Set Variable ${0} 34 | : FOR ${item} IN @{items} 35 | \ Run Keyword If '${item}' == '${element}' Return From Keyword ${index} 36 | \ ${index} = Set Variable ${index + 1} 37 | Run Keyword And Return kw2 ${-1} 38 | 39 | kw2 40 | [Arguments] ${t} 41 | log ${t} 42 | [Return] ${t} 43 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/6-Misc.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Case1 3 | No Operation 4 | Sleep 2s 5 | ${cate} Catenate hello world 6 | Comment 这是注释 7 | Set Log Level trace 8 | Log log文本 9 | Log Many a b c 10 | Log To Console console 11 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.2-BuiltIn/7-Evaluate.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Test Cases *** 4 | 随机数 5 | ${num} Evaluate random.randint(0,10000) random 6 | 7 | 随机字符串 8 | ${str} Evaluate string.ascii_uppercase string 9 | ${strlen} Evaluate len('${str}') 10 | ${len} Get Length ${str} 11 | ${num} Set Variable 4 12 | ${newstr} Set Variable ${EMPTY} 13 | : FOR ${index} IN RANGE ${num} 14 | \ ${i} Evaluate random.randint(0,int(${len})-1)+1 random 15 | \ ${temp} Set Variable ${str[int(${i})-1]} 16 | \ ${newstr} Set Variable ${newstr}${temp} 17 | Log ${newstr} 18 | 19 | 字符串处理 20 | ${str} Set Variable \ \ hello world \ \ 21 | Log =${str}= 22 | ${str} Evaluate '${str}'.strip() 23 | Log =${str}= 24 | ${str} Evaluate '${str}'.replace('o','h') 25 | ${str} Evaluate '${str}'.replace(' ','') 26 | ${urlA} Set Variable http://www.baidu.com 27 | ${urlB} Set Variable more 28 | ${url} Evaluate string.join(['${urlA}','${urlB}'],'/') string 29 | 30 | 中文处理 31 | ${utf8} Set Variable u'\\u4e2d\\u6587' 32 | ${utf8cn2} Evaluate ${utf8} 33 | ${gbk} Set Variable \\xd6\\xd0\\xce\\xc4 34 | ${gbkcn2} Evaluate '${gbk}'.decode('gbk') 35 | ${a} Set Variable 中文 36 | ${utf8} Evaluate '${a}'.decode('utf-8') 37 | ${utf8cn} Evaluate u'${utf8}' 38 | ${utflist} Create List ${a} 39 | ${gbk} Evaluate '${a}'.decode('utf-8').encode('gbk') 40 | ${gbkcn} Evaluate '${gbk}'.decode('gbk') 41 | 42 | 正则表达式 43 | ${rm} Set Variable paic-2.523.6-90 44 | ${subn} Evaluate re.subn('[^\\w]','_','${rm}') re 45 | Log ${subn[0]} 46 | ${sub} Evaluate re.sub('[\\d]','*','${rm}') re 47 | ${findnumber} Evaluate re.findall('\\d','${rm}') re 48 | ${findnumbers} Evaluate re.findall('\\d+','${rm}') re 49 | 50 | 日期处理 51 | ${ymd} Get Time year month day NOW-1day 52 | ${gettime} Get Time year month day 2014-10-15 53 | ${year} ${month} ${day} Set Variable ${gettime} 54 | ${addDays} Set Variable -1 55 | ${newDate} Evaluate datetime.date(int('${year}'),int('${month}'),int('${day}'))+datetime.timedelta(days=int('${addDays}')) datetime 56 | ${newYMD} Evaluate '${newDate}'.split('-') 57 | ${newTime} Evaluate time.strftime("%Y-%m-%d-%H-%M-%S") time 58 | 59 | 执行命令 60 | ${sys} Evaluate sys.platform sys 61 | Pass Execution If '${sys}' <> 'darwin' 非Mac系统请自己修改命令 62 | ${cmd} Evaluate os.system(r'mkdir qttest') os 63 | ${cmd} Evaluate os.system(r'ls') os 64 | ${cmd} Evaluate os.system(r'rm -rf qttest') os 65 | ${cmd} Evaluate os.system(r'test') os 66 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.3-String/string.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library String 3 | 4 | *** Test Cases *** 5 | Case1-Convert 6 | ${str} Set Variable Hello World 7 | ${lower} Convert To Lowercase ${str} 8 | ${upper} Convert To Uppercase ${str} 9 | ${a} Set Variable 中文 10 | ${utf8} Encode String To Bytes ${a} UTF-8 11 | ${gbk} Encode String To Bytes ${a} GBK 12 | ${utf8cn} Decode Bytes To String ${utf8} UTF-8 13 | ${gbkcn} Decode Bytes To String ${gbk} GBK 14 | 15 | Case2-Line 16 | ${str} Set Variable hello\nworld\nqitao\nrobot 17 | ${linecount} Get Line Count ${str} 18 | ${lines} Split To Lines ${str} 19 | ${line} Get Line ${str} 1 20 | ${linecontain} Get Lines Containing String ${str} t 21 | ${lines} Split To Lines ${linecontain} 22 | 23 | Case3-String 24 | ${str} Set Variable hello world qitaos 25 | ${replace} Replace String ${str} o h 26 | ${remove} Replace String ${str} wo ${EMPTY} 27 | ${remove} Remove String ${str} wo 28 | ${split} Split String ${str} 29 | ${splitright} Split String From Right ${str} \ 1 30 | ${splitchar} Split String To Characters ${str} 31 | ${fetchright} Fetch From Right ${str} o 32 | ${fetchleft} Fetch From Left ${str} o 33 | ${sub} Get Substring ${str} 6 34 | Log ${str[6:]} 35 | ${gen} Generate Random String 4 [UPPER] 36 | 37 | Backup-AllKw 38 | Comment Convert To Lowercase 39 | Comment Convert To Uppercase 40 | Comment Encode String To Bytes 41 | Comment Decode Bytes To String 42 | Comment 43 | Comment Get Line Count 44 | Comment Split To Lines 45 | Comment Get Line 46 | Comment Get Lines Containing String 47 | Comment Get Lines Matching Pattern 48 | Comment Get Lines Matching Regexp 49 | Comment 50 | Comment Replace String 51 | Comment Replace String Using Regexp 52 | Comment Remove String 53 | Comment Remove String Using Regexp 54 | Comment Split String 55 | Comment Split String From Right 56 | Comment Split String To Characters 57 | Comment Fetch From Right 58 | Comment Fetch From Left 59 | Comment Generate Random String 60 | Comment Get Substring 61 | Comment 62 | Comment Should Be String 63 | Comment Should Not Be String 64 | Comment Should Be Unicode String 65 | Comment Should Be Byte String 66 | Comment Should Be Lowercase 67 | Comment Should Be Uppercase 68 | Comment Should Be Titlecase 69 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.4-Collections/Collections.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Collections 3 | 4 | *** Test Cases *** 5 | Case1-List 6 | ${tuple} Evaluate (u'a',u'b',u'c',u'd') 7 | ${conlist} Convert To List ${tuple} 8 | Log ${conlist[2]} 9 | Append To List ${conlist} e f 10 | Log ${conlist} 11 | Insert Into List ${conlist} 1 q 12 | Log ${conlist} 13 | ${combineList} Combine Lists ${conlist} ${conlist[2:5]} 14 | Set List Value ${conlist} 0 w 15 | Log ${conlist} 16 | Remove Values From List ${conlist} d e 17 | Log ${conlist} 18 | Remove From List ${conlist} 0 19 | Log ${conlist} 20 | ${combineList} Remove Duplicates ${combineList} 21 | ${get} Get From List ${conlist} -1 22 | ${getslice} Get Slice From List ${conlist} 1 23 | ${count} Count Values In List ${conlist} b 24 | ${getindex} Get Index From List ${conlist} f 25 | ${copy} Copy List ${combineList} 26 | Reverse List ${combineList} 27 | Log List ${combineList} 28 | Sort List ${combineList} 29 | Log List ${combineList} 30 | 31 | Case2-Dict 32 | ${dict} Create Dictionary a=1 b=2 33 | Set To Dictionary ${dict} a=3 c=4 34 | Log Dictionary ${dict} 35 | ${keys} Get Dictionary Keys ${dict} 36 | ${values} Get Dictionary Values ${dict} 37 | ${items} Get Dictionary Items ${dict} 38 | ${get} Get From Dictionary ${dict} a 39 | Remove From Dictionary ${dict} a 40 | Log ${dict} 41 | Keep In Dictionary ${dict} b 42 | Log ${dict} 43 | 44 | Backup-Allkw 45 | Comment Convert To List 46 | Comment Append To List 47 | Comment Insert Into List 48 | Comment Combine Lists 49 | Comment Set List Value 50 | Comment Remove Values From List 51 | Comment Remove From List 52 | Comment Remove Duplicates 53 | Comment Get From List 54 | Comment Get Slice From List 55 | Comment Count Values In List 56 | Comment Get Index From List 57 | Comment Copy List 58 | Comment Reverse List 59 | Comment Sort List 60 | Comment List Should Contain Value 61 | Comment List Should Not Contain Value 62 | Comment List Should Not Contain Duplicates 63 | Comment Lists Should Be Equal 64 | Comment List Should Contain Sub list 65 | Comment Log List 66 | Comment Create Dictionary 67 | Comment Set To Dictionary 68 | Comment Remove From Dictionary 69 | Comment Keep In Dictionary 70 | Comment Get Dictionary Keys 71 | Comment Get Dictionary Values 72 | Comment Get Dictionary Items 73 | Comment Get From Dictionary 74 | Comment Dictionary Should Contain Key 75 | Comment Dictionary Should Not Contain Value 76 | Comment Dictionary Should Not Contain Key 77 | Comment Dictionary Should Contain Item 78 | Comment Dictionary Should Contain Value 79 | Comment Dictionaries Should Be Equal 80 | Comment Dictionary Should Contain Sub Dictionary 81 | Comment Log Dictionary 82 | Comment Should Contain Match 83 | Comment Should Not Contain Match 84 | Comment Get Matches 85 | Comment Get Match Count 86 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.5-OperatingSystem/OperatingSystem.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library OperatingSystem 3 | 4 | *** Test Cases *** 5 | Case1-Env 6 | ${output} Run df -h 7 | ${rc} Run and Return RC df -h 8 | ${rcandoutput} Run and Return RC and Output df -h 9 | ${path} Get Environment Variable PATH 10 | Set Environment Variable TEST ride 11 | ${test} Get Environment Variable TEST 12 | Append To Environment Variable TEST robot 13 | ${envs} Get Environment Variables 14 | Remove Environment Variable TEST 15 | Log Environment Variables 16 | 17 | Case2-File 18 | Create Binary File ${CURDIR}${/}bin.txt \xe4\xb8\xad\xe6\x96\x87 19 | ${bin} Get Binary File ${CURDIR}${/}bin.txt 20 | Create File ${CURDIR}${/}file.txt 中文内容 21 | ${file} Get File ${CURDIR}${/}file.txt 22 | ${file-size} Get File Size ${CURDIR}${/}file.txt 23 | Append To File ${CURDIR}${/}file.txt \n自动化测试\n测试指南 24 | ${grep} Grep File ${CURDIR}${/}file.txt 测试 25 | Log File ${CURDIR}${/}file.txt 26 | Touch ${CURDIR}${/}touch.txt 27 | Move File ${CURDIR}${/}bin.txt ${CURDIR}${/}bin2.txt 28 | Comment Move Files 29 | Copy File ${CURDIR}${/}bin2.txt ${CURDIR}${/}touch.txt 30 | Comment Copy Files 31 | Remove File ${CURDIR}${/}bin2.txt 32 | Remove Files ${CURDIR}${/}touch.txt ${CURDIR}${/}file.txt 33 | 34 | Case3-Directory 35 | Create Directory ${CURDIR}${/}dir1 36 | Touch ${CURDIR}${/}dir1/touch.txt 37 | Create Directory ${CURDIR}${/}dir1${/}subdir 38 | Copy Directory ${CURDIR}${/}dir1 ${CURDIR}${/}dir2 39 | Move Directory ${CURDIR}${/}dir2 ${CURDIR}${/}dir3 40 | Empty Directory ${CURDIR}${/}dir3 41 | ${list} List Directory ${CURDIR} 42 | ${listfile} List Files In Directory ${CURDIR}${/}dir1 43 | ${listdir} List Directories In Directory ${CURDIR}${/}dir1 44 | ${countitem} Count Items In Directory ${CURDIR}${/}dir1 45 | ${countfile} Count Files In Directory ${CURDIR}${/}dir1 46 | ${countdir} Count Directories In Directory ${CURDIR} 47 | Remove Directory ${CURDIR}${/}dir3 48 | Empty Directory ${CURDIR}${/}dir1 49 | Remove Directory ${CURDIR}${/}dir1 50 | 51 | Case4-Path 52 | ${path} Join Path ${CURDIR} test 53 | ${paths} Join Paths ${CURDIR} /usr test 54 | ${normalpath} Normalize Path ${CURDIR}..${/}7.3-String 55 | ${split} Split Path ${CURDIR} 56 | ${split} Split Extension ${CURDIR}${/}sample.txt 57 | ${time} Get Modified Time ${CURDIR} 58 | Set Modified Time ${CURDIR}${/}sample.txt NOW - 1day 59 | ${time} Get Modified Time ${CURDIR}${/}sample.txt 60 | 61 | Backup-Allkw 62 | Comment Run 63 | Comment Run and Return RC 64 | Comment Run and Return RC and Output 65 | Comment Start Process 66 | Comment Switch Process 67 | Comment Read Process Output 68 | Comment Stop Process 69 | Comment Stop All Processes 70 | Comment Get File 71 | Comment Get File Size 72 | Comment Get Binary File 73 | Comment Grep File 74 | Comment Log File 75 | Comment Should Exist 76 | Comment Should Not Exist 77 | Comment File Should Exist 78 | Comment File Should Not Exist 79 | Comment Directory Should Exist 80 | Comment Directory Should Not Exist 81 | Comment Wait Until Removed 82 | Comment Wait Until Created 83 | Comment Directory Should Be Empty 84 | Comment Directory Should Not Be Empty 85 | Comment File Should Be Empty 86 | Comment File Should Not Be Empty 87 | Comment Create File 88 | Comment Create Binary File 89 | Comment Append To File 90 | Comment Remove File 91 | Comment Remove Files 92 | Comment Empty Directory 93 | Comment Create Directory 94 | Comment Remove Directory 95 | Comment Move File 96 | Comment Move Files 97 | Comment Copy File 98 | Comment Copy Files 99 | Comment Copy Directory 100 | Comment Move Directory 101 | Comment Get Environment Variable 102 | Comment Set Environment Variable 103 | Comment Append To Environment Variable 104 | Comment Remove Environment Variable 105 | Comment Environment Variable Should Be Set 106 | Comment Environment Variable Should Not Be Set 107 | Comment Get Environment Variables 108 | Comment Log Environment Variables 109 | Comment Join Path 110 | Comment Join Paths 111 | Comment Normalize Path 112 | Comment Split Path 113 | Comment Split Extension 114 | Comment Get Modified Time 115 | Comment Set Modified Time 116 | Comment List Directory 117 | Comment List Files In Directory 118 | Comment List Directories In Directory 119 | Comment Count Items In Directory 120 | Comment Count Files In Directory 121 | Comment Count Directories In Directory 122 | Comment Touch 123 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.5-OperatingSystem/sample.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/RF-Libraries-Demo/7.5-OperatingSystem/sample.txt -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.6-Process/Process.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Process 3 | 4 | *** Test Cases *** 5 | Case1 6 | ${result} Run Process python -c print "robot" 7 | Log ${result.stdout} 8 | Run Process python -c print "rf" alias=rf 9 | ${presult} Get Process Result rf 10 | Log ${presult.stdout} 11 | Start Process python alias=py1 12 | ${pid} Get Process Id 13 | ${pobj} Get Process Object 14 | ${isrun} Is Process Running py1 15 | Process Should Be Running py1 16 | Send Signal To Process 2 py1 17 | Process Should Be Stopped 18 | Start Process python alias=py2 19 | Start Process ping alias=ping 20 | ${wait} Wait For Process ping 21 | Switch Process py2 22 | Terminate Process ping 23 | Terminate All Processes 24 | 25 | Backup-Allkw 26 | Comment Run Process 27 | Comment Start Process 28 | Comment Is Process Running 29 | Comment Process Should Be Running 30 | Comment Process Should Be Stopped 31 | Comment Wait For Process 32 | Comment Terminate Process 33 | Comment Terminate All Processes 34 | Comment Send Signal To Process 35 | Comment Get Process Id 36 | Comment Get Process Object 37 | Comment Get Process Result 38 | Comment Switch Process 39 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.7-XML/XML.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library XML 3 | 4 | *** Test Cases *** 5 | Case1 6 | ${XML} Parse Xml test 7 | ${element} Get Element ${XML} robot 8 | Element To String ${element} 9 | Add Element ${XML} qitao 10 | Log Element ${XML} 11 | ${elements} Get Elements ${XML} . 12 | Log Element ${elements[0]} 13 | ${child} Get Child Elements ${XML} 14 | ${count} Get Element Count ${XML} auto 15 | ${text} Get Element Text ${XML} auto 16 | Comment Get Elements Texts 17 | ${attr} Get Element Attribute ${XML} id auto 18 | Comment Get Element Attributes 19 | Set Element Attribute ${XML} id 8 auto 20 | Log Element ${XML} 21 | Set Element Tag ${XML} rf robot 22 | Log Element ${XML} 23 | Set Element Text ${XML} settext xpath=rf 24 | Log Element ${XML} 25 | Save Xml ${XML} ${CURDIR}${/}save.xml 26 | ${copy} Copy Element ${XML} 27 | Remove Element ${XML} rf 28 | Log Element ${XML} 29 | Remove Element Attribute ${XML} id auto 30 | Log Element ${XML} 31 | Clear Element ${XML} 32 | Log Element ${XML} 33 | Comment Evaluate Xpath ${XML} count(xml/*) 34 | 35 | Backup-Allkw 36 | Comment Parse Xml 37 | Comment Get Element 38 | Comment Get Elements 39 | Comment Get Element Count 40 | Comment Get Element Text 41 | Comment Get Elements Texts 42 | Comment Get Element Attribute 43 | Comment Get Element Attributes 44 | Comment Get Child Elements 45 | Comment Element Attribute Should Be 46 | Comment Element Attribute Should Match 47 | Comment Element Should Exist 48 | Comment Element Should Not Exist 49 | Comment Element Should Not Have Attribute 50 | Comment Element Text Should Be 51 | Comment Element Text Should Match 52 | Comment Element To String 53 | Comment Elements Should Be Equal 54 | Comment Elements Should Match 55 | Comment Set Element Attribute 56 | Comment Set Element Tag 57 | Comment Set Element Text 58 | Comment Set Elements Attribute 59 | Comment Set Elements Tag 60 | Comment Set Elements Text 61 | Comment Remove Element 62 | Comment Remove Element Attribute 63 | Comment Remove Element Attributes 64 | Comment Remove Elements 65 | Comment Remove Elements Attribute 66 | Comment Remove Elements Attributes 67 | Comment Clear Element 68 | Comment Copy Element 69 | Comment Log Element 70 | Comment Save Xml 71 | Comment Evaluate Xpath 72 | Comment Add Element 73 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.7-XML/save.xml: -------------------------------------------------------------------------------- 1 | 2 | settextqitao -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/DateTime.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library DateTime 3 | 4 | *** Test Cases *** 5 | Case1 6 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/Dialog.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Dialogs 3 | 4 | *** Test Cases *** 5 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/Remote.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Remote http://${ADDRESS}:${PORT} 3 | 4 | *** Variables *** 5 | ${ADDRESS} 127.0.0.1 6 | ${PORT} 7777 7 | 8 | *** Test Cases *** 9 | Count Items in Directory 10 | ${items1} = Count Items In Directory ${CURDIR} 11 | ${items2} = Count Items In Directory ${TEMPDIR} 12 | Log ${items1} items in '${CURDIR}' and ${items2} items in '${TEMPDIR}' 13 | 14 | Failing Example 15 | Strings Should Be Equal Hello Hello 16 | Strings Should Be Equal not equal 17 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/Screenshot.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Screenshot 3 | 4 | *** Test Cases *** 5 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/Telnet.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Telnet 3 | 4 | *** Test Cases *** 5 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/7.8-Others/examplelibrary.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | 5 | 6 | class ExampleRemoteLibrary(object): 7 | 8 | """Example library to be used with Robot Framework's remote server. 9 | This documentation is visible in docs generated by `Libdoc`. 10 | """ 11 | def count_items_in_directory(self, path): 12 | """Returns the number of items in the directory specified by `path`.""" 13 | return len([i for i in os.listdir(path) if not i.startswith('.')]) 14 | 15 | def strings_should_be_equal(self, str1, str2): 16 | 17 | print "Comparing '%s' to '%s'." % (str1, str2) 18 | 19 | if not (isinstance(str1, basestring) and isinstance(str2, basestring)): 20 | raise AssertionError("Given strings are not strings.") 21 | if str1 != str2: 22 | raise AssertionError("Given strings are not equal.") 23 | 24 | if __name__ == '__main__': 25 | import sys 26 | from robotremoteserver import RobotRemoteServer 27 | RobotRemoteServer(ExampleRemoteLibrary(), *sys.argv[1:]) 28 | -------------------------------------------------------------------------------- /RF-Libraries-Demo/__init__.robot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/RF-Libraries-Demo/__init__.robot -------------------------------------------------------------------------------- /RequestsDemo/request.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library RequestsLibrary 3 | Library Collections 4 | Library XML 5 | 6 | *** Test Cases *** 7 | case1 8 | Create Session api http://localhost:8000 9 | ${addr} Get Request api users/1 10 | Should Be Equal As Strings ${addr.status_code} 200 11 | Log ${addr.content} 12 | ${responsedata} To Json ${addr.content} 13 | ${keys} Get Dictionary Keys ${responsedata} 14 | ${items} Get Dictionary Items ${responsedata} 15 | ${values} Get Dictionary Values ${responsedata} 16 | ${str} Get From Dictionary ${responsedata} 1 17 | ${addr} Get Request api users/5 18 | Should Be Equal As Strings ${addr.status_code} 404 19 | Log ${addr.content} 20 | ${responsedata} To Json ${addr.content} 21 | ${keys} Get Dictionary Keys ${responsedata} 22 | ${items} Get Dictionary Items ${responsedata} 23 | ${values} Get Dictionary Values ${responsedata} 24 | ${str} Get From Dictionary ${responsedata} message 25 | Delete All Sessions 26 | 27 | case2 28 | Create Session api http://localhost:8000 29 | ${addr} Get Request api hello/qitao 30 | Comment Should Be Equal As Strings ${addr.status_code} 200 31 | Log ${addr.content} 32 | ${responsedata} To Json ${addr.content} 33 | ${keys} Get Dictionary Keys ${responsedata} 34 | ${items} Get Dictionary Items ${responsedata} 35 | ${values} Get Dictionary Values ${responsedata} 36 | ${str} Get From Dictionary ${responsedata} hello 37 | #xml方式 38 | ${dict} Create Dictionary accept=application/xml 39 | ${addr} Get Request api hello/qitao ${dict} 40 | Comment Should Be Equal As Strings ${addr.status_code} 200 41 | Log ${addr.content} 42 | ${responsedata} Set Variable ${addr.content} 43 | ${body} Get Element Text ${responsedata} hello 44 | ${hello} Get Element ${responsedata} hello 45 | Log ${hello.text} 46 | ${responsedata} Add Element ${responsedata} test 47 | ${new} Get Element Attribute ${responsedata} id new 48 | Log ${new} 49 | ${a} Element To String ${responsedata} 50 | Delete All Sessions 51 | 52 | case3 53 | #用户密码 54 | ${auth} Create List ok python 55 | Create Session api http://localhost:8000 \ \ ${auth} 56 | ${addr} Get Request api 401 57 | Comment Should Be Equal As Strings ${addr.status_code} 200 58 | Log ${addr.content} 59 | ${responsedata} To Json ${addr.content} 60 | ${keys} Get Dictionary Keys ${responsedata} 61 | ${items} Get Dictionary Items ${responsedata} 62 | ${values} Get Dictionary Values ${responsedata} 63 | ${str} Get From Dictionary ${responsedata} pass 64 | Delete All Sessions 65 | 66 | case4 67 | ${dict} Create Dictionary Content-Type=application/x-www-form-urlencoded 68 | Create Session api http://localhost:8000 ${dict} 69 | ${data} Create Dictionary username=qitao password=qt 70 | ${addr} Post Request api post data=${data} 71 | Comment Should Be Equal As Strings ${addr.status_code} 200 72 | Log ${addr.content} 73 | Log ${addr.json()} 74 | ${responsedata} To Json ${addr.content} 75 | ${keys} Get Dictionary Keys ${responsedata} 76 | ${items} Get Dictionary Items ${responsedata} 77 | ${values} Get Dictionary Values ${responsedata} 78 | ${str} Get From Dictionary ${responsedata} username 79 | Delete All Sessions 80 | -------------------------------------------------------------------------------- /Selenium2Library-demo/1-browser.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Teardown close all browsers 3 | Library Selenium2Library 4 | 5 | *** Test Cases *** 6 | 切换浏览器 7 | Open Browser http://localhost:8000/ ie local 8 | ${title1} Get Title 9 | Open Browser http://www.baidu.com ie baidu 10 | ${title2} Get Title 11 | Switch Browser local 12 | ${title1} Get Title 13 | Switch Browser baidu 14 | ${title2} Get Title 15 | Close All Browsers 16 | 17 | 选择窗口 18 | Open Browser http://localhost:8000/ ie 19 | Click Button id=pay 20 | Confirm Action 21 | Select Window 付款 22 | Log Source 23 | Close Browser 24 | 25 | 选择frame 26 | Open Browser http://localhost:8000/ ie 27 | Select Frame id=fra 28 | ${list} Get List Items id=buy 29 | Unselect Frame 30 | Log Source 31 | Close Browser 32 | -------------------------------------------------------------------------------- /Selenium2Library-demo/2-elements.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Teardown close all browsers 3 | Library Selenium2Library 4 | 5 | *** Test Cases *** 6 | 文本框操作 7 | Open Browser http://localhost:8000/ ie 8 | Input Text id=ProductName 新产品 9 | ${value} Get Value ProductName 10 | Assign Id To Element name=Quantity Quan 11 | Input Text id=Quan 111 12 | ${qn} Get Value Quan 13 | Close Browser 14 | 15 | 按钮操作 16 | Open Browser http://localhost:8000/ ie 17 | Input Text id=ProductName 新产品 18 | Input Text id=Quantity 111 19 | Click Button id=submitBtn 20 | ${text} Get Text infoBtn 21 | Close Browser 22 | 23 | 获取页面元素值 24 | Open Browser http://localhost:8000/ ie 25 | Input Text id=ProductName 新产品 26 | ${value} Get Value ProductName 27 | Input Text id=Quantity 222 28 | Click Button id=submitBtn 29 | ${textbtn} Get Text submitBtn 30 | ${text} Get Element Attribute Pr@innerText 31 | ${name} Get Element Attribute ProductName@name 32 | Close Browser 33 | 34 | 下拉列表 35 | Open Browser http://localhost:8000/ ie 36 | Select From List selectdemo 第三个元素 37 | ${label} Get Selected List Label selectdemo 38 | Select From List By Index selectdemo 0 39 | ${value} Get Selected List Value selectdemo 40 | Select From List By Value selectdemo item2 41 | ${label} Get Selected List Label selectdemo 42 | Close Browser 43 | 44 | 其他元素操作 45 | Open Browser http://localhost:8000/ ie 46 | Click Element CheckYes 47 | Select Checkbox CheckNo 48 | Unselect Checkbox CheckYes 49 | Press Key CheckNo \\13 50 | ${yes} Get Value CheckYes 51 | Select Radio Button radio1 B 52 | ${radio} Get Element Attribute radioB@checked 53 | ${value} Get Value radioB 54 | Click Link 上传下载demo页面 55 | Sleep 2s 56 | ${title} Get Title 57 | Close Browser 58 | 59 | 表格操作 60 | Open Browser http://localhost:8000/ ie 61 | ${cell} Get Table Cell buy 1 1 62 | ${cell} Get Table Cell buy 1 2 63 | Table Cell Should Contain buy 1 1 产品 64 | Table Cell Should Contain buy 1 2 数量 65 | Close Browser 66 | -------------------------------------------------------------------------------- /Selenium2Library-demo/3-Others.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Test Teardown close all browsers 3 | Library Selenium2Library 4 | 5 | *** Test Cases *** 6 | cookie操作 7 | Open Browser http://localhost:8000/ ie 8 | ${co} Get Cookies 9 | Add Cookie test qitao 10 | Add Cookie robot framework 11 | ${co} Get Cookies 12 | ${value} Get Cookie Value test 13 | Close Browser 14 | 15 | javascript操作 16 | Open Browser http://localhost:8000/ ie 17 | Execute Javascript document.getElementById("infoBtn").disabled=false 18 | Execute Javascript $("#ProductName").val("jquery") 19 | Execute Javascript $("#Quantity").val("123") 20 | Execute Javascript $("#submitBtn").click() 21 | Sleep 5s 22 | ${pr} Execute Javascript return $("#Pr").html() 23 | ${qn} Execute Javascript return $("#Qn").html() 24 | Close Browser 25 | 26 | 截图 27 | Open Browser http://localhost:8000/ ie 28 | Capture Page Screenshot 29 | Select Frame id=fra 30 | Capture Page Screenshot iframe.png 31 | Close Browser 32 | 33 | waiting 34 | Open Browser http://localhost:8000/ ie 35 | Execute Javascript document.getElementById("infoBtn").disabled=false 36 | Execute Javascript $("#ProductName").val("jquery") 37 | Execute Javascript $("#Quantity").val("123") 38 | Execute Javascript $("#submitBtn").click() 39 | Wait Until Page Contains 123 40 | ${pr} Execute Javascript return $("#Pr").html() 41 | ${qn} Execute Javascript return $("#Qn").html() 42 | Close Browser 43 | -------------------------------------------------------------------------------- /TestLibrary/ExampleLibrary/src/ExampleLibrary.py: -------------------------------------------------------------------------------- 1 | #encoding=utf-8 2 | 3 | import string 4 | import random 5 | from robot.api import logger 6 | import logging 7 | import sys 8 | 9 | class ExampleLibrary: 10 | 11 | ROBOT_LIBRARY_SCOPE = 'GLOBAL' 12 | ROBOT_LIBRARY_VERSION = 0.1 13 | ROBOT_LIBRARY_DOC_FORMAT = 'reST' 14 | 15 | def __init__(self, arg = 1): 16 | """Library文档 *斜体* 这个文档用的是reST结构 reStructuredText__. 17 | 18 | __ http://qitaos.github.io 19 | """ 20 | print 'Library arg %s' % arg 21 | pass 22 | 23 | def gen_nums(self, counts): 24 | """生成随机数字字符串. \n 25 | 例子: 26 | | ${a}= | gen nums | 4 | 27 | 这样会返回一个随机4位数字字符串. 比如 '0624','1456'. 28 | """ 29 | s = self._gen_nums(counts) 30 | 31 | print '*INFO* Get random number string: %s' % s 32 | return s 33 | 34 | def _gen_nums(self, counts): 35 | 36 | li = string.digits 37 | s = '' 38 | for n in range(0, int(counts)): 39 | s += li[random.randint(0, len(li) - 1)] 40 | return s 41 | 42 | def arg_demo(self, arg1, arg2= 2, *args): 43 | print 'arg1 %s arg2 %s' % (arg1,arg2) 44 | for arg in args: 45 | sys.__stdout__.write('Got arg %s\n' % arg) 46 | 47 | def freearg_demo(self, **freearg): 48 | for name, value in freearg.items(): 49 | print name, value 50 | 51 | class OtherLibrary: 52 | 53 | def __init__(self): 54 | self._counter = 0 55 | pass 56 | 57 | def count(self): 58 | """用于计数器. Init countNum is 0. 59 | When you call this method it will add 1 by itself. 60 | Example: 61 | | ${a}= | count | 62 | """ 63 | self._counter += 1 64 | logger.debug('self._counter += 1') 65 | return self._counter 66 | 67 | def clear_counter(self): 68 | """clear counter has only a short documentation 69 | Example: 70 | | ${a}= | clear counter | 71 | """ 72 | self._counter = 0 73 | logging.info('self._counter = 0') -------------------------------------------------------------------------------- /TestLibrary/ExampleLibrary/test/acceptance/testExampleLibrary.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library ExampleLibrary 3 | 4 | *** Test Cases *** 5 | case1 6 | Set Log Level DEBUG 7 | ${num} Set Variable 4 8 | ${s} Gen Nums ${num} 9 | ${len} Get Length ${s} 10 | Should Be Equal As Integers ${num} ${len} 11 | @{list} Create List 4 5 12 | Arg Demo 1 3 @{list} 13 | Freearg Demo test=1 aaa=b 14 | -------------------------------------------------------------------------------- /TestLibrary/ExampleLibrary/test/acceptance/testOtherLibrary.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library ExampleLibrary.OtherLibrary 3 | 4 | *** Test Cases *** 5 | case1 6 | ${count} Count 7 | Should Be Equal As Integers ${count} 1 8 | ${count} Count 9 | Should Be Equal As Integers ${count} 2 10 | Clear Counter 11 | ${count} Count 12 | Should Be Equal As Integers ${count} 1 13 | -------------------------------------------------------------------------------- /demo-website/demo.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/demo-website/demo.db -------------------------------------------------------------------------------- /demo-website/demodao.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import sqlite3 as sqlite 4 | 5 | def _dict_factory(cursor, row): 6 | d = {} 7 | d["Quantity"] = row[2] 8 | d["ProductName"] = row[1] 9 | d["Id"] = row[0] 10 | return d 11 | 12 | class Dao(object): 13 | 14 | def __init__(self): 15 | self.con = sqlite.connect("demo.db", check_same_thread=False) 16 | self.con.row_factory = _dict_factory 17 | self.con.execute("create table if not exists order_item(id integer primary key, name text, quantity integer)") 18 | 19 | def addItemToOrder(self, name, quantity): 20 | #con = sqlite.connect("demo.db") 21 | with self.con: 22 | self.con.execute("insert into order_item(name, quantity) values (?, ?)", (name, quantity)) 23 | 24 | def getItemsFromOrder(self): 25 | #con = sqlite.connect("demo.db") 26 | with self.con: 27 | cursor = self.con.cursor() 28 | cursor.execute("select id, name, quantity from order_item order by id") 29 | return cursor.fetchall() 30 | 31 | def delItemFromOrder(self, pid): 32 | #con = sqlite.connect("demo.db") 33 | with self.con: 34 | self.con.execute("delete from order_item where id = ?", (pid,)) 35 | 36 | def removeOrder(self): 37 | #con = sqlite.connect("demo.db") 38 | with self.con: 39 | self.con.execute("drop table if exists order_item") 40 | -------------------------------------------------------------------------------- /demo-website/flaskdemo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from simplexml import dumps 4 | from flask import Flask, jsonify, render_template, request, make_response 5 | from functools import wraps 6 | from flask_restful import Api, Resource 7 | 8 | from demodao import Dao 9 | import time 10 | import atexit 11 | from flask_httpauth import HTTPBasicAuth 12 | auth = HTTPBasicAuth() 13 | 14 | def cleanup(): 15 | return 16 | #db.removeOrder() 17 | 18 | def output_xml(data, code, headers=None): 19 | """Makes a Flask response with a XML encoded body""" 20 | resp = make_response(dumps({'response' :data}), code) 21 | resp.headers.extend(headers or {}) 22 | return resp 23 | 24 | 25 | atexit.register(cleanup) 26 | 27 | app = Flask(__name__) 28 | db = Dao() 29 | 30 | api = Api(app, default_mediatype='application/json') 31 | api.representations['application/xml'] = output_xml 32 | 33 | 34 | class Hello(Resource): 35 | 36 | """ 37 | # you need requests 38 | >>> from requests import get 39 | >>> get('http://localhost:5000/me').content # default_mediatype 40 | 'me' 41 | >>> get('http://localhost:5000/me', headers={"accept":"application/json"}).content 42 | '{"hello": "me"}' 43 | >>> get('http://localhost:5000/me', headers={"accept":"application/xml"}).content 44 | 'me' 45 | """ 46 | 47 | def get(self, entry): 48 | return {'hello': entry} 49 | 50 | 51 | api.add_resource(Hello, '/hello/') 52 | 53 | 54 | 55 | def check_auth(username, password): 56 | """This function is called to check if a username / 57 | password combination is valid. 58 | """ 59 | return username == 'ok' and password == 'python' 60 | 61 | @auth.get_password 62 | def get_password(username): 63 | if username == 'ok': 64 | return 'python' 65 | return None 66 | 67 | 68 | 69 | def authenticate(): 70 | """Sends a 401 response that enables basic auth""" 71 | return Response( 72 | 'Could not verify your access level for that URL.\n' 73 | 'You have to login with proper credentials', 401, 74 | {'WWW-Authenticate': 'Basic realm="Login Required"'}) 75 | 76 | 77 | 78 | def login_required(f): 79 | @wraps(f) 80 | def decorated(*args, **kwargs): 81 | auths = request.authorization 82 | if not auths or not check_auth(auths.username, auths.password): 83 | return authenticate() 84 | return f(*args, **kwargs) 85 | return decorated 86 | 87 | 88 | """@app.before_request 89 | def before_request(): 90 | if request.path != '/': 91 | if not request.headers['content-type'].find('application/json'): 92 | return 'Unsupported Media Type', 415""" 93 | 94 | @app.route('/401/') 95 | @auth.login_required 96 | def unauthorized(): 97 | return make_response(jsonify({'pass': 'Authorized access'}), 200) 98 | #return 'Unauthorized access', 401 99 | 100 | @app.errorhandler(404) 101 | def not_found(error=None): 102 | message = { 103 | 'status': 404, 104 | 'message': 'Not Found: ' + request.url, 105 | } 106 | resp = jsonify(message) 107 | resp.status_code = 404 108 | 109 | return resp 110 | 111 | 112 | @app.route('/') 113 | def index(): 114 | return render_template('index.html') 115 | 116 | @app.route('/updown/') 117 | def updown(): 118 | return render_template('updown.html') 119 | 120 | @app.route('/payfor/') 121 | def payfor(): 122 | return render_template('payfor.html') 123 | 124 | @app.route('/deliver/') 125 | def deliver(): 126 | return render_template('deliver.html') 127 | 128 | @app.route('/iframe/') 129 | def iframe(): 130 | return render_template('iframe.html') 131 | 132 | @app.route('/echo/', methods=['GET']) 133 | def echo(): 134 | pname = request.args.get('ProductName') 135 | pquan = request.args.get('Quantity') 136 | db.addItemToOrder(pname, pquan) 137 | time.sleep(2) 138 | ret_data = db.getItemsFromOrder() 139 | #print ret_data 140 | return jsonify(ProductName=pname, Quantity=pquan, AllProducts=ret_data) 141 | 142 | @app.route('/remove/', methods=['GET']) 143 | def remove(): 144 | pid = request.args.get('Pid') 145 | db.delItemFromOrder(pid) 146 | ret_data = db.getItemsFromOrder() 147 | #print ret_data 148 | return jsonify(AllProducts=ret_data) 149 | 150 | @app.route('/getlist/', methods=['GET']) 151 | def getlist(): 152 | ret_data = db.getItemsFromOrder() 153 | #print ret_data 154 | return jsonify(AllProducts=ret_data) 155 | 156 | @app.route('/post', methods=['POST','GET']) 157 | def posttemp(): 158 | return webapi() 159 | 160 | @app.route('/uri-test', methods=['POST','GET']) 161 | def webapi(): 162 | message = None 163 | 164 | if request.method == 'POST': 165 | message = request.form['username'] 166 | return jsonify({'username':message}) 167 | 168 | #print ret_data 169 | return None 170 | 171 | @app.route('/getrequesttest/', methods=['GET']) 172 | def getrequesttest(): 173 | print request.args 174 | flag = request.args.get('flag') 175 | args1 = request.args.to_dict() 176 | args2 = request.args.to_dict() 177 | args3 = request.args.to_dict() 178 | args1['json1'] = None 179 | args1['测试'] = 111 180 | args2['json2'] = 200 181 | args3['json3'] = 300 182 | if not flag: 183 | args1['x'] = request.args 184 | args2['y'] = request.args 185 | args3['z'] = request.args 186 | ret_data = [args1, args2, args3] 187 | else: 188 | ret_data = {'x':[args1,args2],'y':[args1,args3]} 189 | print ret_data 190 | return jsonify(ret_data) 191 | 192 | @app.route('/postrequesttest', methods = ['POST','GET']) 193 | def postrequesttest(): 194 | message = None 195 | 196 | if request.method == 'POST': 197 | message = request.form['username'] 198 | return jsonify({'username':message}) 199 | if request.method == 'GET': 200 | message = request.args.get('username') 201 | return jsonify({'username':message}) 202 | 203 | #print ret_data 204 | return None 205 | 206 | @app.route('/putrequesttest/', methods=['GET','PUT']) 207 | def putrequesttest(): 208 | print request.args 209 | flag = request.args.get('flag') 210 | args1 = request.args.to_dict() 211 | args2 = request.args.to_dict() 212 | args3 = request.args.to_dict() 213 | args1['json1'] = None 214 | args1['测试'] = 111 215 | args2['json2'] = 200 216 | args3['json3'] = 300 217 | if not flag: 218 | args1['x'] = request.args 219 | args2['y'] = request.args 220 | args3['z'] = request.args 221 | ret_data = [args1, args2, args3] 222 | else: 223 | ret_data = {'x':[args1,args2],'y':[args1,args3]} 224 | print ret_data 225 | return jsonify(ret_data) 226 | 227 | @app.route('/deleterequesttest/', methods=['GET','DELETE']) 228 | def deleterequesttest(): 229 | print request.args 230 | flag = request.args.get('flag') 231 | args1 = request.args.to_dict() 232 | args2 = request.args.to_dict() 233 | args3 = request.args.to_dict() 234 | args1['json1'] = None 235 | args1['测试'] = 111 236 | args2['json2'] = 200 237 | args3['json3'] = 300 238 | if not flag: 239 | args1['x'] = request.args 240 | args2['y'] = request.args 241 | args3['z'] = request.args 242 | ret_data = [args1, args2, args3] 243 | else: 244 | ret_data = {'x':[args1,args2],'y':[args1,args3]} 245 | print ret_data 246 | return jsonify(ret_data) 247 | 248 | 249 | @app.route('/users/', methods = ['GET']) 250 | def api_users(userid): 251 | users = {'1':'john', '2':'steve', '3':'bill'} 252 | 253 | if userid in users: 254 | return jsonify({userid:users[userid]}) 255 | else: 256 | return not_found() 257 | 258 | 259 | if __name__ == '__main__': 260 | app.run(port=8000, debug=True, threaded=True) 261 | -------------------------------------------------------------------------------- /demo-website/static/jquery-ui.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.11.4 - 2015-03-11 2 | * http://jqueryui.com 3 | * Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css 4 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px 5 | * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { 10 | display: none; 11 | } 12 | .ui-helper-hidden-accessible { 13 | border: 0; 14 | clip: rect(0 0 0 0); 15 | height: 1px; 16 | margin: -1px; 17 | overflow: hidden; 18 | padding: 0; 19 | position: absolute; 20 | width: 1px; 21 | } 22 | .ui-helper-reset { 23 | margin: 0; 24 | padding: 0; 25 | border: 0; 26 | outline: 0; 27 | line-height: 1.3; 28 | text-decoration: none; 29 | font-size: 100%; 30 | list-style: none; 31 | } 32 | .ui-helper-clearfix:before, 33 | .ui-helper-clearfix:after { 34 | content: ""; 35 | display: table; 36 | border-collapse: collapse; 37 | } 38 | .ui-helper-clearfix:after { 39 | clear: both; 40 | } 41 | .ui-helper-clearfix { 42 | min-height: 0; /* support: IE7 */ 43 | } 44 | .ui-helper-zfix { 45 | width: 100%; 46 | height: 100%; 47 | top: 0; 48 | left: 0; 49 | position: absolute; 50 | opacity: 0; 51 | filter:Alpha(Opacity=0); /* support: IE8 */ 52 | } 53 | 54 | .ui-front { 55 | z-index: 100; 56 | } 57 | 58 | 59 | /* Interaction Cues 60 | ----------------------------------*/ 61 | .ui-state-disabled { 62 | cursor: default !important; 63 | } 64 | 65 | 66 | /* Icons 67 | ----------------------------------*/ 68 | 69 | /* states and images */ 70 | .ui-icon { 71 | display: block; 72 | text-indent: -99999px; 73 | overflow: hidden; 74 | background-repeat: no-repeat; 75 | } 76 | 77 | 78 | /* Misc visuals 79 | ----------------------------------*/ 80 | 81 | /* Overlays */ 82 | .ui-widget-overlay { 83 | position: fixed; 84 | top: 0; 85 | left: 0; 86 | width: 100%; 87 | height: 100%; 88 | } 89 | .ui-accordion .ui-accordion-header { 90 | display: block; 91 | cursor: pointer; 92 | position: relative; 93 | margin: 2px 0 0 0; 94 | padding: .5em .5em .5em .7em; 95 | min-height: 0; /* support: IE7 */ 96 | font-size: 100%; 97 | } 98 | .ui-accordion .ui-accordion-icons { 99 | padding-left: 2.2em; 100 | } 101 | .ui-accordion .ui-accordion-icons .ui-accordion-icons { 102 | padding-left: 2.2em; 103 | } 104 | .ui-accordion .ui-accordion-header .ui-accordion-header-icon { 105 | position: absolute; 106 | left: .5em; 107 | top: 50%; 108 | margin-top: -8px; 109 | } 110 | .ui-accordion .ui-accordion-content { 111 | padding: 1em 2.2em; 112 | border-top: 0; 113 | overflow: auto; 114 | } 115 | .ui-autocomplete { 116 | position: absolute; 117 | top: 0; 118 | left: 0; 119 | cursor: default; 120 | } 121 | .ui-button { 122 | display: inline-block; 123 | position: relative; 124 | padding: 0; 125 | line-height: normal; 126 | margin-right: .1em; 127 | cursor: pointer; 128 | vertical-align: middle; 129 | text-align: center; 130 | overflow: visible; /* removes extra width in IE */ 131 | } 132 | .ui-button, 133 | .ui-button:link, 134 | .ui-button:visited, 135 | .ui-button:hover, 136 | .ui-button:active { 137 | text-decoration: none; 138 | } 139 | /* to make room for the icon, a width needs to be set here */ 140 | .ui-button-icon-only { 141 | width: 2.2em; 142 | } 143 | /* button elements seem to need a little more width */ 144 | button.ui-button-icon-only { 145 | width: 2.4em; 146 | } 147 | .ui-button-icons-only { 148 | width: 3.4em; 149 | } 150 | button.ui-button-icons-only { 151 | width: 3.7em; 152 | } 153 | 154 | /* button text element */ 155 | .ui-button .ui-button-text { 156 | display: block; 157 | line-height: normal; 158 | } 159 | .ui-button-text-only .ui-button-text { 160 | padding: .4em 1em; 161 | } 162 | .ui-button-icon-only .ui-button-text, 163 | .ui-button-icons-only .ui-button-text { 164 | padding: .4em; 165 | text-indent: -9999999px; 166 | } 167 | .ui-button-text-icon-primary .ui-button-text, 168 | .ui-button-text-icons .ui-button-text { 169 | padding: .4em 1em .4em 2.1em; 170 | } 171 | .ui-button-text-icon-secondary .ui-button-text, 172 | .ui-button-text-icons .ui-button-text { 173 | padding: .4em 2.1em .4em 1em; 174 | } 175 | .ui-button-text-icons .ui-button-text { 176 | padding-left: 2.1em; 177 | padding-right: 2.1em; 178 | } 179 | /* no icon support for input elements, provide padding by default */ 180 | input.ui-button { 181 | padding: .4em 1em; 182 | } 183 | 184 | /* button icon element(s) */ 185 | .ui-button-icon-only .ui-icon, 186 | .ui-button-text-icon-primary .ui-icon, 187 | .ui-button-text-icon-secondary .ui-icon, 188 | .ui-button-text-icons .ui-icon, 189 | .ui-button-icons-only .ui-icon { 190 | position: absolute; 191 | top: 50%; 192 | margin-top: -8px; 193 | } 194 | .ui-button-icon-only .ui-icon { 195 | left: 50%; 196 | margin-left: -8px; 197 | } 198 | .ui-button-text-icon-primary .ui-button-icon-primary, 199 | .ui-button-text-icons .ui-button-icon-primary, 200 | .ui-button-icons-only .ui-button-icon-primary { 201 | left: .5em; 202 | } 203 | .ui-button-text-icon-secondary .ui-button-icon-secondary, 204 | .ui-button-text-icons .ui-button-icon-secondary, 205 | .ui-button-icons-only .ui-button-icon-secondary { 206 | right: .5em; 207 | } 208 | 209 | /* button sets */ 210 | .ui-buttonset { 211 | margin-right: 7px; 212 | } 213 | .ui-buttonset .ui-button { 214 | margin-left: 0; 215 | margin-right: -.3em; 216 | } 217 | 218 | /* workarounds */ 219 | /* reset extra padding in Firefox, see h5bp.com/l */ 220 | input.ui-button::-moz-focus-inner, 221 | button.ui-button::-moz-focus-inner { 222 | border: 0; 223 | padding: 0; 224 | } 225 | .ui-datepicker { 226 | width: 17em; 227 | padding: .2em .2em 0; 228 | display: none; 229 | } 230 | .ui-datepicker .ui-datepicker-header { 231 | position: relative; 232 | padding: .2em 0; 233 | } 234 | .ui-datepicker .ui-datepicker-prev, 235 | .ui-datepicker .ui-datepicker-next { 236 | position: absolute; 237 | top: 2px; 238 | width: 1.8em; 239 | height: 1.8em; 240 | } 241 | .ui-datepicker .ui-datepicker-prev-hover, 242 | .ui-datepicker .ui-datepicker-next-hover { 243 | top: 1px; 244 | } 245 | .ui-datepicker .ui-datepicker-prev { 246 | left: 2px; 247 | } 248 | .ui-datepicker .ui-datepicker-next { 249 | right: 2px; 250 | } 251 | .ui-datepicker .ui-datepicker-prev-hover { 252 | left: 1px; 253 | } 254 | .ui-datepicker .ui-datepicker-next-hover { 255 | right: 1px; 256 | } 257 | .ui-datepicker .ui-datepicker-prev span, 258 | .ui-datepicker .ui-datepicker-next span { 259 | display: block; 260 | position: absolute; 261 | left: 50%; 262 | margin-left: -8px; 263 | top: 50%; 264 | margin-top: -8px; 265 | } 266 | .ui-datepicker .ui-datepicker-title { 267 | margin: 0 2.3em; 268 | line-height: 1.8em; 269 | text-align: center; 270 | } 271 | .ui-datepicker .ui-datepicker-title select { 272 | font-size: 1em; 273 | margin: 1px 0; 274 | } 275 | .ui-datepicker select.ui-datepicker-month, 276 | .ui-datepicker select.ui-datepicker-year { 277 | width: 45%; 278 | } 279 | .ui-datepicker table { 280 | width: 100%; 281 | font-size: .9em; 282 | border-collapse: collapse; 283 | margin: 0 0 .4em; 284 | } 285 | .ui-datepicker th { 286 | padding: .7em .3em; 287 | text-align: center; 288 | font-weight: bold; 289 | border: 0; 290 | } 291 | .ui-datepicker td { 292 | border: 0; 293 | padding: 1px; 294 | } 295 | .ui-datepicker td span, 296 | .ui-datepicker td a { 297 | display: block; 298 | padding: .2em; 299 | text-align: right; 300 | text-decoration: none; 301 | } 302 | .ui-datepicker .ui-datepicker-buttonpane { 303 | background-image: none; 304 | margin: .7em 0 0 0; 305 | padding: 0 .2em; 306 | border-left: 0; 307 | border-right: 0; 308 | border-bottom: 0; 309 | } 310 | .ui-datepicker .ui-datepicker-buttonpane button { 311 | float: right; 312 | margin: .5em .2em .4em; 313 | cursor: pointer; 314 | padding: .2em .6em .3em .6em; 315 | width: auto; 316 | overflow: visible; 317 | } 318 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { 319 | float: left; 320 | } 321 | 322 | /* with multiple calendars */ 323 | .ui-datepicker.ui-datepicker-multi { 324 | width: auto; 325 | } 326 | .ui-datepicker-multi .ui-datepicker-group { 327 | float: left; 328 | } 329 | .ui-datepicker-multi .ui-datepicker-group table { 330 | width: 95%; 331 | margin: 0 auto .4em; 332 | } 333 | .ui-datepicker-multi-2 .ui-datepicker-group { 334 | width: 50%; 335 | } 336 | .ui-datepicker-multi-3 .ui-datepicker-group { 337 | width: 33.3%; 338 | } 339 | .ui-datepicker-multi-4 .ui-datepicker-group { 340 | width: 25%; 341 | } 342 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, 343 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { 344 | border-left-width: 0; 345 | } 346 | .ui-datepicker-multi .ui-datepicker-buttonpane { 347 | clear: left; 348 | } 349 | .ui-datepicker-row-break { 350 | clear: both; 351 | width: 100%; 352 | font-size: 0; 353 | } 354 | 355 | /* RTL support */ 356 | .ui-datepicker-rtl { 357 | direction: rtl; 358 | } 359 | .ui-datepicker-rtl .ui-datepicker-prev { 360 | right: 2px; 361 | left: auto; 362 | } 363 | .ui-datepicker-rtl .ui-datepicker-next { 364 | left: 2px; 365 | right: auto; 366 | } 367 | .ui-datepicker-rtl .ui-datepicker-prev:hover { 368 | right: 1px; 369 | left: auto; 370 | } 371 | .ui-datepicker-rtl .ui-datepicker-next:hover { 372 | left: 1px; 373 | right: auto; 374 | } 375 | .ui-datepicker-rtl .ui-datepicker-buttonpane { 376 | clear: right; 377 | } 378 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { 379 | float: left; 380 | } 381 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, 382 | .ui-datepicker-rtl .ui-datepicker-group { 383 | float: right; 384 | } 385 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, 386 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { 387 | border-right-width: 0; 388 | border-left-width: 1px; 389 | } 390 | .ui-dialog { 391 | overflow: hidden; 392 | position: absolute; 393 | top: 0; 394 | left: 0; 395 | padding: .2em; 396 | outline: 0; 397 | } 398 | .ui-dialog .ui-dialog-titlebar { 399 | padding: .4em 1em; 400 | position: relative; 401 | } 402 | .ui-dialog .ui-dialog-title { 403 | float: left; 404 | margin: .1em 0; 405 | white-space: nowrap; 406 | width: 90%; 407 | overflow: hidden; 408 | text-overflow: ellipsis; 409 | } 410 | .ui-dialog .ui-dialog-titlebar-close { 411 | position: absolute; 412 | right: .3em; 413 | top: 50%; 414 | width: 20px; 415 | margin: -10px 0 0 0; 416 | padding: 1px; 417 | height: 20px; 418 | } 419 | .ui-dialog .ui-dialog-content { 420 | position: relative; 421 | border: 0; 422 | padding: .5em 1em; 423 | background: none; 424 | overflow: auto; 425 | } 426 | .ui-dialog .ui-dialog-buttonpane { 427 | text-align: left; 428 | border-width: 1px 0 0 0; 429 | background-image: none; 430 | margin-top: .5em; 431 | padding: .3em 1em .5em .4em; 432 | } 433 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { 434 | float: right; 435 | } 436 | .ui-dialog .ui-dialog-buttonpane button { 437 | margin: .5em .4em .5em 0; 438 | cursor: pointer; 439 | } 440 | .ui-dialog .ui-resizable-se { 441 | width: 12px; 442 | height: 12px; 443 | right: -5px; 444 | bottom: -5px; 445 | background-position: 16px 16px; 446 | } 447 | .ui-draggable .ui-dialog-titlebar { 448 | cursor: move; 449 | } 450 | .ui-draggable-handle { 451 | -ms-touch-action: none; 452 | touch-action: none; 453 | } 454 | .ui-menu { 455 | list-style: none; 456 | padding: 0; 457 | margin: 0; 458 | display: block; 459 | outline: none; 460 | } 461 | .ui-menu .ui-menu { 462 | position: absolute; 463 | } 464 | .ui-menu .ui-menu-item { 465 | position: relative; 466 | margin: 0; 467 | padding: 3px 1em 3px .4em; 468 | cursor: pointer; 469 | min-height: 0; /* support: IE7 */ 470 | /* support: IE10, see #8844 */ 471 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 472 | } 473 | .ui-menu .ui-menu-divider { 474 | margin: 5px 0; 475 | height: 0; 476 | font-size: 0; 477 | line-height: 0; 478 | border-width: 1px 0 0 0; 479 | } 480 | .ui-menu .ui-state-focus, 481 | .ui-menu .ui-state-active { 482 | margin: -1px; 483 | } 484 | 485 | /* icon support */ 486 | .ui-menu-icons { 487 | position: relative; 488 | } 489 | .ui-menu-icons .ui-menu-item { 490 | padding-left: 2em; 491 | } 492 | 493 | /* left-aligned */ 494 | .ui-menu .ui-icon { 495 | position: absolute; 496 | top: 0; 497 | bottom: 0; 498 | left: .2em; 499 | margin: auto 0; 500 | } 501 | 502 | /* right-aligned */ 503 | .ui-menu .ui-menu-icon { 504 | left: auto; 505 | right: 0; 506 | } 507 | .ui-progressbar { 508 | height: 2em; 509 | text-align: left; 510 | overflow: hidden; 511 | } 512 | .ui-progressbar .ui-progressbar-value { 513 | margin: -1px; 514 | height: 100%; 515 | } 516 | .ui-progressbar .ui-progressbar-overlay { 517 | background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); 518 | height: 100%; 519 | filter: alpha(opacity=25); /* support: IE8 */ 520 | opacity: 0.25; 521 | } 522 | .ui-progressbar-indeterminate .ui-progressbar-value { 523 | background-image: none; 524 | } 525 | .ui-resizable { 526 | position: relative; 527 | } 528 | .ui-resizable-handle { 529 | position: absolute; 530 | font-size: 0.1px; 531 | display: block; 532 | -ms-touch-action: none; 533 | touch-action: none; 534 | } 535 | .ui-resizable-disabled .ui-resizable-handle, 536 | .ui-resizable-autohide .ui-resizable-handle { 537 | display: none; 538 | } 539 | .ui-resizable-n { 540 | cursor: n-resize; 541 | height: 7px; 542 | width: 100%; 543 | top: -5px; 544 | left: 0; 545 | } 546 | .ui-resizable-s { 547 | cursor: s-resize; 548 | height: 7px; 549 | width: 100%; 550 | bottom: -5px; 551 | left: 0; 552 | } 553 | .ui-resizable-e { 554 | cursor: e-resize; 555 | width: 7px; 556 | right: -5px; 557 | top: 0; 558 | height: 100%; 559 | } 560 | .ui-resizable-w { 561 | cursor: w-resize; 562 | width: 7px; 563 | left: -5px; 564 | top: 0; 565 | height: 100%; 566 | } 567 | .ui-resizable-se { 568 | cursor: se-resize; 569 | width: 12px; 570 | height: 12px; 571 | right: 1px; 572 | bottom: 1px; 573 | } 574 | .ui-resizable-sw { 575 | cursor: sw-resize; 576 | width: 9px; 577 | height: 9px; 578 | left: -5px; 579 | bottom: -5px; 580 | } 581 | .ui-resizable-nw { 582 | cursor: nw-resize; 583 | width: 9px; 584 | height: 9px; 585 | left: -5px; 586 | top: -5px; 587 | } 588 | .ui-resizable-ne { 589 | cursor: ne-resize; 590 | width: 9px; 591 | height: 9px; 592 | right: -5px; 593 | top: -5px; 594 | } 595 | .ui-selectable { 596 | -ms-touch-action: none; 597 | touch-action: none; 598 | } 599 | .ui-selectable-helper { 600 | position: absolute; 601 | z-index: 100; 602 | border: 1px dotted black; 603 | } 604 | .ui-selectmenu-menu { 605 | padding: 0; 606 | margin: 0; 607 | position: absolute; 608 | top: 0; 609 | left: 0; 610 | display: none; 611 | } 612 | .ui-selectmenu-menu .ui-menu { 613 | overflow: auto; 614 | /* Support: IE7 */ 615 | overflow-x: hidden; 616 | padding-bottom: 1px; 617 | } 618 | .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { 619 | font-size: 1em; 620 | font-weight: bold; 621 | line-height: 1.5; 622 | padding: 2px 0.4em; 623 | margin: 0.5em 0 0 0; 624 | height: auto; 625 | border: 0; 626 | } 627 | .ui-selectmenu-open { 628 | display: block; 629 | } 630 | .ui-selectmenu-button { 631 | display: inline-block; 632 | overflow: hidden; 633 | position: relative; 634 | text-decoration: none; 635 | cursor: pointer; 636 | } 637 | .ui-selectmenu-button span.ui-icon { 638 | right: 0.5em; 639 | left: auto; 640 | margin-top: -8px; 641 | position: absolute; 642 | top: 50%; 643 | } 644 | .ui-selectmenu-button span.ui-selectmenu-text { 645 | text-align: left; 646 | padding: 0.4em 2.1em 0.4em 1em; 647 | display: block; 648 | line-height: 1.4; 649 | overflow: hidden; 650 | text-overflow: ellipsis; 651 | white-space: nowrap; 652 | } 653 | .ui-slider { 654 | position: relative; 655 | text-align: left; 656 | } 657 | .ui-slider .ui-slider-handle { 658 | position: absolute; 659 | z-index: 2; 660 | width: 1.2em; 661 | height: 1.2em; 662 | cursor: default; 663 | -ms-touch-action: none; 664 | touch-action: none; 665 | } 666 | .ui-slider .ui-slider-range { 667 | position: absolute; 668 | z-index: 1; 669 | font-size: .7em; 670 | display: block; 671 | border: 0; 672 | background-position: 0 0; 673 | } 674 | 675 | /* support: IE8 - See #6727 */ 676 | .ui-slider.ui-state-disabled .ui-slider-handle, 677 | .ui-slider.ui-state-disabled .ui-slider-range { 678 | filter: inherit; 679 | } 680 | 681 | .ui-slider-horizontal { 682 | height: .8em; 683 | } 684 | .ui-slider-horizontal .ui-slider-handle { 685 | top: -.3em; 686 | margin-left: -.6em; 687 | } 688 | .ui-slider-horizontal .ui-slider-range { 689 | top: 0; 690 | height: 100%; 691 | } 692 | .ui-slider-horizontal .ui-slider-range-min { 693 | left: 0; 694 | } 695 | .ui-slider-horizontal .ui-slider-range-max { 696 | right: 0; 697 | } 698 | 699 | .ui-slider-vertical { 700 | width: .8em; 701 | height: 100px; 702 | } 703 | .ui-slider-vertical .ui-slider-handle { 704 | left: -.3em; 705 | margin-left: 0; 706 | margin-bottom: -.6em; 707 | } 708 | .ui-slider-vertical .ui-slider-range { 709 | left: 0; 710 | width: 100%; 711 | } 712 | .ui-slider-vertical .ui-slider-range-min { 713 | bottom: 0; 714 | } 715 | .ui-slider-vertical .ui-slider-range-max { 716 | top: 0; 717 | } 718 | .ui-sortable-handle { 719 | -ms-touch-action: none; 720 | touch-action: none; 721 | } 722 | .ui-spinner { 723 | position: relative; 724 | display: inline-block; 725 | overflow: hidden; 726 | padding: 0; 727 | vertical-align: middle; 728 | } 729 | .ui-spinner-input { 730 | border: none; 731 | background: none; 732 | color: inherit; 733 | padding: 0; 734 | margin: .2em 0; 735 | vertical-align: middle; 736 | margin-left: .4em; 737 | margin-right: 22px; 738 | } 739 | .ui-spinner-button { 740 | width: 16px; 741 | height: 50%; 742 | font-size: .5em; 743 | padding: 0; 744 | margin: 0; 745 | text-align: center; 746 | position: absolute; 747 | cursor: default; 748 | display: block; 749 | overflow: hidden; 750 | right: 0; 751 | } 752 | /* more specificity required here to override default borders */ 753 | .ui-spinner a.ui-spinner-button { 754 | border-top: none; 755 | border-bottom: none; 756 | border-right: none; 757 | } 758 | /* vertically center icon */ 759 | .ui-spinner .ui-icon { 760 | position: absolute; 761 | margin-top: -8px; 762 | top: 50%; 763 | left: 0; 764 | } 765 | .ui-spinner-up { 766 | top: 0; 767 | } 768 | .ui-spinner-down { 769 | bottom: 0; 770 | } 771 | 772 | /* TR overrides */ 773 | .ui-spinner .ui-icon-triangle-1-s { 774 | /* need to fix icons sprite */ 775 | background-position: -65px -16px; 776 | } 777 | .ui-tabs { 778 | position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 779 | padding: .2em; 780 | } 781 | .ui-tabs .ui-tabs-nav { 782 | margin: 0; 783 | padding: .2em .2em 0; 784 | } 785 | .ui-tabs .ui-tabs-nav li { 786 | list-style: none; 787 | float: left; 788 | position: relative; 789 | top: 0; 790 | margin: 1px .2em 0 0; 791 | border-bottom-width: 0; 792 | padding: 0; 793 | white-space: nowrap; 794 | } 795 | .ui-tabs .ui-tabs-nav .ui-tabs-anchor { 796 | float: left; 797 | padding: .5em 1em; 798 | text-decoration: none; 799 | } 800 | .ui-tabs .ui-tabs-nav li.ui-tabs-active { 801 | margin-bottom: -1px; 802 | padding-bottom: 1px; 803 | } 804 | .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, 805 | .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, 806 | .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { 807 | cursor: text; 808 | } 809 | .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { 810 | cursor: pointer; 811 | } 812 | .ui-tabs .ui-tabs-panel { 813 | display: block; 814 | border-width: 0; 815 | padding: 1em 1.4em; 816 | background: none; 817 | } 818 | .ui-tooltip { 819 | padding: 8px; 820 | position: absolute; 821 | z-index: 9999; 822 | max-width: 300px; 823 | -webkit-box-shadow: 0 0 5px #aaa; 824 | box-shadow: 0 0 5px #aaa; 825 | } 826 | body .ui-tooltip { 827 | border-width: 2px; 828 | } 829 | 830 | /* Component containers 831 | ----------------------------------*/ 832 | .ui-widget { 833 | font-family: Verdana,Arial,sans-serif; 834 | font-size: 1.1em; 835 | } 836 | .ui-widget .ui-widget { 837 | font-size: 1em; 838 | } 839 | .ui-widget input, 840 | .ui-widget select, 841 | .ui-widget textarea, 842 | .ui-widget button { 843 | font-family: Verdana,Arial,sans-serif; 844 | font-size: 1em; 845 | } 846 | .ui-widget-content { 847 | border: 1px solid #aaaaaa; 848 | background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; 849 | color: #222222; 850 | } 851 | .ui-widget-content a { 852 | color: #222222; 853 | } 854 | .ui-widget-header { 855 | border: 1px solid #aaaaaa; 856 | background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; 857 | color: #222222; 858 | font-weight: bold; 859 | } 860 | .ui-widget-header a { 861 | color: #222222; 862 | } 863 | 864 | /* Interaction states 865 | ----------------------------------*/ 866 | .ui-state-default, 867 | .ui-widget-content .ui-state-default, 868 | .ui-widget-header .ui-state-default { 869 | border: 1px solid #d3d3d3; 870 | background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; 871 | font-weight: normal; 872 | color: #555555; 873 | } 874 | .ui-state-default a, 875 | .ui-state-default a:link, 876 | .ui-state-default a:visited { 877 | color: #555555; 878 | text-decoration: none; 879 | } 880 | .ui-state-hover, 881 | .ui-widget-content .ui-state-hover, 882 | .ui-widget-header .ui-state-hover, 883 | .ui-state-focus, 884 | .ui-widget-content .ui-state-focus, 885 | .ui-widget-header .ui-state-focus { 886 | border: 1px solid #999999; 887 | background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; 888 | font-weight: normal; 889 | color: #212121; 890 | } 891 | .ui-state-hover a, 892 | .ui-state-hover a:hover, 893 | .ui-state-hover a:link, 894 | .ui-state-hover a:visited, 895 | .ui-state-focus a, 896 | .ui-state-focus a:hover, 897 | .ui-state-focus a:link, 898 | .ui-state-focus a:visited { 899 | color: #212121; 900 | text-decoration: none; 901 | } 902 | .ui-state-active, 903 | .ui-widget-content .ui-state-active, 904 | .ui-widget-header .ui-state-active { 905 | border: 1px solid #aaaaaa; 906 | background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; 907 | font-weight: normal; 908 | color: #212121; 909 | } 910 | .ui-state-active a, 911 | .ui-state-active a:link, 912 | .ui-state-active a:visited { 913 | color: #212121; 914 | text-decoration: none; 915 | } 916 | 917 | /* Interaction Cues 918 | ----------------------------------*/ 919 | .ui-state-highlight, 920 | .ui-widget-content .ui-state-highlight, 921 | .ui-widget-header .ui-state-highlight { 922 | border: 1px solid #fcefa1; 923 | background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; 924 | color: #363636; 925 | } 926 | .ui-state-highlight a, 927 | .ui-widget-content .ui-state-highlight a, 928 | .ui-widget-header .ui-state-highlight a { 929 | color: #363636; 930 | } 931 | .ui-state-error, 932 | .ui-widget-content .ui-state-error, 933 | .ui-widget-header .ui-state-error { 934 | border: 1px solid #cd0a0a; 935 | background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; 936 | color: #cd0a0a; 937 | } 938 | .ui-state-error a, 939 | .ui-widget-content .ui-state-error a, 940 | .ui-widget-header .ui-state-error a { 941 | color: #cd0a0a; 942 | } 943 | .ui-state-error-text, 944 | .ui-widget-content .ui-state-error-text, 945 | .ui-widget-header .ui-state-error-text { 946 | color: #cd0a0a; 947 | } 948 | .ui-priority-primary, 949 | .ui-widget-content .ui-priority-primary, 950 | .ui-widget-header .ui-priority-primary { 951 | font-weight: bold; 952 | } 953 | .ui-priority-secondary, 954 | .ui-widget-content .ui-priority-secondary, 955 | .ui-widget-header .ui-priority-secondary { 956 | opacity: .7; 957 | filter:Alpha(Opacity=70); /* support: IE8 */ 958 | font-weight: normal; 959 | } 960 | .ui-state-disabled, 961 | .ui-widget-content .ui-state-disabled, 962 | .ui-widget-header .ui-state-disabled { 963 | opacity: .35; 964 | filter:Alpha(Opacity=35); /* support: IE8 */ 965 | background-image: none; 966 | } 967 | .ui-state-disabled .ui-icon { 968 | filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ 969 | } 970 | 971 | /* Icons 972 | ----------------------------------*/ 973 | 974 | /* states and images */ 975 | .ui-icon { 976 | width: 16px; 977 | height: 16px; 978 | } 979 | .ui-icon, 980 | .ui-widget-content .ui-icon { 981 | background-image: url("images/ui-icons_222222_256x240.png"); 982 | } 983 | .ui-widget-header .ui-icon { 984 | background-image: url("images/ui-icons_222222_256x240.png"); 985 | } 986 | .ui-state-default .ui-icon { 987 | background-image: url("images/ui-icons_888888_256x240.png"); 988 | } 989 | .ui-state-hover .ui-icon, 990 | .ui-state-focus .ui-icon { 991 | background-image: url("images/ui-icons_454545_256x240.png"); 992 | } 993 | .ui-state-active .ui-icon { 994 | background-image: url("images/ui-icons_454545_256x240.png"); 995 | } 996 | .ui-state-highlight .ui-icon { 997 | background-image: url("images/ui-icons_2e83ff_256x240.png"); 998 | } 999 | .ui-state-error .ui-icon, 1000 | .ui-state-error-text .ui-icon { 1001 | background-image: url("images/ui-icons_cd0a0a_256x240.png"); 1002 | } 1003 | 1004 | /* positioning */ 1005 | .ui-icon-blank { background-position: 16px 16px; } 1006 | .ui-icon-carat-1-n { background-position: 0 0; } 1007 | .ui-icon-carat-1-ne { background-position: -16px 0; } 1008 | .ui-icon-carat-1-e { background-position: -32px 0; } 1009 | .ui-icon-carat-1-se { background-position: -48px 0; } 1010 | .ui-icon-carat-1-s { background-position: -64px 0; } 1011 | .ui-icon-carat-1-sw { background-position: -80px 0; } 1012 | .ui-icon-carat-1-w { background-position: -96px 0; } 1013 | .ui-icon-carat-1-nw { background-position: -112px 0; } 1014 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 1015 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 1016 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 1017 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 1018 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 1019 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 1020 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 1021 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 1022 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 1023 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 1024 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 1025 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 1026 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 1027 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 1028 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 1029 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 1030 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 1031 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 1032 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 1033 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 1034 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 1035 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 1036 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 1037 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 1038 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 1039 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 1040 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 1041 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 1042 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 1043 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 1044 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 1045 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 1046 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 1047 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 1048 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 1049 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 1050 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 1051 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 1052 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 1053 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 1054 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 1055 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 1056 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 1057 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 1058 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 1059 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 1060 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 1061 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 1062 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 1063 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 1064 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 1065 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 1066 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 1067 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 1068 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 1069 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 1070 | .ui-icon-arrow-4 { background-position: 0 -80px; } 1071 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 1072 | .ui-icon-extlink { background-position: -32px -80px; } 1073 | .ui-icon-newwin { background-position: -48px -80px; } 1074 | .ui-icon-refresh { background-position: -64px -80px; } 1075 | .ui-icon-shuffle { background-position: -80px -80px; } 1076 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 1077 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 1078 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 1079 | .ui-icon-folder-open { background-position: -16px -96px; } 1080 | .ui-icon-document { background-position: -32px -96px; } 1081 | .ui-icon-document-b { background-position: -48px -96px; } 1082 | .ui-icon-note { background-position: -64px -96px; } 1083 | .ui-icon-mail-closed { background-position: -80px -96px; } 1084 | .ui-icon-mail-open { background-position: -96px -96px; } 1085 | .ui-icon-suitcase { background-position: -112px -96px; } 1086 | .ui-icon-comment { background-position: -128px -96px; } 1087 | .ui-icon-person { background-position: -144px -96px; } 1088 | .ui-icon-print { background-position: -160px -96px; } 1089 | .ui-icon-trash { background-position: -176px -96px; } 1090 | .ui-icon-locked { background-position: -192px -96px; } 1091 | .ui-icon-unlocked { background-position: -208px -96px; } 1092 | .ui-icon-bookmark { background-position: -224px -96px; } 1093 | .ui-icon-tag { background-position: -240px -96px; } 1094 | .ui-icon-home { background-position: 0 -112px; } 1095 | .ui-icon-flag { background-position: -16px -112px; } 1096 | .ui-icon-calendar { background-position: -32px -112px; } 1097 | .ui-icon-cart { background-position: -48px -112px; } 1098 | .ui-icon-pencil { background-position: -64px -112px; } 1099 | .ui-icon-clock { background-position: -80px -112px; } 1100 | .ui-icon-disk { background-position: -96px -112px; } 1101 | .ui-icon-calculator { background-position: -112px -112px; } 1102 | .ui-icon-zoomin { background-position: -128px -112px; } 1103 | .ui-icon-zoomout { background-position: -144px -112px; } 1104 | .ui-icon-search { background-position: -160px -112px; } 1105 | .ui-icon-wrench { background-position: -176px -112px; } 1106 | .ui-icon-gear { background-position: -192px -112px; } 1107 | .ui-icon-heart { background-position: -208px -112px; } 1108 | .ui-icon-star { background-position: -224px -112px; } 1109 | .ui-icon-link { background-position: -240px -112px; } 1110 | .ui-icon-cancel { background-position: 0 -128px; } 1111 | .ui-icon-plus { background-position: -16px -128px; } 1112 | .ui-icon-plusthick { background-position: -32px -128px; } 1113 | .ui-icon-minus { background-position: -48px -128px; } 1114 | .ui-icon-minusthick { background-position: -64px -128px; } 1115 | .ui-icon-close { background-position: -80px -128px; } 1116 | .ui-icon-closethick { background-position: -96px -128px; } 1117 | .ui-icon-key { background-position: -112px -128px; } 1118 | .ui-icon-lightbulb { background-position: -128px -128px; } 1119 | .ui-icon-scissors { background-position: -144px -128px; } 1120 | .ui-icon-clipboard { background-position: -160px -128px; } 1121 | .ui-icon-copy { background-position: -176px -128px; } 1122 | .ui-icon-contact { background-position: -192px -128px; } 1123 | .ui-icon-image { background-position: -208px -128px; } 1124 | .ui-icon-video { background-position: -224px -128px; } 1125 | .ui-icon-script { background-position: -240px -128px; } 1126 | .ui-icon-alert { background-position: 0 -144px; } 1127 | .ui-icon-info { background-position: -16px -144px; } 1128 | .ui-icon-notice { background-position: -32px -144px; } 1129 | .ui-icon-help { background-position: -48px -144px; } 1130 | .ui-icon-check { background-position: -64px -144px; } 1131 | .ui-icon-bullet { background-position: -80px -144px; } 1132 | .ui-icon-radio-on { background-position: -96px -144px; } 1133 | .ui-icon-radio-off { background-position: -112px -144px; } 1134 | .ui-icon-pin-w { background-position: -128px -144px; } 1135 | .ui-icon-pin-s { background-position: -144px -144px; } 1136 | .ui-icon-play { background-position: 0 -160px; } 1137 | .ui-icon-pause { background-position: -16px -160px; } 1138 | .ui-icon-seek-next { background-position: -32px -160px; } 1139 | .ui-icon-seek-prev { background-position: -48px -160px; } 1140 | .ui-icon-seek-end { background-position: -64px -160px; } 1141 | .ui-icon-seek-start { background-position: -80px -160px; } 1142 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 1143 | .ui-icon-seek-first { background-position: -80px -160px; } 1144 | .ui-icon-stop { background-position: -96px -160px; } 1145 | .ui-icon-eject { background-position: -112px -160px; } 1146 | .ui-icon-volume-off { background-position: -128px -160px; } 1147 | .ui-icon-volume-on { background-position: -144px -160px; } 1148 | .ui-icon-power { background-position: 0 -176px; } 1149 | .ui-icon-signal-diag { background-position: -16px -176px; } 1150 | .ui-icon-signal { background-position: -32px -176px; } 1151 | .ui-icon-battery-0 { background-position: -48px -176px; } 1152 | .ui-icon-battery-1 { background-position: -64px -176px; } 1153 | .ui-icon-battery-2 { background-position: -80px -176px; } 1154 | .ui-icon-battery-3 { background-position: -96px -176px; } 1155 | .ui-icon-circle-plus { background-position: 0 -192px; } 1156 | .ui-icon-circle-minus { background-position: -16px -192px; } 1157 | .ui-icon-circle-close { background-position: -32px -192px; } 1158 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 1159 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 1160 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 1161 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 1162 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 1163 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 1164 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 1165 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 1166 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 1167 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 1168 | .ui-icon-circle-check { background-position: -208px -192px; } 1169 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 1170 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 1171 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 1172 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 1173 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 1174 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 1175 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 1176 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 1177 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 1178 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 1179 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 1180 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 1181 | 1182 | 1183 | /* Misc visuals 1184 | ----------------------------------*/ 1185 | 1186 | /* Corner radius */ 1187 | .ui-corner-all, 1188 | .ui-corner-top, 1189 | .ui-corner-left, 1190 | .ui-corner-tl { 1191 | border-top-left-radius: 4px; 1192 | } 1193 | .ui-corner-all, 1194 | .ui-corner-top, 1195 | .ui-corner-right, 1196 | .ui-corner-tr { 1197 | border-top-right-radius: 4px; 1198 | } 1199 | .ui-corner-all, 1200 | .ui-corner-bottom, 1201 | .ui-corner-left, 1202 | .ui-corner-bl { 1203 | border-bottom-left-radius: 4px; 1204 | } 1205 | .ui-corner-all, 1206 | .ui-corner-bottom, 1207 | .ui-corner-right, 1208 | .ui-corner-br { 1209 | border-bottom-right-radius: 4px; 1210 | } 1211 | 1212 | /* Overlays */ 1213 | .ui-widget-overlay { 1214 | background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; 1215 | opacity: .3; 1216 | filter: Alpha(Opacity=30); /* support: IE8 */ 1217 | } 1218 | .ui-widget-shadow { 1219 | margin: -8px 0 0 -8px; 1220 | padding: 8px; 1221 | background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; 1222 | opacity: .3; 1223 | filter: Alpha(Opacity=30); /* support: IE8 */ 1224 | border-radius: 8px; 1225 | } 1226 | -------------------------------------------------------------------------------- /demo-website/static/text.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/demo-website/static/text.rar -------------------------------------------------------------------------------- /demo-website/static/text2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qitaos/rf-demos/a067cf4c0338a209142b3fb933d1306a14b32e27/demo-website/static/text2.rar -------------------------------------------------------------------------------- /demo-website/templates/deliver.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 发货 5 | 6 | 7 | 17 | 18 | 19 | 发货页面 20 |

21 | 请输入发货地址: 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo-website/templates/iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 购物车 5 | 6 | 7 | 8 | 49 | 50 | 51 | 购物车

52 | 53 | 54 | 57 | 60 | 61 |
55 | 56 | 58 | 59 |
62 | 63 | -------------------------------------------------------------------------------- /demo-website/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block content %} 3 | 12 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | 82 | 83 |
购买产品购买数量
79 | 81 |
84 |

85 |
86 |
87 | 88 | 89 | 90 | 94 | 95 | 96 |

97 | 99 |

100 | 101 | 102 |

103 |

104 | 上传下载demo页面 105 |

106 | 是 107 | 否 108 |

109 | A 110 | B 111 |

112 | 113 | 114 |

Date:

115 |

 

 

 

 

 

 

 

 

 

 

 

 

 

 

116 | 119 | {% endblock %} -------------------------------------------------------------------------------- /demo-website/templates/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Demo 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | {% block content %}{% endblock %} 16 | 17 | -------------------------------------------------------------------------------- /demo-website/templates/payfor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 付款 5 | 6 | 7 | 17 | 18 | 19 | 付款页面


20 | 选择银行 25 | 请输入银行卡号: 26 | 27 | 28 | -------------------------------------------------------------------------------- /demo-website/templates/updown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 测试页面 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
选择row1购买产品购买数量
17 | PrdName 19 | Qnt
row3alert
测试表格购买confirm

32 |

33 |

34 | 35 |

36 |





37 |

38 | 下载测试

39 |

40 | 41 | 42 | 43 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /fencengDemo/flow.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource keyword.txt 3 | 4 | *** Keywords *** 5 | 购买流程 6 | [Arguments] ${url} ${setpr} ${setqn} 7 | 打开浏览器 ${url} 8 | 输入购买产品 ${setpr} 9 | 输入购买数量 ${setqn} 10 | 点击提交 11 | 等待页面加载 ${setpr} 12 | ${getpr} 获取产品名称 13 | ${getqn} 获取数量 14 | 验证是否一致 ${setpr} ${getpr} 15 | 验证是否一致 ${setqn} ${getqn} 16 | 关闭浏览器 17 | -------------------------------------------------------------------------------- /fencengDemo/keyword.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Selenium2Library 3 | 4 | *** Keywords *** 5 | 打开浏览器 6 | [Arguments] ${url} 7 | open browser ${url} gc 8 | 9 | 输入购买产品 10 | [Arguments] ${product} 11 | input text ProductName ${product} 12 | 13 | 输入购买数量 14 | [Arguments] ${quantity} 15 | input text Quantity ${quantity} 16 | 17 | 点击提交 18 | click button submitBtn 19 | 20 | 获取产品名称 21 | ${pr} Get Element Attribute Pr@innerText 22 | [Return] ${pr} 23 | 24 | 获取数量 25 | ${qn} Get Element Attribute Qn@innerText 26 | [Return] ${qn} 27 | 28 | 验证是否一致 29 | [Arguments] ${ver1} ${ver2} 30 | ${verify} Should Be Equal ${ver1} ${ver2} 31 | [Return] ${verify} 32 | 33 | 关闭浏览器 34 | Close All Browsers 35 | 36 | 等待页面加载 37 | [Arguments] ${text} 38 | Wait Until Page Contains ${text} 39 | -------------------------------------------------------------------------------- /fencengDemo/suite.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource flow.txt 3 | 4 | *** Test Cases *** 5 | case1 6 | [Tags] test1 7 | 购买流程 http://127.0.0.1:8000/ 测试 11 8 | 9 | case2 10 | 购买流程 http://127.0.0.1:8000/ 这是什么 22 11 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-2-10.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | 3 | *** Test Cases *** 4 | Case-2-10-1 5 | : FOR ${i} IN RANGE 10 6 | \ LOG i=${i} 7 | : FOR ${j} IN RANGE 1 10 8 | \ LOG j=${j} 9 | : FOR ${k} IN RANGE 10 1 -2 10 | \ LOG k=${k} 11 | : FOR ${m} IN A B C 12 | \ LOG m=${m} 13 | @{listVal} Create List 1 2 F 14 | : FOR ${n} IN @{listVal} 15 | \ LOG n=${n} 16 | : FOR ${i} IN RANGE 3 17 | \ LOG i=${i} 18 | \ ForJ ${i} 19 | : FOR ${x} IN RANGE 3 20 | \ LOG x=${x} 21 | ForJ ${x} 22 | 23 | Case-2-10-2 24 | ${a} Set Variable 0 25 | ${b} Set Variable 5 26 | #多行写法 27 | Run Keyword If ${a} >= 1 log 1 ELSE IF ${b} <= 4 log 28 | ... 2 ELSE log 3 29 | #单行写法 30 | Run Keyword If ${a} >= 1 No Operation ELSE log 6 31 | 32 | Case-2-10-3 33 | :FOR ${i} IN RANGE 10 34 | \ LOG i=${i} 35 | \ Run Keyword If ${i}>=7 Exit For Loop 36 | :FOR ${i} IN RANGE 10 37 | \ LOG i=${i} 38 | \ Exit For Loop If ${i}>=7 39 | 40 | *** Keywords *** 41 | ForJ 42 | [Arguments] ${arg1} 43 | : FOR ${j} IN RANGE 2 44 | \ LOG arg=${arg1};j=${j} 45 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-2-11.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library AutoItLibrary 3 | 4 | *** Test Cases *** 5 | Case-2-11-1 6 | [Tags] RunA RunAll 7 | log case-2-11-1 8 | 9 | Case-2-11-2 10 | [Tags] RunB RunAll 11 | log case-2-11-2 12 | 13 | Case-2-11-3 14 | [Tags] RunA RunB RunAll 15 | log case-2-11-3 16 | 17 | Case-2-11-4 18 | [Tags] RunAll 19 | log case-2-11-4 20 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-2-8.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${val1} value 3 | @{listVal1} abc def 123 4 | 5 | *** Test Cases *** 6 | Case-2-8-1 7 | log ${val1} 8 | log many @{listVal1} 9 | log %{ANDROID_HOME} 10 | ${shuzhi} Set Variable ${2.6} 2.6 11 | 12 | Case-2-8-2 13 | ${val2} Set Variable abcd 14 | ${valif2} Set Variable If '${val2}' == 'abcd' efgh ace 15 | ${getVal1} Get Length ${val2} 16 | ${getVal2} Get Time 17 | log ${val1} 18 | Run Keyword If '${val2}' == 'abcd' log efgh 19 | log 0123${val2}efgh 20 | log ${val2[2]} 21 | log ${val2[0:3]} 22 | ${cal1} Set Variable 123 23 | ${cal2} Evaluate ${cal1}+1 24 | ${cal1} Set Variable '123' 25 | ${cal2} Evaluate int(${cal1})+1 26 | 27 | Case-2-8-3 28 | @{Val3} Set Variable 1 2 3 29 | @{listVal3} Create List 3 2 1 30 | Run Keyword log abcd WARN 31 | @{argVal3} Create List abcd WARN 32 | ${keyword} Set Variable log 33 | Run Keyword ${keyword} @{argVal3} 34 | log @{argVal3} 35 | @{useList} Create List a b c 36 | log @{useList}[1] 37 | log ${useList[1]} 38 | @{listA} Create List 1 2 39 | @{listB} Create List 3 4 40 | @{listC} Create List ${listA} ${listB} 5 41 | log @{listC}[1][1] 42 | log ${listC[1][1]} 43 | log @{listC[1]}[1] 44 | 45 | Case-2-8-4 46 | @{argVal4} Create List abcd WARN 47 | log ${argVal4} 48 | ${argVal4} Create List 1234 5678 49 | log ${argVal4} 50 | ${listVal4} Create List 1234 5678 51 | log =@{listVal4}= 52 | log =@{argVal4}= 53 | @{argVal4} Create List 4444 8888 54 | log ${argVal4} 55 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-2-9.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource newresource.txt 3 | 4 | *** Test Cases *** 5 | Case-2-9-2 6 | 随机字符 arg1value 7 | 8 | Case-2-9-3 9 | ${getArg1} 随机字符-1 arg1value 10 | log ${getArg1} 11 | ${getArg2} 随机字符-2 arg1value 12 | log ${getArg2} 13 | @{ListArg2} 随机字符-2 arg1value 14 | log =@{ListArg2}= 15 | ${valArg1} ${valArg2} 随机字符-2 arg1value 16 | log ${valArg1}=${valArg2} 17 | ${getArg3} 随机字符-3 arg1value \ arg3 18 | log ${getArg3} 19 | @{ListArg3} 随机字符-3 arg1value \ arg3 20 | log =@{ListArg3}= 21 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-3-4/Step2.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource elements.robot 3 | 4 | *** Test Cases *** 5 | Case2 6 | 打开浏览器 http://127.0.0.1:7272/html/ 7 | 输入用户名 demo 8 | 输入密码 mode 9 | 点击登录 10 | 验证页面文本 Login succeeded 11 | 关闭浏览器 12 | 13 | Case3 14 | 打开浏览器 http://127.0.0.1:7272/html/ 15 | 输入用户名 demo 16 | 输入密码 wrong 17 | 点击登录 18 | 验证页面文本 Login failed 19 | 关闭浏览器 20 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-3-4/Step3.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource testflow.robot 3 | 4 | *** Test Cases *** 5 | Case4 6 | 登录验证流程 http://127.0.0.1:7272/html/ demo mode Login succeeded 7 | 8 | Case5 9 | 登录验证流程 http://127.0.0.1:7272/html/ demo wrong Login failed 10 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-3-4/elements.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Selenium2Library 3 | 4 | *** Keywords *** 5 | 打开浏览器 6 | [Arguments] ${url} 7 | Open Browser ${url} ie 8 | 9 | 输入用户名 10 | [Arguments] ${username} 11 | Input Text name=username_field ${username} 12 | 13 | 输入密码 14 | [Arguments] ${password} 15 | Input Password name=password_field ${password} 16 | 17 | 点击登录 18 | Click Button name=login_button 19 | 20 | 验证页面文本 21 | [Arguments] ${verText} 22 | Page Should Contain ${verText} 23 | 24 | 关闭浏览器 25 | Close Browser 26 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-3-4/step1.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Selenium2Library 3 | 4 | *** Test Cases *** 5 | Case1 6 | Open Browser http://127.0.0.1:7272/html/ ie 7 | Input Text name=username_field demo 8 | Input Password name=password_field mode 9 | Click Button name=login_button 10 | Page Should Contain Login succeeded 11 | Close Browser 12 | -------------------------------------------------------------------------------- /rf-book-case/test/Suite-3-4/testflow.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource elements.robot 3 | 4 | *** Keywords *** 5 | 登录验证流程 6 | [Arguments] ${url} ${username} ${password} ${text} 7 | 打开浏览器 ${url} 8 | 输入用户名 ${username} 9 | 输入密码 ${password} 10 | 点击登录 11 | 验证页面文本 ${text} 12 | 关闭浏览器 13 | -------------------------------------------------------------------------------- /rf-book-case/test/newresource.txt: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | 随机字符 3 | [Arguments] ${arg1} ${arg2}=123 @{arg3} 4 | log ${arg1} 5 | log ${arg2} 6 | log =@{arg3}= 7 | 8 | 随机字符-1 9 | [Arguments] ${arg1} ${arg2}=123 @{arg3} 10 | log ${arg1} 11 | log ${arg2} 12 | log =@{arg3}= 13 | [Return] ${arg1} 14 | 15 | 随机字符-2 16 | [Arguments] ${arg1} ${arg2}=123 @{arg3} 17 | log ${arg1} 18 | log ${arg2} 19 | log =@{arg3}= 20 | [Return] ${arg1} ${arg2} 21 | 22 | 随机字符-3 23 | [Arguments] ${arg1} ${arg2}=123 @{arg3} 24 | log ${arg1} 25 | log ${arg2} 26 | log =@{arg3}= 27 | [Return] @{arg3} 28 | -------------------------------------------------------------------------------- /rf-book-case/test/测试套件.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library String 3 | Library ../../Lib/site-packages/robot/libraries/Collections.py 4 | Resource newresource.txt 5 | 6 | *** Test Cases *** 7 | case 8 | log ${val1} 9 | -------------------------------------------------------------------------------- /rf-book-case/testproject/testsuite1.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource ../test/newresource.txt 3 | 4 | *** Test Cases *** 5 | case1 6 | log hello world 7 | 打印日志 8 | --------------------------------------------------------------------------------