SlideShare uma empresa Scribd logo
1 de 31
Sphinx + Robot Framework = documentation as
result of functional testing
PaweƂ Lewicki
Goldmund, Wyldebeast & Wunderliebe
lewicki@gw20e.com
@plewy
● Tools
● Simple example
● Useful example
Agenda
● reStructured text
● Python documentation generator
● Pluggable
● Different outputs
● Standard in Python world
Tools: Sphinx
Tools: Robot Framework
● Tests automation framework
● tool for acceptance test-driven development
● keyword-driven testing approach
● Web testing with Selenium2 library
o headless with PhantomJS
*** Variables ***
${LOGIN_URL} https://www.python.org/accounts/login/
${HOME_URL} https://www.python.org
*** Keywords ***
Open Browser To Login Page
Open Browser ${LOGIN URL}
Maximize Browser Window
Title Should Be Sign In to Python.org
test.robot(1/2)
*** Test Cases ***
Valid Login
Open Browser To Login Page
Input Text id_login demouser
Input Text id_password demopass
Click button css=.primaryAction
Location Should Be ${HOME_URL}
Page Should Contain demouser
Title Should Be Welcome To Python.org
[Teardown] Close Browser
test.robot(2/2)
Keywords - selenium2
● “Add Cookie”
● “Click Button/Image/Link”
● “Drag And Drop”
● “Element Should Contain”
● “Input Password”
● “Mouse Down”
● “Radio Button Should Be Set To”
● “Set Window Size”
Keywords - selenium2screenshots
● “Add pointy note”
● “Remove element”
● “Update element style”
● “Align elements horizontally”
● “Capture viewport screenshot”
● “Crop page screenshot”
● jQuery based functions
● buildout created with zc.buildout
● Fixture of Sphinx documentation
● reST code enriched with Robot Framework
Minimal setup
[buildout]
parts = sphinx-build
[sphinx-build]
recipe = zc.recipe.egg
eggs =
Sphinx
sphinxcontrib-robotframework [docs]
sphinx-rtd-theme
scripts =
sphinx-build
# Usage:
# bin/sphinx-build -b html docs build
Minimal setup
Minimal setup:
buildout.cfg
+---desktop
---_screenshots
---index.rst
+---tablet
---_screenshots
---index.rst
+---mobile
---_screenshots
---index.rst
conf.py
index.rst
robot.rst
_frontpage.rst
_topmenu.rst
Minimal setup: docs/
==========================
PyGrunn site documentation
==========================
.. include:: robot.rst
.. toctree::
:maxdepth: 2
:numbered:
desktop/index
tablet/index
mobile/index
docs/: index.rst
.. code:: robotframework
*** Settings ***
Resource Selenium2Screenshots/keywords.robot
*** Variables ***
${BASE_URL} = http://pygrunn.org
*** Keywords ***
Suite Teardown
Close All Browsers
docs/: robot.rst
Tablet (768x)
===============
.. code:: robotframework

 (cut part)
*** Keywords ***
Suite Setup
Open Browser ${BASE_URL}
Set window size 768 900
*** Test Cases ***
.. include:: ../_frontpage.rst
.. include:: ../_topmenu.rst
docs/: tablet/index.rst
Initial viewport
----------------
Below we can see the screenshot taken from current pyGrunn.org site.
.. figure:: _screenshots/homepage.png
.. code:: robotframework
Site homepage viewport
Go to ${BASE_URL}
Capture viewport screenshot _screenshots/homepage.png
docs/: _frontpage.rst
$bin/sphinx-build -b html docs build

and

Cropping and annotations
------------------------
Below we may see cropped and annotated page element.
.. figure:: _screenshots/topmenu.png
.. code:: robotframework
Capture annotated top menu
${note1} = Add pointy note
... css=.headerbar
... This Robot Framework stuff is very very cool!
... width=200 position=bottom
Capture and crop page screenshot _screenshots/topmenu.png
... css=.headerbar ${note1}
docs/: topmenu.rst
Useful example
● Plone theme product
● Documentation as part of testing
● Jenkins as visual regression tester
Plone product (package/egg)
● plone.app.testing
o fixture of fully working Plone site
● plone.app.robotframework
o Plone-related keywords
Plone setup: testing.py
from plone.app.testing import FunctionalTesting
from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE
EXAMPLE_THEME_ROBOT_TESTING = FunctionalTesting(
bases=(EXAMPLE_THEME_ACCEPTANCE_FIXTURE,
REMOTE_LIBRARY_BUNDLE_FIXTURE,
z2.ZSERVER_FIXTURE),
name="ExamplethemeLayer:Robot"
)
$bin/robot-server example.theme.testing.EXAMPLE_THEME_ROBOT_TESTING
Edit document
.............
.. figure:: _screenshots/document-edit.png
.. code:: robotframework
Capture Document Edit Screenshot
${uid} = Create content type=Document
... id=new-document
... title=${DUMMY_TEXT_LINE}
... description=${DUMMY_TEXT_SHORT} text=${DUMMY_TEXT}
Fire transition ${uid} publish
Go to ${PLONE_URL}/new-document/edit
Capture page screenshot _screenshots/document-edit.png
Plone setup: Robot
content creation
Keywords -
plone.app.robotframework
● “Debug”
● “Log in as test user”
● “Trigger Workflow Transition”
● “Add content”
● “Click Action by id”
● Git repository
● Bash script
virtualenv .
bin/pip install distribute
bin/python bootstrap.py
bin/buildout
bin/test
bin/sphinx-build -b html docs build
● Documentation (build/index.html)
Jenkins setup
Useful areas
● Customer documentation
● Visual coverage of theme development
o commit hooks trigger new version
● Multiple versions
o Screen sizes (responsiveness)
o Language versions
 http://www.youtube.com/watch?v=VN9FROZO5AY
o the same application many themes
● FUNCTIONAL TESTING
References
● https://github.com/lewicki/pygrunn_robot_demo
Thank you!
Questions?
PaweƂ Lewicki
Goldmund, Wyldebeast & Wunderliebe
lewicki@gw20e.com
@plewy

Mais conteĂșdo relacionado

Mais procurados

InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdfInjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
ì •ëŻŒ 안
 

Mais procurados (20)

[D2 ì˜€í”ˆì„žëŻžë‚˜]1.á„†á…źá„’á…Ąá†«á„‰á…łá„á…łá„…á…©á†Żá„‰á…„á†Œá„‚á…łá†Œá„€á…ąá„‰á…„á†«
[D2 ì˜€í”ˆì„žëŻžë‚˜]1.á„†á…źá„’á…Ąá†«á„‰á…łá„á…łá„…á…©á†Żá„‰á…„á†Œá„‚á…łá†Œá„€á…ąá„‰á…„á†«[D2 ì˜€í”ˆì„žëŻžë‚˜]1.á„†á…źá„’á…Ąá†«á„‰á…łá„á…łá„…á…©á†Żá„‰á…„á†Œá„‚á…łá†Œá„€á…ąá„‰á…„á†«
[D2 ì˜€í”ˆì„žëŻžë‚˜]1.á„†á…źá„’á…Ąá†«á„‰á…łá„á…łá„…á…©á†Żá„‰á…„á†Œá„‚á…łá†Œá„€á…ąá„‰á…„á†«
 
ëŠŹí…ì…˜ì˜ ì‚°ì¶œêłŒ 활용
ëŠŹí…ì…˜ì˜ ì‚°ì¶œêłŒ í™œìš©ëŠŹí…ì…˜ì˜ ì‚°ì¶œêłŒ 활용
ëŠŹí…ì…˜ì˜ ì‚°ì¶œêłŒ 활용
 
Ngrx slides
Ngrx slidesNgrx slides
Ngrx slides
 
Getting started with Redux js
Getting started with Redux jsGetting started with Redux js
Getting started with Redux js
 
ìœ„ì„±ìŽëŻžì§€ 객ìČŽ êČ€ì¶œ 대회 - 1등
ìœ„ì„±ìŽëŻžì§€ 객ìČŽ êČ€ì¶œ 대회 - 1ë“±ìœ„ì„±ìŽëŻžì§€ 객ìČŽ êČ€ì¶œ 대회 - 1등
ìœ„ì„±ìŽëŻžì§€ 객ìČŽ êČ€ì¶œ 대회 - 1등
 
Launching a Mobile App from Concept to Launch
Launching a Mobile App from Concept to LaunchLaunching a Mobile App from Concept to Launch
Launching a Mobile App from Concept to Launch
 
Sprinkle javascript using stimulus js
Sprinkle javascript using stimulus jsSprinkle javascript using stimulus js
Sprinkle javascript using stimulus js
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
 
Writing RESTful web services using Node.js
Writing RESTful web services using Node.jsWriting RESTful web services using Node.js
Writing RESTful web services using Node.js
 
Spring framework 3
Spring framework 3Spring framework 3
Spring framework 3
 
서ᄋᅄᆞᄀᅚᄒᅏᆚᄉᅄ Vrᄋᅄ트ᄅᅹᆚ션
서ᄋᅄᆞᄀᅚᄒᅏᆚᄉᅄ Vrᄋᅄ트ᄅᅹᆚ션서ᄋᅄᆞᄀᅚᄒᅏᆚᄉᅄ Vrᄋᅄ트ᄅᅹᆚ션
서ᄋᅄᆞᄀᅚᄒᅏᆚᄉᅄ Vrᄋᅄ트ᄅᅹᆚ션
 
Vuex to Pinia, how to migrate an existing app
Vuex to Pinia, how to migrate an existing appVuex to Pinia, how to migrate an existing app
Vuex to Pinia, how to migrate an existing app
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdfInjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
InjectionIII우 Hot Reload를 á„‹á…”á„‹á…­á†Œá„’á…Ąá„‹á…§ 윛 귀발을 좀 ᄃᅄ 편허ᄀᅊ 허ᄀᅔ.pdf
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to Hooks
 
Pythonă«ă‚ˆă‚‹Webă‚čă‚ŻăƒŹă‚€ăƒ”ăƒłă‚°ć‹‰ćŒ·äŒš
Pythonă«ă‚ˆă‚‹Webă‚čă‚ŻăƒŹă‚€ăƒ”ăƒłă‚°ć‹‰ćŒ·äŒšPythonă«ă‚ˆă‚‹Webă‚čă‚ŻăƒŹă‚€ăƒ”ăƒłă‚°ć‹‰ćŒ·äŒš
Pythonă«ă‚ˆă‚‹Webă‚čă‚ŻăƒŹă‚€ăƒ”ăƒłă‚°ć‹‰ćŒ·äŒš
 
MOBILITY X DATA : ëȘšëčŒëŠŹí‹° 산업의 도전 êłŒì œ
MOBILITY X DATA : ëȘšëčŒëŠŹí‹° 산업의 도전 êłŒì œMOBILITY X DATA : ëȘšëčŒëŠŹí‹° 산업의 도전 êłŒì œ
MOBILITY X DATA : ëȘšëčŒëŠŹí‹° 산업의 도전 êłŒì œ
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 

Destaque

Robot framework
Robot frameworkRobot framework
Robot framework
boriau
 
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
RIF-Technology
 
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
Antti Pohjonen
 

Destaque (20)

Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using Sphinx
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
 
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
ATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot Framework
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 
Understanding Your Group Life Insurance Benefit
Understanding Your Group Life Insurance BenefitUnderstanding Your Group Life Insurance Benefit
Understanding Your Group Life Insurance Benefit
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
 
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot Overlords
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with Jenkins
 
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
ĐĐœŃ‚ĐŸĐœ ĐĄĐ”ĐŒĐ”ĐœŃ‡Đ”ĐœĐșĐŸ | (EPAM Systems, DPI.Solutions )СраĐČĐœĐžŃ‚Đ”Đ»ŃŒĐœŃ‹ĐžÌ† Đ°ĐœĐ°Đ»ĐžĐ· ĐžĐœŃŃ‚Ń€Ńƒ...
 
Đ’ŃŃ‡Đ”ŃĐ»Đ°ĐČ Đ§Đ”Ń€ĐœĐžĐșĐŸĐČ (Binwell) | Xamarin ĐœĐ° праĐșтоĐșĐ”
Đ’ŃŃ‡Đ”ŃĐ»Đ°ĐČ Đ§Đ”Ń€ĐœĐžĐșĐŸĐČ (Binwell) | Xamarin ĐœĐ° праĐșтоĐșĐ” Đ’ŃŃ‡Đ”ŃĐ»Đ°ĐČ Đ§Đ”Ń€ĐœĐžĐșĐŸĐČ (Binwell) | Xamarin ĐœĐ° праĐșтоĐșĐ”
Đ’ŃŃ‡Đ”ŃĐ»Đ°ĐČ Đ§Đ”Ń€ĐœĐžĐșĐŸĐČ (Binwell) | Xamarin ĐœĐ° праĐșтоĐșĐ”
 
Metrics to guide: agile fluency, continuous delivery and product teams
Metrics to guide: agile fluency, continuous delivery and product teamsMetrics to guide: agile fluency, continuous delivery and product teams
Metrics to guide: agile fluency, continuous delivery and product teams
 
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
Continuous Deployment pipeline demonstration spiced with Robot Framework and ...
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 

Semelhante a Sphinx + robot framework = documentation as result of functional testing

Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
LumoSpark
 

Semelhante a Sphinx + robot framework = documentation as result of functional testing (20)

Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
Mini Curso de Django
Mini Curso de DjangoMini Curso de Django
Mini Curso de Django
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the future
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Mini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico CesMini Curso Django Ii Congresso Academico Ces
Mini Curso Django Ii Congresso Academico Ces
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using Django
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
Web Scrapping Using Python
Web Scrapping Using PythonWeb Scrapping Using Python
Web Scrapping Using Python
 

Último

Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Bert Jan Schrijver
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] đŸ„ Women's Abortion Clinic in T...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 

Sphinx + robot framework = documentation as result of functional testing

  • 1. Sphinx + Robot Framework = documentation as result of functional testing PaweƂ Lewicki Goldmund, Wyldebeast & Wunderliebe lewicki@gw20e.com @plewy
  • 2. ● Tools ● Simple example ● Useful example Agenda
  • 3. ● reStructured text ● Python documentation generator ● Pluggable ● Different outputs ● Standard in Python world Tools: Sphinx
  • 4. Tools: Robot Framework ● Tests automation framework ● tool for acceptance test-driven development ● keyword-driven testing approach ● Web testing with Selenium2 library o headless with PhantomJS
  • 5. *** Variables *** ${LOGIN_URL} https://www.python.org/accounts/login/ ${HOME_URL} https://www.python.org *** Keywords *** Open Browser To Login Page Open Browser ${LOGIN URL} Maximize Browser Window Title Should Be Sign In to Python.org test.robot(1/2)
  • 6. *** Test Cases *** Valid Login Open Browser To Login Page Input Text id_login demouser Input Text id_password demopass Click button css=.primaryAction Location Should Be ${HOME_URL} Page Should Contain demouser Title Should Be Welcome To Python.org [Teardown] Close Browser test.robot(2/2)
  • 7. Keywords - selenium2 ● “Add Cookie” ● “Click Button/Image/Link” ● “Drag And Drop” ● “Element Should Contain” ● “Input Password” ● “Mouse Down” ● “Radio Button Should Be Set To” ● “Set Window Size”
  • 8. Keywords - selenium2screenshots ● “Add pointy note” ● “Remove element” ● “Update element style” ● “Align elements horizontally” ● “Capture viewport screenshot” ● “Crop page screenshot” ● jQuery based functions
  • 9. ● buildout created with zc.buildout ● Fixture of Sphinx documentation ● reST code enriched with Robot Framework Minimal setup
  • 10. [buildout] parts = sphinx-build [sphinx-build] recipe = zc.recipe.egg eggs = Sphinx sphinxcontrib-robotframework [docs] sphinx-rtd-theme scripts = sphinx-build # Usage: # bin/sphinx-build -b html docs build Minimal setup Minimal setup: buildout.cfg
  • 12. ========================== PyGrunn site documentation ========================== .. include:: robot.rst .. toctree:: :maxdepth: 2 :numbered: desktop/index tablet/index mobile/index docs/: index.rst
  • 13. .. code:: robotframework *** Settings *** Resource Selenium2Screenshots/keywords.robot *** Variables *** ${BASE_URL} = http://pygrunn.org *** Keywords *** Suite Teardown Close All Browsers docs/: robot.rst
  • 14. Tablet (768x) =============== .. code:: robotframework 
 (cut part) *** Keywords *** Suite Setup Open Browser ${BASE_URL} Set window size 768 900 *** Test Cases *** .. include:: ../_frontpage.rst .. include:: ../_topmenu.rst docs/: tablet/index.rst
  • 15. Initial viewport ---------------- Below we can see the screenshot taken from current pyGrunn.org site. .. figure:: _screenshots/homepage.png .. code:: robotframework Site homepage viewport Go to ${BASE_URL} Capture viewport screenshot _screenshots/homepage.png docs/: _frontpage.rst
  • 16. $bin/sphinx-build -b html docs build 
and

  • 17.
  • 18.
  • 19. Cropping and annotations ------------------------ Below we may see cropped and annotated page element. .. figure:: _screenshots/topmenu.png .. code:: robotframework Capture annotated top menu ${note1} = Add pointy note ... css=.headerbar ... This Robot Framework stuff is very very cool! ... width=200 position=bottom Capture and crop page screenshot _screenshots/topmenu.png ... css=.headerbar ${note1} docs/: topmenu.rst
  • 20.
  • 21. Useful example ● Plone theme product ● Documentation as part of testing ● Jenkins as visual regression tester
  • 22. Plone product (package/egg) ● plone.app.testing o fixture of fully working Plone site ● plone.app.robotframework o Plone-related keywords
  • 23. Plone setup: testing.py from plone.app.testing import FunctionalTesting from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE EXAMPLE_THEME_ROBOT_TESTING = FunctionalTesting( bases=(EXAMPLE_THEME_ACCEPTANCE_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE), name="ExamplethemeLayer:Robot" ) $bin/robot-server example.theme.testing.EXAMPLE_THEME_ROBOT_TESTING
  • 24. Edit document ............. .. figure:: _screenshots/document-edit.png .. code:: robotframework Capture Document Edit Screenshot ${uid} = Create content type=Document ... id=new-document ... title=${DUMMY_TEXT_LINE} ... description=${DUMMY_TEXT_SHORT} text=${DUMMY_TEXT} Fire transition ${uid} publish Go to ${PLONE_URL}/new-document/edit Capture page screenshot _screenshots/document-edit.png Plone setup: Robot content creation
  • 25. Keywords - plone.app.robotframework ● “Debug” ● “Log in as test user” ● “Trigger Workflow Transition” ● “Add content” ● “Click Action by id”
  • 26. ● Git repository ● Bash script virtualenv . bin/pip install distribute bin/python bootstrap.py bin/buildout bin/test bin/sphinx-build -b html docs build ● Documentation (build/index.html) Jenkins setup
  • 27.
  • 28.
  • 29. Useful areas ● Customer documentation ● Visual coverage of theme development o commit hooks trigger new version ● Multiple versions o Screen sizes (responsiveness) o Language versions  http://www.youtube.com/watch?v=VN9FROZO5AY o the same application many themes ● FUNCTIONAL TESTING
  • 31. Thank you! Questions? PaweƂ Lewicki Goldmund, Wyldebeast & Wunderliebe lewicki@gw20e.com @plewy