├── README.rst ├── RobotFrameworkIntroduction.odp └── images ├── README.rst ├── data-driven.png ├── data-driven.robot ├── genpng.py ├── gherkin.png ├── gherkin.robot ├── gherkin_login.png ├── gherkin_login.robot ├── invalid_login.png ├── invalid_login.robot ├── keyword-driven.png ├── keyword-driven.robot ├── library.png ├── library.py ├── log.png ├── report-fail.png ├── report-pass.png ├── resource.png ├── resource.robot ├── ride-orig.png ├── ride.png ├── user-keywords.png ├── user-keywords.robot ├── valid_login.png ├── valid_login.robot ├── variables.png └── variables.robot /README.rst: -------------------------------------------------------------------------------- 1 | Robot Framework Introduction Slides 2 | =================================== 3 | 4 | This slide set contains a brief introduction to `Robot Framework 5 | `__. You can find the original 6 | `RobotFrameworkIntroduction.odp`__ here, and the presentation is also 7 | visible online at SlideShare__. 8 | 9 | If you have enhancement ideas or new topics to add to these slides, 10 | please submit an issue__. For general discussion it is better to use 11 | robotframework-users__ mailing lists. 12 | 13 | The slide set itself as well as the included ``__ are licensed 14 | under the `Creative Commons Attribution 3.0 License`__. 15 | 16 | __ https://github.com/robotframework/IntroSlides/raw/master/RobotFrameworkIntroduction.odp 17 | __ http://www.slideshare.net/pekkaklarck/robot-framework-introduction 18 | __ https://github.com/robotframework/IntroSlides/issues 19 | __ https://groups.google.com/forum/#!forum/robotframework-users 20 | __ https://creativecommons.org/licenses/by/3.0/ 21 | -------------------------------------------------------------------------------- /RobotFrameworkIntroduction.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/RobotFrameworkIntroduction.odp -------------------------------------------------------------------------------- /images/README.rst: -------------------------------------------------------------------------------- 1 | This directory contains most of the images shown in the slides. 2 | Examples are in ``*.robot`` and ``*.py`` files, and ``_ 3 | script can be used to convert them to PNG format. 4 | -------------------------------------------------------------------------------- /images/data-driven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/data-driven.png -------------------------------------------------------------------------------- /images/data-driven.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** USER NAME PASSWORD 2 | Invalid Username invalid ${VALID PWD} 3 | Invalid Password ${VALID USER} invalid 4 | Both Invalid invalid whatever 5 | Empty Username ${EMPTY} ${VALID PWD} 6 | Empty Password ${VALID USER} ${EMPTY} 7 | Both Empty ${EMPTY} ${EMPTY} 8 | -------------------------------------------------------------------------------- /images/genpng.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from glob import glob 5 | from os.path import abspath, dirname, join, samefile 6 | 7 | from PIL import Image 8 | from pygments import highlight 9 | from pygments.formatters import ImageFormatter 10 | from pygments.lexers import get_lexer_for_filename 11 | 12 | 13 | CURDIR = dirname(abspath(__file__)) 14 | 15 | 16 | def generate(inpath, outpath=None, style='autumn'): 17 | outpath = outpath or inpath.rsplit('.')[0] + '.png' 18 | with open(inpath) as infile: 19 | with open(outpath, 'w') as outfile: 20 | lexer = get_lexer_for_filename(inpath) 21 | formatter = ImageFormatter(style=style, line_numbers=False, 22 | font_size=42, 23 | font_name='dejavu sans mono') 24 | highlight(infile.read(), lexer, formatter, outfile) 25 | resize(outpath) 26 | return outpath 27 | 28 | def resize(path, width=900): 29 | img = Image.open(path) 30 | ratio = float(img.size[0]) / img.size[1] 31 | height = int(round(width/ratio)) 32 | img = img.resize((width, height), Image.ANTIALIAS) 33 | img.save(path) 34 | 35 | def generate_all(): 36 | for path in glob(join(CURDIR, '*.robot')) + glob(join(CURDIR, '*.py')): 37 | if not samefile(path, __file__): 38 | print generate(path) 39 | 40 | 41 | if __name__ == '__main__': 42 | paths = sys.argv[1:] 43 | if paths: 44 | for path in paths: 45 | print generate(path) 46 | else: 47 | generate_all() 48 | -------------------------------------------------------------------------------- /images/gherkin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/gherkin.png -------------------------------------------------------------------------------- /images/gherkin.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Valid Login 3 | Given browser is opened to login page 4 | When user "demo" logs in with password "mode" 5 | Then welcome page should be open 6 | -------------------------------------------------------------------------------- /images/gherkin_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/gherkin_login.png -------------------------------------------------------------------------------- /images/gherkin_login.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation A test suite with a single Gherkin style test. 3 | Resource resource.robot 4 | Test Teardown Close Browser 5 | 6 | *** Test Cases *** 7 | Valid Login 8 | Given browser is opened to login page 9 | When user "demo" logs in with password "mode" 10 | Then welcome page should be open 11 | 12 | *** Keywords *** 13 | Browser is opened to login page 14 | Open browser to login page 15 | 16 | User "${username}" logs in with password "${password}" 17 | Input user name ${username} 18 | Input password ${password} 19 | Submit credentials 20 | -------------------------------------------------------------------------------- /images/invalid_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/invalid_login.png -------------------------------------------------------------------------------- /images/invalid_login.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation Tests related to invalid login. 3 | Suite Setup Open Browser To Login Page 4 | Suite Teardown Close Browser 5 | Test Setup Go To Login Page 6 | Test Template Login With Invalid Credentials Should Fail 7 | Resource resource.robot 8 | 9 | *** Test Cases *** USER NAME PASSWORD 10 | Invalid Username invalid ${VALID PASSWORD} 11 | Invalid Password ${VALID USER} invalid 12 | Both Invalid invalid whatever 13 | Empty Username ${EMPTY} ${VALID PASSWORD} 14 | Empty Password ${VALID USER} ${EMPTY} 15 | Both Empty ${EMPTY} ${EMPTY} 16 | 17 | *** Keywords *** 18 | Login With Invalid Credentials Should Fail 19 | [Arguments] ${username} ${password} 20 | Input Username ${username} 21 | Input Password ${password} 22 | Submit Credentials 23 | Title Should Be Error Page 24 | -------------------------------------------------------------------------------- /images/keyword-driven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/keyword-driven.png -------------------------------------------------------------------------------- /images/keyword-driven.robot: -------------------------------------------------------------------------------- 1 | *** Test Cases *** 2 | Valid Login 3 | Open Browser To Login Page 4 | Input Username demo 5 | Input Password mode 6 | Submit Credentials 7 | Welcome Page Should Be Open 8 | [Teardown] Close Browser 9 | -------------------------------------------------------------------------------- /images/library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/library.png -------------------------------------------------------------------------------- /images/library.py: -------------------------------------------------------------------------------- 1 | class Selenium2Library: 2 | 3 | def input_text(self, locator, text): 4 | """Types given `text` into text field `locator`.""" 5 | print "Typing text '%s' into '%s'." % (text, locator) 6 | element = self._element_find(locator) 7 | element.clear() 8 | element.send_keys(text) 9 | 10 | def title_should_be(self, title): 11 | """Verifies that current page title equals `title`.""" 12 | actual = self.get_title() 13 | if actual != title: 14 | raise AssertionError("Title should have been '%s' but was '%s'." 15 | % (title, actual)) 16 | print "Page title is '%s'." % title 17 | 18 | 19 | # Above is real Selenium2Library code but slightly simplified. 20 | -------------------------------------------------------------------------------- /images/log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/log.png -------------------------------------------------------------------------------- /images/report-fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/report-fail.png -------------------------------------------------------------------------------- /images/report-pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/report-pass.png -------------------------------------------------------------------------------- /images/resource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/resource.png -------------------------------------------------------------------------------- /images/resource.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation A resource file with reusable keywords and variables. 3 | Library Selenium2Library 4 | 5 | *** Variables *** 6 | ${BROWSER} Firefox 7 | ${HOST} localhost:7272 8 | ${LOGIN URL} http://${HOST}/ 9 | 10 | *** Keywords *** 11 | Open Browser To Login Page 12 | Open Browser ${LOGIN URL} ${BROWSER} 13 | Maximize Browser Window 14 | Set Selenium Speed ${DELAY} 15 | Login Page Should Be Open 16 | 17 | Login Page Should Be Open 18 | Title Should Be Login Page 19 | 20 | Input Username 21 | [Arguments] ${username} 22 | Input Text username_field ${username} 23 | 24 | Input Password 25 | [Arguments] ${password} 26 | Input Text password_field ${password} 27 | -------------------------------------------------------------------------------- /images/ride-orig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/ride-orig.png -------------------------------------------------------------------------------- /images/ride.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/ride.png -------------------------------------------------------------------------------- /images/user-keywords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/user-keywords.png -------------------------------------------------------------------------------- /images/user-keywords.robot: -------------------------------------------------------------------------------- 1 | *** Keywords *** 2 | Open Browser To Login Page 3 | Open Browser ${LOGIN URL} ${BROWSER} 4 | Maximize Browser Window 5 | Set Selenium Speed ${DELAY} 6 | Login Page Should Be Open 7 | 8 | Login Page Should Be Open 9 | Title Should Be Login Page 10 | 11 | Input Username 12 | [Arguments] ${username} 13 | Input Text username_field ${username} 14 | 15 | Input Password 16 | [Arguments] ${password} 17 | Input Text password_field ${password} 18 | -------------------------------------------------------------------------------- /images/valid_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/valid_login.png -------------------------------------------------------------------------------- /images/valid_login.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation A test suite with one test for valid login. 3 | ... 4 | ... The test contains a workflow created using 5 | ... keywords in the imported resource file. 6 | Resource resource.robot 7 | 8 | *** Test Cases *** 9 | Valid Login 10 | Open Browser To Login Page 11 | Input Username demo 12 | Input Password mode 13 | Submit Credentials 14 | Welcome Page Should Be Open 15 | [Teardown] Close Browser 16 | -------------------------------------------------------------------------------- /images/variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robotframework/IntroSlides/1b2fed9c65b4d5e49caf98e5c093843c624e54e4/images/variables.png -------------------------------------------------------------------------------- /images/variables.robot: -------------------------------------------------------------------------------- 1 | *** Variables *** 2 | ${BROWSER} Firefox 3 | ${HOST} localhost:7272 4 | ${LOGIN URL} http://${HOST}/ 5 | ${WELCOME URL} http://${HOST}/welcome.html 6 | --------------------------------------------------------------------------------