SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech TalkArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech TalkRed Hat Developers
 
View customize pluginを使いこなす
View customize pluginを使いこなすView customize pluginを使いこなす
View customize pluginを使いこなすonozaty
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL ConceptCharile Tsai
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONAjit Yadav
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the boxKangaroot
 
Infra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInfra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInho Kang
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CICEE-SEC(R)
 
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityBenjamin Zores
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdBilly Yuen
 

Was ist angesagt? (20)

ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech TalkArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
 
View customize pluginを使いこなす
View customize pluginを使いこなすView customize pluginを使いこなす
View customize pluginを使いこなす
 
Android AIDL Concept
Android AIDL ConceptAndroid AIDL Concept
Android AIDL Concept
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
GraalVM
GraalVMGraalVM
GraalVM
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box
 
NodeJS
NodeJSNodeJS
NodeJS
 
Infra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and TerraformInfra as Code with Packer, Ansible and Terraform
Infra as Code with Packer, Ansible and Terraform
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CI
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 
React js basics
React js basicsReact js basics
React js basics
 
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet ConnectivityELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
ELCE 2012 - Dive into Android Networking: Adding Ethernet Connectivity
 
Android Binder: Deep Dive
Android Binder: Deep DiveAndroid Binder: Deep Dive
Android Binder: Deep Dive
 
Spring Webflux
Spring WebfluxSpring Webflux
Spring Webflux
 
CI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cdCI:CD in Lightspeed with kubernetes and argo cd
CI:CD in Lightspeed with kubernetes and argo cd
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 

Andere mochten auch

Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using SphinxMarkus Zapke-Gründemann
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Frameworklaurent bristiel
 
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)Takayuki Shimizukawa
 
Robot framework
Robot frameworkRobot framework
Robot frameworkboriau
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introductionlaurent bristiel
 
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 FrameworkAgile Testing Alliance
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationSauce Labs
 
Understanding Your Group Life Insurance Benefit
Understanding Your Group Life Insurance BenefitUnderstanding Your Group Life Insurance Benefit
Understanding Your Group Life Insurance BenefitVan Richards
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Seleniumadamcarmi
 
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 OverlordsSteve Malsam
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with JenkinsVishal Nayak
 
Антон Семенченко | (EPAM Systems, DPI.Solutions )Сравнительный анализ инстру...
Антон Семенченко | (EPAM Systems, DPI.Solutions )Сравнительный анализ инстру...Антон Семенченко | (EPAM Systems, DPI.Solutions )Сравнительный анализ инстру...
Антон Семенченко | (EPAM Systems, DPI.Solutions )Сравнительный анализ инстру...RIF-Technology
 
Вячеслав Черников (Binwell) | Xamarin на практике
Вячеслав Черников (Binwell) | Xamarin на практике Вячеслав Черников (Binwell) | Xamarin на практике
Вячеслав Черников (Binwell) | Xamarin на практике RIF-Technology
 
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 teamsWouter Lagerweij
 
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
 
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 JenkinsSylwester Madej
 
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 DeploymentMax Klymyshyn
 

Andere mochten auch (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
 

Ähnlich wie Sphinx + robot framework = documentation as result of functional testing

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...Pantheon
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingAlessandro Molina
 
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 pageobjectsLeticia Rss
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoJames Casey
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the futureDA-14
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
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 VersionThomas Daly
 
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 CesLeonardo Fernandes
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introductionJoel W. King
 
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 PloneVincenzo Barone
 
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 symfonyFrancois Zaninotto
 
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-)Bastian Feder
 
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 DjangoSunil kumar Mohanty
 
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
 
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)dantleech
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 

Kürzlich hochgeladen (20)

Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 

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