SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Acceptance testing! 
Plone sites and add-ons 
with Robot Framework! 
and Selenium 
Asko Soukka, asko.soukka@iki.fi 
University of Jyväskylä, Finland
Hello! 
+ Asko Soukka 
Twitter: @datakurre 
IRC: datakurre 
Email: asko.soukka@iki.fi 
Web: datakurre.pandala.org 
+ Software developer at 
University of Jyväskylä 
Finland 
+ Plone Foundation Member
Menu 
Terminology! 
+ Acceptance testing 
+ Robot framework 
+ Selenium 
! 
Acceptance testing Plone! 
+ Just do it with a live instance 
+ Do it safely with a dedicated instance 
+ Do it correctly in a p.a.testing sandbox 
+ Do it with while writing your 
documentation with screenshots 
!
Acceptance testing 
Functional testing of user stories! 
! 
! 
Scenario: As an editor I can translate a document 
Given a site owner 
and a document in English 
When I translate the document into Catalan 
Then I can view the document in Catalan
Acceptance tests 
! 
Integration tests 
! 
! 
! 
Unit tests 
! 
!
Robot Framework 
! 
Keyword driven testing in your own 
domain specific language! 
! 
Extend with Python, Java or XML-RPC 
$ pip install robotframework 
$ pybot —-help 
$ pybot my_test_suite.robot
Robot Framework 
*** Settings *** 
! 
Library string WITH NAME string 
! 
*** Test Cases *** 
! 
Convert string to uppercase 
${value} = string.upper twist and shout! 
Should be equal ${value} TWIST AND SHOUT!
! 
*** Settings *** 
! 
Library ... 
Resource ... 
! 
*** Variables *** 
${NAME} value 
! 
*** Test Cases *** 
Scenario title 
Some keyword argument ${NAME} 
! 
*** Keywords *** 
! 
Some keyword 
[Arguments] ${arg1} ${arg2} 
Another keyword ${arg1} ${arg2} 
! 
! 
test_suite.robot!
Selenium 
Browser automation framework! 
! 
All browser and service logos and trademarks on this slide are property of their respective owners.
Selenium2Library 
Selenium2 (WebDriver) keywords! 
for Robot Framework! 
$ pip install robotframework-selenium2library 
$ pybot —-help 
$ pybot my_selenium_test_suite.robot
Selenium2Library 
*** Settings *** 
! 
Library Selenium2Library 
! 
*** Test Cases *** 
! 
Front-page should contain search box 
Open browser https://www.jyu.fi/ 
Element should be visible 
... css=form[name='searchform'] input 
[Teardown] Close all browsers 
!
Testing Plone with live data 
[buildout] 
parts += testinstance 
! 
[testinstance] 
recipe = plone.recipe.zope2instance 
... 
eggs = 
... 
zc.beforestorage 
Products.PrintingMailHost 
... 
before-storage = now 
demo-storage = true 
shared-blob = false
Testing Plone add-ons 
*** Settings *** 
! 
Resource plone/app/robotframework/selenium.robot 
Library Remote ${PLONE_URL}/RobotRemote 
! 
*** Test Cases *** 
! 
Scenario: Powered by Plone remains visible 
Open test browser 
Go to ${PLONE_URL} 
Page should contain Powered by Plone 
[Teardown] Close all browsers
Testing Plone add-ons 
import unittest 
! 
import robotsuite 
from myproduct.testing import MYPRODUCT_ROBOT_TESTING 
from plone.testing import layered 
! 
! 
def test_suite(): 
suite = unittest.TestSuite() 
suite.addTests([layered( 
robotsuite.RobotTestSuite(’test_hello.robot'), 
layer=MYPRODUCT_ROBOT_TESTING)]) 
return suite
Testing Plone add-ons 
from plone.testing import z2 
from plone.app.testing import FunctionalTesting 
from plone.app.robotframework.testing import  
REMOTE_LIBRARY_BUNDLE_FIXTURE 
! 
MYPRODUCT_ROBOT_TESTING = FunctionalTesting( 
bases=(MYPRODUCT_FIXTURE, 
REMOTE_LIBRARY_BUNDLE_FIXTURE, 
z2.ZSERVER_FIXTURE), 
name="MyProduct:Robot")
Testing Plone add-ons 
from plone.testing import z2 
from plone.app.testing import FunctionalTesting 
from plone.app.robotframework.testing import  
REMOTE_LIBRARY_BUNDLE_FIXTURE 
! 
MYPRODUCT_ROBOT_TESTING = FunctionalTesting( 
bases=(MYPRODUCT_FIXTURE, 
REMOTE_LIBRARY_BUNDLE_FIXTURE, 
z2.ZSERVER_FIXTURE), 
name="MyProduct:Robot")
Testing Plone add-ons 
http://docs.plone.org/search.html?q=robotframework 
extras_require={ 
'test': [ 
... 
'plone.app.robotframework', 
], 
},
To BDD or not to… 
... 
Scenario: As an editor I can translate a document 
Given a site owner 
and a document in English 
When I translate the document into Catalan 
Then I can view the document in Catalan 
! 
*** Keywords *** 
! 
A site owner 
Enable autologin as Site Administrator 
...
Testing Plone with live data 
! 
eggs = 
... 
plone.app.robotframework 
collective.monkeypatcher 
... 
zcml-additional = 
<configure 
xmlns="http://namespaces.zope.org/zope" 
xmlns:monkey="http://namespaces.plone.org/monkey"> 
<include package="collective.monkeypatcher" /> 
<monkey:patch 
description="Enable Robot Framework remote library" 
class="Products.CMFPlone.Portal.PloneSite" 
original="RobotRemote" 
replacement="plone.app.robotframework.testing.RobotRemote" 
ignoreOriginal="true" 
/> 
</configure> 
REVISITED!
Sphinx integration 
extensions = ['sphinxcontrib_robotframework'] 
.. code:: robotframework 
! 
*** Settings *** 
! 
Library string WITH NAME string 
! 
*** Test Cases *** 
! 
Convert string to uppercase 
...
$ pip install Sphinx 
$ pip install sphinxcontrib-robotframework 
$ pip install robotframework-selenium2library 
.. figure:: ploneconf.png 
.. code:: robotframework 
! 
*** Settings *** 
! 
Library Selenium2Library 
! 
*** Test Cases *** 
! 
Show Plone Conference 2014 website 
Open browser http://2014.ploneconf.org/ 
Capture page screenshot ploneconf.png 
[Teardown] Close all browsers
! 
.. figure:: portal-footer.png 
.. code:: robotframework 
! 
*** Settings *** 
! 
Resource plone/app/robotframework/server.robot 
Resource Selenium2Screenshots/keywords.robot 
! 
*** Test Cases *** 
! 
Scenario: Powered by Plone remains visible 
Setup Plone site 
... plone.app.testing.PLONE_ZSERVER 
Go to ${PLONE_URL} 
Page should contain Powered by Plone 
Capture and crop page screenshot 
... portal-footer.png id=portal-footer 
[Teardown] Run keywords 
... Tear down Plone site 
... Close all browsers 
!
More 
+ Robot Framework 
http://robotframework.org/ 
+ Selenium2Library (for Robot Framework) 
https://github.com/rtomac/robotframework-selenium2library 
+ Overview of Plone-related Robot ecosystem 
http://datakurre.pandala.org/2013/09/meet-robot-family- 
for-plone-developers.html

Weitere ähnliche Inhalte

Was ist angesagt?

Robot framework
Robot frameworkRobot framework
Robot framework
boriau
 

Was ist angesagt? (20)

Sphinx + robot framework = documentation as result of functional testing
Sphinx + robot framework = documentation as result of functional testingSphinx + robot framework = documentation as result of functional testing
Sphinx + robot framework = documentation as result of functional testing
 
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot Framework
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
Robot framework - Lord of the Rings
Robot framework - Lord of the RingsRobot framework - Lord of the Rings
Robot framework - Lord of the Rings
 
Robot Framework :: Demo login application
Robot Framework :: Demo login applicationRobot Framework :: Demo login application
Robot Framework :: Demo login application
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot framework
 
Robot framework Gowthami Goli
Robot framework Gowthami GoliRobot framework Gowthami Goli
Robot framework Gowthami Goli
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
Introduction to Robot Framework (external)
Introduction to Robot Framework (external)Introduction to Robot Framework (external)
Introduction to Robot Framework (external)
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Perl Continous Integration
Perl Continous IntegrationPerl Continous Integration
Perl Continous Integration
 
Smolder Introduction
Smolder IntroductionSmolder Introduction
Smolder Introduction
 

Andere mochten auch

Présentation de Robot framework
Présentation de Robot frameworkPrésentation de Robot framework
Présentation de Robot framework
gilleslenfant
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
onlinemindq
 

Andere mochten auch (17)

Steps to register a foreign invested company
Steps to register a foreign invested companySteps to register a foreign invested company
Steps to register a foreign invested company
 
Functional Tests Automation with Robot Framework
Functional Tests Automation with Robot FrameworkFunctional Tests Automation with Robot Framework
Functional Tests Automation with Robot Framework
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Robot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh MRobot Framework : Lord of the Rings By Asheesh M
Robot Framework : Lord of the Rings By Asheesh M
 
Web testing automation
Web testing automationWeb testing automation
Web testing automation
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
SEO Footprints by www.Netrix.co.uk - Comprehensive Guide to Website Footprints
SEO Footprints by www.Netrix.co.uk - Comprehensive Guide to Website FootprintsSEO Footprints by www.Netrix.co.uk - Comprehensive Guide to Website Footprints
SEO Footprints by www.Netrix.co.uk - Comprehensive Guide to Website Footprints
 
Automation using RobotFramework for embedded device
Automation using RobotFramework for embedded deviceAutomation using RobotFramework for embedded device
Automation using RobotFramework for embedded device
 
ELA-The Finishing School
ELA-The Finishing SchoolELA-The Finishing School
ELA-The Finishing School
 
Présentation de Robot framework
Présentation de Robot frameworkPrésentation de Robot framework
Présentation de Robot framework
 
Echelon2010
Echelon2010Echelon2010
Echelon2010
 
Making Add-ons People Will Love
Making Add-ons People Will LoveMaking Add-ons People Will Love
Making Add-ons People Will Love
 
Browser add-ons
Browser add-onsBrowser add-ons
Browser add-ons
 
Robot handles
Robot handlesRobot handles
Robot handles
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
 

Ähnlich wie Acceptance testing plone sites and add ons with robot framework and selenium

IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
julien.ponge
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
ericholscher
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123
Parag Gajbhiye
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?
Tobias Schneck
 

Ähnlich wie Acceptance testing plone sites and add ons with robot framework and selenium (20)

Getting Started with Pelican
Getting Started with PelicanGetting Started with Pelican
Getting Started with Pelican
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
Browser-level testing
Browser-level testingBrowser-level testing
Browser-level testing
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or less
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
 
Phing
PhingPhing
Phing
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
 
Introduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI PotsdamIntroduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI Potsdam
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zope
 
cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123cdac@parag.gajbhiye@test123
cdac@parag.gajbhiye@test123
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?
 
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
 
Selenium
SeleniumSelenium
Selenium
 

Mehr von Asko Soukka

Plone, rabbit mq and messaging that just works
Plone, rabbit mq and messaging that just worksPlone, rabbit mq and messaging that just works
Plone, rabbit mq and messaging that just works
Asko Soukka
 

Mehr von Asko Soukka (9)

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Embedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into PloneEmbedding BPMN-driven business processes into Plone
Embedding BPMN-driven business processes into Plone
 
Plone and Volto in a Jamstack project
Plone and Volto in a Jamstack projectPlone and Volto in a Jamstack project
Plone and Volto in a Jamstack project
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
 
How Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content MeshHow Plone Excels in GatsbyJS Content Mesh
How Plone Excels in GatsbyJS Content Mesh
 
ZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket SupportZServer Reloaded with HTTP/2 and WebSocket Support
ZServer Reloaded with HTTP/2 and WebSocket Support
 
Building instant features with advanced Plone themes
Building instant features with advanced Plone themesBuilding instant features with advanced Plone themes
Building instant features with advanced Plone themes
 
Nix for Python developers
Nix for Python developersNix for Python developers
Nix for Python developers
 
Plone, rabbit mq and messaging that just works
Plone, rabbit mq and messaging that just worksPlone, rabbit mq and messaging that just works
Plone, rabbit mq and messaging that just works
 

Kürzlich hochgeladen

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Kürzlich hochgeladen (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 

Acceptance testing plone sites and add ons with robot framework and selenium

  • 1. Acceptance testing! Plone sites and add-ons with Robot Framework! and Selenium Asko Soukka, asko.soukka@iki.fi University of Jyväskylä, Finland
  • 2. Hello! + Asko Soukka Twitter: @datakurre IRC: datakurre Email: asko.soukka@iki.fi Web: datakurre.pandala.org + Software developer at University of Jyväskylä Finland + Plone Foundation Member
  • 3. Menu Terminology! + Acceptance testing + Robot framework + Selenium ! Acceptance testing Plone! + Just do it with a live instance + Do it safely with a dedicated instance + Do it correctly in a p.a.testing sandbox + Do it with while writing your documentation with screenshots !
  • 4. Acceptance testing Functional testing of user stories! ! ! Scenario: As an editor I can translate a document Given a site owner and a document in English When I translate the document into Catalan Then I can view the document in Catalan
  • 5. Acceptance tests ! Integration tests ! ! ! Unit tests ! !
  • 6. Robot Framework ! Keyword driven testing in your own domain specific language! ! Extend with Python, Java or XML-RPC $ pip install robotframework $ pybot —-help $ pybot my_test_suite.robot
  • 7. Robot Framework *** Settings *** ! Library string WITH NAME string ! *** Test Cases *** ! Convert string to uppercase ${value} = string.upper twist and shout! Should be equal ${value} TWIST AND SHOUT!
  • 8. ! *** Settings *** ! Library ... Resource ... ! *** Variables *** ${NAME} value ! *** Test Cases *** Scenario title Some keyword argument ${NAME} ! *** Keywords *** ! Some keyword [Arguments] ${arg1} ${arg2} Another keyword ${arg1} ${arg2} ! ! test_suite.robot!
  • 9.
  • 10.
  • 11. Selenium Browser automation framework! ! All browser and service logos and trademarks on this slide are property of their respective owners.
  • 12. Selenium2Library Selenium2 (WebDriver) keywords! for Robot Framework! $ pip install robotframework-selenium2library $ pybot —-help $ pybot my_selenium_test_suite.robot
  • 13. Selenium2Library *** Settings *** ! Library Selenium2Library ! *** Test Cases *** ! Front-page should contain search box Open browser https://www.jyu.fi/ Element should be visible ... css=form[name='searchform'] input [Teardown] Close all browsers !
  • 14.
  • 15. Testing Plone with live data [buildout] parts += testinstance ! [testinstance] recipe = plone.recipe.zope2instance ... eggs = ... zc.beforestorage Products.PrintingMailHost ... before-storage = now demo-storage = true shared-blob = false
  • 16. Testing Plone add-ons *** Settings *** ! Resource plone/app/robotframework/selenium.robot Library Remote ${PLONE_URL}/RobotRemote ! *** Test Cases *** ! Scenario: Powered by Plone remains visible Open test browser Go to ${PLONE_URL} Page should contain Powered by Plone [Teardown] Close all browsers
  • 17. Testing Plone add-ons import unittest ! import robotsuite from myproduct.testing import MYPRODUCT_ROBOT_TESTING from plone.testing import layered ! ! def test_suite(): suite = unittest.TestSuite() suite.addTests([layered( robotsuite.RobotTestSuite(’test_hello.robot'), layer=MYPRODUCT_ROBOT_TESTING)]) return suite
  • 18. Testing Plone add-ons from plone.testing import z2 from plone.app.testing import FunctionalTesting from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE ! MYPRODUCT_ROBOT_TESTING = FunctionalTesting( bases=(MYPRODUCT_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE), name="MyProduct:Robot")
  • 19. Testing Plone add-ons from plone.testing import z2 from plone.app.testing import FunctionalTesting from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE ! MYPRODUCT_ROBOT_TESTING = FunctionalTesting( bases=(MYPRODUCT_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE), name="MyProduct:Robot")
  • 20. Testing Plone add-ons http://docs.plone.org/search.html?q=robotframework extras_require={ 'test': [ ... 'plone.app.robotframework', ], },
  • 21. To BDD or not to… ... Scenario: As an editor I can translate a document Given a site owner and a document in English When I translate the document into Catalan Then I can view the document in Catalan ! *** Keywords *** ! A site owner Enable autologin as Site Administrator ...
  • 22. Testing Plone with live data ! eggs = ... plone.app.robotframework collective.monkeypatcher ... zcml-additional = <configure xmlns="http://namespaces.zope.org/zope" xmlns:monkey="http://namespaces.plone.org/monkey"> <include package="collective.monkeypatcher" /> <monkey:patch description="Enable Robot Framework remote library" class="Products.CMFPlone.Portal.PloneSite" original="RobotRemote" replacement="plone.app.robotframework.testing.RobotRemote" ignoreOriginal="true" /> </configure> REVISITED!
  • 23. Sphinx integration extensions = ['sphinxcontrib_robotframework'] .. code:: robotframework ! *** Settings *** ! Library string WITH NAME string ! *** Test Cases *** ! Convert string to uppercase ...
  • 24.
  • 25. $ pip install Sphinx $ pip install sphinxcontrib-robotframework $ pip install robotframework-selenium2library .. figure:: ploneconf.png .. code:: robotframework ! *** Settings *** ! Library Selenium2Library ! *** Test Cases *** ! Show Plone Conference 2014 website Open browser http://2014.ploneconf.org/ Capture page screenshot ploneconf.png [Teardown] Close all browsers
  • 26.
  • 27. ! .. figure:: portal-footer.png .. code:: robotframework ! *** Settings *** ! Resource plone/app/robotframework/server.robot Resource Selenium2Screenshots/keywords.robot ! *** Test Cases *** ! Scenario: Powered by Plone remains visible Setup Plone site ... plone.app.testing.PLONE_ZSERVER Go to ${PLONE_URL} Page should contain Powered by Plone Capture and crop page screenshot ... portal-footer.png id=portal-footer [Teardown] Run keywords ... Tear down Plone site ... Close all browsers !
  • 28.
  • 29.
  • 30. More + Robot Framework http://robotframework.org/ + Selenium2Library (for Robot Framework) https://github.com/rtomac/robotframework-selenium2library + Overview of Plone-related Robot ecosystem http://datakurre.pandala.org/2013/09/meet-robot-family- for-plone-developers.html