SlideShare a Scribd company logo
Pruebas en Conceptos básicos y ejemplos
¿qué son y para qué sirven?
 
Unit testing will make you more attractive to the opposite sex.  Martin Aspeli
pruebas unitarias pruebas de integración pruebas funcionales pruebas de sistema
unittest doctest
pruebas unitarias y de integración
base.py from Testing import ZopeTestCase ZopeTestCase.installProduct('My Product') from Products.PloneTestCase.PloneTestCase import PloneTestCase from Products.PloneTestCase.PloneTestCase import FunctionalTestCase from Products.PloneTestCase.PloneTestCase import setupPloneSite setupPloneSite(products=['My Product']) class MyProductTestCase(PloneTestCase): """We use this base class for all the tests in this package. If necessary, we can put common utility or setup code in here. This applies to unit test cases. """ class MyProductFunctionalTestCase(FunctionalTestCase): """We use this class for functional integration tests that use doctest syntax. Again, we can put basic common utility or setup code in here. """
my_test.py import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from base import MyProductTestCase class TestClass(MyProductTestCase): """Tests for this and that...""" ... def test_suite(): from unittest import TestSuite, makeSuite suite = TestSuite() ... suite.addTest(makeSuite(TestClass)) ... return suite if __name__ == '__main__': framework()
Instalación de skins y recursos class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.skins  = self.portal.portal_skins self.csstool = self.portal.portal_css self.jstool  = self.portal.portal_javascripts ... def testSkinLayersInstalled(self): """Verifies the skin layer was registered""" self.failUnless('my_product_skin' in self.skins.objectIds()) def testCssInstalled(self): """Verifies the associated CSS file was registered""" stylesheetids = self.csstool.getResourceIds() self.failUnless('my_css_id' in stylesheetids) def testJavascriptsInstalled(self): """Verifies the associated JavaScript file was registered""" javascriptids = self.jstool.getResourceIds() self.failUnless('my_js_id' in javascriptids)
Instalación de tipos de contenido class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.types  = self.portal.portal_types self.factory  = self.portal.portal_factory ... def testTypesInstalled(self): """Verifies the content type was installed""" self.failUnless('My Type' in self.types.objectIds()) def testPortalFactorySetup(self): """Verifies the content type was registered in the portal factory. The portal factory ensures that new objects are created in a well-behaved fashion. """ self.failUnless('My Type' in self.factory.getFactoryTypes())
Instalación de tools y configlets class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.config = self.portal.portal_controlpanel ... def testToolInstalled(self): """Verifies a tool was installed""" self.failUnless(getattr(self.portal, 'my_tool', None) is not None) def testConfigletInstalled(self): """Verifies a configlet was installed""" configlets = list(self.config.listActions()) self.failUnless('my_configlet_id' in configlets)
Verificando recursos de Kupu class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.kupu = self.portal.kupu_library_tool ... def testKupuResourcesSetup(self): """Verifies the content type can be linked inside Kupu""" linkable = self.kupu.getPortalTypesForResourceType('linkable') self.failUnless('My Type' in linkable)
Verificando otras propiedades class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.props = self.portal.portal_properties ... def testDefaultPageTypes(self): """Verifies the content type can be used as the default page in a container object like a folder. """ self.failUnless('My Type' in self.props.site_properties.getProperty('default_page_types'))
Desinstalación del producto class TestUninstall(MyProductTestCase): """Ensure product is properly uninstalled""" def afterSetUp(self): ... self.qitool = self.portal.portal_quickinstaller self.qitool.uninstallProducts(products=['My Product']) ... def testProductUninstalled(self): """Verifies the product was uninstalled""" self.failIf(self.qitool.isProductInstalled('My Product'))
Implementación from Interface.Verify import verifyObject from Products.ATContentTypes.interface import IATContentType from Products.MyProduct.interfaces import IMyProduct class TestContentType(MyProductTestCase): """Ensure content type implementation""" def afterSetUp(self): self.folder.invokeFactory('My Type', 'mytype1') self.mytype1 = getattr(self.folder, 'mytype1') def testImplementsATContentType(self): """Verifies the object implements the base Archetypes interface""" iface = IATContentType self.failUnless(iface.providedBy(self.mytype1)) self.failUnless(verifyObject(iface, self.mytype1)) def testImplementsMyType(self): """Verifies the object implements the content type interface""" iface = IMyType self.failUnless(iface.providedBy(self.mytype1)) self.failUnless(verifyObject(iface, self.mytype1))
Creación y edición de contenido class TestContentCreation(MyProductTestCase): """Ensure content type can be created and edited""" def afterSetUp(self): self.folder.invokeFactory('My Type', 'mytype1') self.mytype1 = getattr(self.folder, 'mytype1') def testCreateMyType(self): """Verifies the object has been created""" self.failUnless('mytype1' in self.folder.objectIds()) def testEditMyType(self): """Verifies the object can be properly edited""" self.mytype1.setTitle('A title') self.mytype1.setDescription('A description') ... self.assertEqual(self.mytype1.Title(), 'A title') self.assertEqual(self.mytype1.Description(), 'A description') ...
 
pruebas funcionales y de sistema
zope.testbrowser zope.testrecorder Es elegante y fácil de usar, pero no soporta JavaScript Permite grabar las pruebas en formato zope.testbrowser o Selenium
Selenium IDE Selenium Remote Control Selenium Grid
Más información ,[object Object],[object Object],[object Object],[object Object],[object Object]
gracias

More Related Content

What's hot

Understanding JavaScript Testing
Understanding JavaScript TestingUnderstanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJS
Jim Lynch
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
Michael Haberman
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic Peopledavismr
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
Anup Singh
 
Unit testing of java script and angularjs application using Karma Jasmine Fra...
Unit testing of java script and angularjs application using Karma Jasmine Fra...Unit testing of java script and angularjs application using Karma Jasmine Fra...
Unit testing of java script and angularjs application using Karma Jasmine Fra...
Samyak Bhalerao
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your Database
David Wheeler
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
foxp2code
 
Test
TestTest
Test
Eddie Kao
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
Chiew Carol
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with Jest
Michał Pierzchała
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
Arulalan T
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
Carsten Sandtner
 
Agile Swift
Agile SwiftAgile Swift
Agile Swift
Godfrey Nolan
 
Mocking in Java with Mockito
Mocking in Java with MockitoMocking in Java with Mockito
Mocking in Java with MockitoRichard Paul
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
sgleadow
 
Isomorphic React Apps Testing
Isomorphic React Apps TestingIsomorphic React Apps Testing
Isomorphic React Apps Testing
Mikhail Larchanka
 

What's hot (20)

Understanding JavaScript Testing
Understanding JavaScript TestingUnderstanding JavaScript Testing
Understanding JavaScript Testing
 
Unit Testing in iOS
Unit Testing in iOSUnit Testing in iOS
Unit Testing in iOS
 
Qunit Java script Un
Qunit Java script UnQunit Java script Un
Qunit Java script Un
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJSIntro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJS
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic People
 
JAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & JasmineJAVASCRIPT Test Driven Development & Jasmine
JAVASCRIPT Test Driven Development & Jasmine
 
Unit testing of java script and angularjs application using Karma Jasmine Fra...
Unit testing of java script and angularjs application using Karma Jasmine Fra...Unit testing of java script and angularjs application using Karma Jasmine Fra...
Unit testing of java script and angularjs application using Karma Jasmine Fra...
 
Unit Test Your Database
Unit Test Your DatabaseUnit Test Your Database
Unit Test Your Database
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and JasmineAngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
 
Test
TestTest
Test
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
Painless JavaScript Testing with Jest
Painless JavaScript Testing with JestPainless JavaScript Testing with Jest
Painless JavaScript Testing with Jest
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
Agile Swift
Agile SwiftAgile Swift
Agile Swift
 
Mocking in Java with Mockito
Mocking in Java with MockitoMocking in Java with Mockito
Mocking in Java with Mockito
 
iOS Unit Testing
iOS Unit TestingiOS Unit Testing
iOS Unit Testing
 
Isomorphic React Apps Testing
Isomorphic React Apps TestingIsomorphic React Apps Testing
Isomorphic React Apps Testing
 

Similar to Pruebas en Plone: conceptos básicos y ejemplos

Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
MoscowDjango
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
Harshad Mane
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
Christoffer Noring
 
Security Testing
Security TestingSecurity Testing
Security Testing
Kiran Kumar
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
Mike Lively
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passageErik Rose
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
solit
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with Spec
Pharo
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
Mithilesh Singh
 
Selenium my sql and junit user guide
Selenium my sql and junit user guideSelenium my sql and junit user guide
Selenium my sql and junit user guide
Fahad Shiekh
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
Mark Rees
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
Albert Rosa
 
Mockito with a hint of PowerMock
Mockito with a hint of PowerMockMockito with a hint of PowerMock
Mockito with a hint of PowerMock
Ying Zhang
 
Ember testing internals with ember cli
Ember testing internals with ember cliEmber testing internals with ember cli
Ember testing internals with ember cli
Cory Forsyth
 
Clean tests good tests
Clean tests   good testsClean tests   good tests
Clean tests good tests
Shopsys Framework
 
J Unit
J UnitJ Unit
Getting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe TestingGetting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe Testing
Mark Rickerby
 

Similar to Pruebas en Plone: conceptos básicos y ejemplos (20)

Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
 
Unit testing for WordPress
Unit testing for WordPressUnit testing for WordPress
Unit testing for WordPress
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
UPC Testing talk 2
UPC Testing talk 2UPC Testing talk 2
UPC Testing talk 2
 
Django’s nasal passage
Django’s nasal passageDjango’s nasal passage
Django’s nasal passage
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with Spec
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Selenium my sql and junit user guide
Selenium my sql and junit user guideSelenium my sql and junit user guide
Selenium my sql and junit user guide
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
 
Mxunit
MxunitMxunit
Mxunit
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
 
Mockito with a hint of PowerMock
Mockito with a hint of PowerMockMockito with a hint of PowerMock
Mockito with a hint of PowerMock
 
Ember testing internals with ember cli
Ember testing internals with ember cliEmber testing internals with ember cli
Ember testing internals with ember cli
 
Clean tests good tests
Clean tests   good testsClean tests   good tests
Clean tests good tests
 
J Unit
J UnitJ Unit
J Unit
 
Getting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe TestingGetting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe Testing
 

More from Héctor Velarde

Plone in news media
Plone in news mediaPlone in news media
Plone in news media
Héctor Velarde
 
Plone: pasado, presente y futuro
Plone: pasado, presente y futuroPlone: pasado, presente y futuro
Plone: pasado, presente y futuro
Héctor Velarde
 
Plone: software libre y comunidad
Plone: software libre y comunidadPlone: software libre y comunidad
Plone: software libre y comunidad
Héctor Velarde
 
Diseño e ingeniería (segunda parte)
Diseño e ingeniería (segunda parte)Diseño e ingeniería (segunda parte)
Diseño e ingeniería (segunda parte)
Héctor Velarde
 
Diseño e ingeniería
Diseño e ingenieríaDiseño e ingeniería
Diseño e ingeniería
Héctor Velarde
 
Métodos de prueba
Métodos de pruebaMétodos de prueba
Métodos de prueba
Héctor Velarde
 
Características de los enlaces con cables de fibra
Características de los enlaces con cables de fibraCaracterísticas de los enlaces con cables de fibra
Características de los enlaces con cables de fibra
Héctor Velarde
 
Características de los enlaces con cables de cobre
Características de los enlaces con cables de cobreCaracterísticas de los enlaces con cables de cobre
Características de los enlaces con cables de cobre
Héctor Velarde
 
Especificaciones del canal
Especificaciones del canalEspecificaciones del canal
Especificaciones del canal
Héctor Velarde
 
Componentes
ComponentesComponentes
Componentes
Héctor Velarde
 
Norma mexicana de cableado
Norma mexicana de cableadoNorma mexicana de cableado
Norma mexicana de cableado
Héctor Velarde
 
Introducción al cableado estructurado
Introducción al cableado estructuradoIntroducción al cableado estructurado
Introducción al cableado estructurado
Héctor Velarde
 
Arquitectura de componentes de Zope 3
Arquitectura de componentes de Zope 3Arquitectura de componentes de Zope 3
Arquitectura de componentes de Zope 3
Héctor Velarde
 
Plone en La Jornada
Plone en La JornadaPlone en La Jornada
Plone en La Jornada
Héctor Velarde
 

More from Héctor Velarde (14)

Plone in news media
Plone in news mediaPlone in news media
Plone in news media
 
Plone: pasado, presente y futuro
Plone: pasado, presente y futuroPlone: pasado, presente y futuro
Plone: pasado, presente y futuro
 
Plone: software libre y comunidad
Plone: software libre y comunidadPlone: software libre y comunidad
Plone: software libre y comunidad
 
Diseño e ingeniería (segunda parte)
Diseño e ingeniería (segunda parte)Diseño e ingeniería (segunda parte)
Diseño e ingeniería (segunda parte)
 
Diseño e ingeniería
Diseño e ingenieríaDiseño e ingeniería
Diseño e ingeniería
 
Métodos de prueba
Métodos de pruebaMétodos de prueba
Métodos de prueba
 
Características de los enlaces con cables de fibra
Características de los enlaces con cables de fibraCaracterísticas de los enlaces con cables de fibra
Características de los enlaces con cables de fibra
 
Características de los enlaces con cables de cobre
Características de los enlaces con cables de cobreCaracterísticas de los enlaces con cables de cobre
Características de los enlaces con cables de cobre
 
Especificaciones del canal
Especificaciones del canalEspecificaciones del canal
Especificaciones del canal
 
Componentes
ComponentesComponentes
Componentes
 
Norma mexicana de cableado
Norma mexicana de cableadoNorma mexicana de cableado
Norma mexicana de cableado
 
Introducción al cableado estructurado
Introducción al cableado estructuradoIntroducción al cableado estructurado
Introducción al cableado estructurado
 
Arquitectura de componentes de Zope 3
Arquitectura de componentes de Zope 3Arquitectura de componentes de Zope 3
Arquitectura de componentes de Zope 3
 
Plone en La Jornada
Plone en La JornadaPlone en La Jornada
Plone en La Jornada
 

Recently uploaded

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

Pruebas en Plone: conceptos básicos y ejemplos

  • 1. Pruebas en Conceptos básicos y ejemplos
  • 2. ¿qué son y para qué sirven?
  • 3.  
  • 4. Unit testing will make you more attractive to the opposite sex. Martin Aspeli
  • 5. pruebas unitarias pruebas de integración pruebas funcionales pruebas de sistema
  • 7. pruebas unitarias y de integración
  • 8. base.py from Testing import ZopeTestCase ZopeTestCase.installProduct('My Product') from Products.PloneTestCase.PloneTestCase import PloneTestCase from Products.PloneTestCase.PloneTestCase import FunctionalTestCase from Products.PloneTestCase.PloneTestCase import setupPloneSite setupPloneSite(products=['My Product']) class MyProductTestCase(PloneTestCase): """We use this base class for all the tests in this package. If necessary, we can put common utility or setup code in here. This applies to unit test cases. """ class MyProductFunctionalTestCase(FunctionalTestCase): """We use this class for functional integration tests that use doctest syntax. Again, we can put basic common utility or setup code in here. """
  • 9. my_test.py import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from base import MyProductTestCase class TestClass(MyProductTestCase): """Tests for this and that...""" ... def test_suite(): from unittest import TestSuite, makeSuite suite = TestSuite() ... suite.addTest(makeSuite(TestClass)) ... return suite if __name__ == '__main__': framework()
  • 10. Instalación de skins y recursos class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.skins = self.portal.portal_skins self.csstool = self.portal.portal_css self.jstool = self.portal.portal_javascripts ... def testSkinLayersInstalled(self): """Verifies the skin layer was registered""" self.failUnless('my_product_skin' in self.skins.objectIds()) def testCssInstalled(self): """Verifies the associated CSS file was registered""" stylesheetids = self.csstool.getResourceIds() self.failUnless('my_css_id' in stylesheetids) def testJavascriptsInstalled(self): """Verifies the associated JavaScript file was registered""" javascriptids = self.jstool.getResourceIds() self.failUnless('my_js_id' in javascriptids)
  • 11. Instalación de tipos de contenido class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.types = self.portal.portal_types self.factory = self.portal.portal_factory ... def testTypesInstalled(self): """Verifies the content type was installed""" self.failUnless('My Type' in self.types.objectIds()) def testPortalFactorySetup(self): """Verifies the content type was registered in the portal factory. The portal factory ensures that new objects are created in a well-behaved fashion. """ self.failUnless('My Type' in self.factory.getFactoryTypes())
  • 12. Instalación de tools y configlets class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.config = self.portal.portal_controlpanel ... def testToolInstalled(self): """Verifies a tool was installed""" self.failUnless(getattr(self.portal, 'my_tool', None) is not None) def testConfigletInstalled(self): """Verifies a configlet was installed""" configlets = list(self.config.listActions()) self.failUnless('my_configlet_id' in configlets)
  • 13. Verificando recursos de Kupu class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.kupu = self.portal.kupu_library_tool ... def testKupuResourcesSetup(self): """Verifies the content type can be linked inside Kupu""" linkable = self.kupu.getPortalTypesForResourceType('linkable') self.failUnless('My Type' in linkable)
  • 14. Verificando otras propiedades class TestInstallation(MyProductTestCase): """Ensure product is properly installed""" def afterSetUp(self): ... self.props = self.portal.portal_properties ... def testDefaultPageTypes(self): """Verifies the content type can be used as the default page in a container object like a folder. """ self.failUnless('My Type' in self.props.site_properties.getProperty('default_page_types'))
  • 15. Desinstalación del producto class TestUninstall(MyProductTestCase): """Ensure product is properly uninstalled""" def afterSetUp(self): ... self.qitool = self.portal.portal_quickinstaller self.qitool.uninstallProducts(products=['My Product']) ... def testProductUninstalled(self): """Verifies the product was uninstalled""" self.failIf(self.qitool.isProductInstalled('My Product'))
  • 16. Implementación from Interface.Verify import verifyObject from Products.ATContentTypes.interface import IATContentType from Products.MyProduct.interfaces import IMyProduct class TestContentType(MyProductTestCase): """Ensure content type implementation""" def afterSetUp(self): self.folder.invokeFactory('My Type', 'mytype1') self.mytype1 = getattr(self.folder, 'mytype1') def testImplementsATContentType(self): """Verifies the object implements the base Archetypes interface""" iface = IATContentType self.failUnless(iface.providedBy(self.mytype1)) self.failUnless(verifyObject(iface, self.mytype1)) def testImplementsMyType(self): """Verifies the object implements the content type interface""" iface = IMyType self.failUnless(iface.providedBy(self.mytype1)) self.failUnless(verifyObject(iface, self.mytype1))
  • 17. Creación y edición de contenido class TestContentCreation(MyProductTestCase): """Ensure content type can be created and edited""" def afterSetUp(self): self.folder.invokeFactory('My Type', 'mytype1') self.mytype1 = getattr(self.folder, 'mytype1') def testCreateMyType(self): """Verifies the object has been created""" self.failUnless('mytype1' in self.folder.objectIds()) def testEditMyType(self): """Verifies the object can be properly edited""" self.mytype1.setTitle('A title') self.mytype1.setDescription('A description') ... self.assertEqual(self.mytype1.Title(), 'A title') self.assertEqual(self.mytype1.Description(), 'A description') ...
  • 18.  
  • 19. pruebas funcionales y de sistema
  • 20. zope.testbrowser zope.testrecorder Es elegante y fácil de usar, pero no soporta JavaScript Permite grabar las pruebas en formato zope.testbrowser o Selenium
  • 21. Selenium IDE Selenium Remote Control Selenium Grid
  • 22.