SlideShare a Scribd company logo
1 of 21
Download to read offline
How to develop automated tests
Géry Debongnie
Content
1. Automated tests
2. website.tour.js
3. Case study
4. Testing in practice
Automated Tests
Tour = Test or Tutorial
A Short Demo
Tutorials and Tests
tutorialstutorials : sequence of steps. Each step wait for the user
to do something, before moving to the next step.
teststests : same, but the js code simulates an user
·
·
Use Cases
guide your users with tutorials
test any kind of business flow (customer buying an event
ticket, ...)
test any odoo addon (application in backend) (not ready
yet)
·
·
·
website.tour.js
Architecture
manage all tours (tests/tutorials)
standalone (doesn't use odoo framework)
save its state in local storage (survive a refresh/page
change)
simulates all DOM events
automatically adds tutorials in the help menu
tests will only be successful if all steps are completed
·
·
·
·
·
·
Simple example (test)
website..Tour..register({({
id:: 'shop_customize',,
name:: "Customize the page and search a product",,
path:: '/shop',,
mode:: 'test',,
steps:: [[
{{
title:: "open customize menu",,
element:: '#customize-menu-button',,
},},
{{
title:: "click on 'Product Attribute's Filters'",,
element:: "#customize-menu a:contains(Product Attribute's Filters)",,
},},
{{
title:: "select product attribute memory 16 Go",,
element:: 'form.js_attributes label:contains(16 Go) input:not(:checked)',,
},},
......
]]
});});
API
A tour is defined by some simple attributes:
id
name
path
mode
id:: 'shop_customize',,
name:: "Customize the page and search a product",,
path:: '/shop',,
mode:: 'test',,
and a more complex one: steps.
·
·
·
·
Steps definition
A step is defined with a selection of attributes:
title
element
waitFor
waitNot
some others
{{
title:: "open customize menu",,
element:: '#customize-menu-button',,
},},
{{
title:: "click on 'Product Attribute's Filters'",,
element:: "#customize-menu a:contains(Product Attribute's Filters)",,
},},
·
·
·
·
·
Steps definition (2)
{{
title:: "select product attribute memory 16 Go",,
element:: 'form.js_attributes label:contains(16 Go)
input:not(:checked)',,
},},
{{
title:: "check the selection",,
waitFor:: 'form.js_attributes label:contains(16 Go) input:checked',,
},},
{{
title:: "select ipod",,
waitNot:: '.oe_website_sale .oe_product_cart:eq(2)',,
element:: '.oe_product_cart a:contains("iPod")',,
},},
{{
title:: "finish",,
waitFor:: 'label:contains(32 Go) input',,
}}
Tests: automated actions!
Actions are simulated on the 'element':
mouseenter, mousedown, mouse click, mouse up, mouse
leave
if attribute sampleText: idem, then keydown,
if input/select, value is set to sampleText
otherwise, html is set to sampleText
if snippet: simulates drag and drop with mousedown,
mousemove,mouseup
{{
title:: "set one iPod",,
waitNot:: '#cart_products tr:contains("Apple In-Ear Headphones")',,
element:: '#cart_products input.js_quantity',,
sampleText:: '1',,
},},
·
·
·
·
·
Case study
a more complex example (tutorial)
Create a product
website..Tour..register({({
id:: 'shop',,
name:: _t(("Create a product"),),
steps:: [[
{{
title:: _t(("Welcome to your shop"),),
content:: _t(("You successfully installed the e-commerce. This guide will help you to create your product a
popover:: {{ next:: _t(("Start Tutorial"),), end:: _t(("Skip It")) },},
},},
{{
element:: '#content-menu-button',,
placement:: 'left',,
title:: _t(("Create your first product"),),
content:: _t(("Click here to add a new product."),),
popover:: {{ fixed:: truetrue },},
},},
......
Create a product (2)
{{
element:: 'a[data-action=new_product]',,
placement:: 'left',,
title:: _t(("Create a new product"),),
content:: _t(("Select 'New Product' to create it and manage its properties to boost your sales."),),
popover:: {{ fixed:: truetrue },},
},}, {{
element:: '.modal #editor_new_product input[type=text]',,
sampleText:: 'New Product',,
placement:: 'right',,
title:: _t(("Choose name"),),
content:: _t(("Enter a name for your new product then click 'Continue'."),),
},}, {{
waitNot:: '.modal input[type=text]:not([value!=""])',,
element:: '.modal button.btn-primary',,
placement:: 'right',,
title:: _t(("Create Product"),),
content:: _t(("Click <em>Continue</em> to create the product."),),
},},
It's really easy!
Just follow the examples...
website.tour.events.js
website.tour.blog.js
...
·
·
·
Testing in practice
Testing with the runbot
Example: test_sale_process.py
inject == [[
(("openerp.website.Tour",, '.../static/src/js/website.tour.js')),)),
(("openerp.website.Tour.ShopTest",, '.../src/js/website.tour.sale.js"))]
classclass TestUi((openerp..tests..HttpCase):):
defdef test_01_admin_shop_tour((self):):
self..phantom_js((
"/",,
"openerp.website.Tour.run('shop', 'test')",,
"openerp.website.Tour.tours.shop",, login=="admin"))
defdef test_02_admin_checkout((self):):
self..phantom_js((
"/",,
"openerp.website.Tour.run('shop_customize', 'test')",,
"openerp.website.Tour.tours.shop_customize",,
login=="admin",,
inject==inject))
Coming Soon (really)
testing in backend
file upload
·
·
Thank you

More Related Content

What's hot

Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOdoo
 
Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo
 
An in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMAn in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMOdoo
 
Empower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsEmpower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsOdoo
 
Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in OdooOdoo
 
Odoo - Open chatter integration
Odoo - Open chatter integrationOdoo - Open chatter integration
Odoo - Open chatter integrationOdoo
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15Celine George
 
The Odoo JS Framework
The Odoo JS FrameworkThe Odoo JS Framework
The Odoo JS FrameworkOdoo
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Odoo
 
How to Design Resilient Odoo Crons
How to Design Resilient Odoo CronsHow to Design Resilient Odoo Crons
How to Design Resilient Odoo CronsOdoo
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsOdoo
 
Discover GraphQL with Python, Graphene and Odoo
Discover GraphQL with Python, Graphene and OdooDiscover GraphQL with Python, Graphene and Odoo
Discover GraphQL with Python, Graphene and OdooOdoo
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesOdoo
 
Using runbot to test all your developments automatically
Using runbot to test all your developments automaticallyUsing runbot to test all your developments automatically
Using runbot to test all your developments automaticallyOdoo
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code HardeningOdoo
 
Odoo icon smart buttons
Odoo   icon smart buttonsOdoo   icon smart buttons
Odoo icon smart buttonsTaieb Kristou
 
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New View
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New ViewOdoo Experience 2018 - Visualizing Data in Odoo: How to Create a New View
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New ViewElínAnna Jónasdóttir
 
Odoo - Smart buttons
Odoo - Smart buttonsOdoo - Smart buttons
Odoo - Smart buttonsOdoo
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo
 

What's hot (20)

Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI Framework
 
Odoo - Backend modules in v8
Odoo - Backend modules in v8Odoo - Backend modules in v8
Odoo - Backend modules in v8
 
An in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORMAn in Depth Journey into Odoo's ORM
An in Depth Journey into Odoo's ORM
 
Empower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo MixinsEmpower your App by Inheriting from Odoo Mixins
Empower your App by Inheriting from Odoo Mixins
 
Asynchronous JS in Odoo
Asynchronous JS in OdooAsynchronous JS in Odoo
Asynchronous JS in Odoo
 
Odoo - Open chatter integration
Odoo - Open chatter integrationOdoo - Open chatter integration
Odoo - Open chatter integration
 
How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15How to Use Constraint and SQL Constraint in Odoo 15
How to Use Constraint and SQL Constraint in Odoo 15
 
The Odoo JS Framework
The Odoo JS FrameworkThe Odoo JS Framework
The Odoo JS Framework
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
How to Design Resilient Odoo Crons
How to Design Resilient Odoo CronsHow to Design Resilient Odoo Crons
How to Design Resilient Odoo Crons
 
Common Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo appsCommon Performance Pitfalls in Odoo apps
Common Performance Pitfalls in Odoo apps
 
Discover GraphQL with Python, Graphene and Odoo
Discover GraphQL with Python, Graphene and OdooDiscover GraphQL with Python, Graphene and Odoo
Discover GraphQL with Python, Graphene and Odoo
 
Odoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building BlocksOdoo Website - How to Develop Building Blocks
Odoo Website - How to Develop Building Blocks
 
Impact of the New ORM on Your Modules
Impact of the New ORM on Your ModulesImpact of the New ORM on Your Modules
Impact of the New ORM on Your Modules
 
Using runbot to test all your developments automatically
Using runbot to test all your developments automaticallyUsing runbot to test all your developments automatically
Using runbot to test all your developments automatically
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
Odoo icon smart buttons
Odoo   icon smart buttonsOdoo   icon smart buttons
Odoo icon smart buttons
 
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New View
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New ViewOdoo Experience 2018 - Visualizing Data in Odoo: How to Create a New View
Odoo Experience 2018 - Visualizing Data in Odoo: How to Create a New View
 
Odoo - Smart buttons
Odoo - Smart buttonsOdoo - Smart buttons
Odoo - Smart buttons
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challenges
 

Similar to How to develop automated tests

How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...Wim Selles
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolMiki Lombardi
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Librariesjeresig
 
E2E testing con nightwatch.js - Drupalcamp Spain 2018
E2E testing con nightwatch.js  - Drupalcamp Spain 2018E2E testing con nightwatch.js  - Drupalcamp Spain 2018
E2E testing con nightwatch.js - Drupalcamp Spain 2018Salvador Molina (Slv_)
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyOren Farhi
 
Compatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensionsCompatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensionsKai Cui
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и DjangoMoscowDjango
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018Wim Selles
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1Albert Rosa
 
Spin Up Desktop Apps with Electron.js
Spin Up Desktop Apps with Electron.jsSpin Up Desktop Apps with Electron.js
Spin Up Desktop Apps with Electron.jsSteve Godin
 
jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010mennovanslooten
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2bphanhung20
 
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...Learnosity
 
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5Alkacon Software GmbH & Co. KG
 

Similar to How to develop automated tests (20)

How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing Tool
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Libraries
 
E2E testing con nightwatch.js - Drupalcamp Spain 2018
E2E testing con nightwatch.js  - Drupalcamp Spain 2018E2E testing con nightwatch.js  - Drupalcamp Spain 2018
E2E testing con nightwatch.js - Drupalcamp Spain 2018
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
 
Compatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensionsCompatibility Detector Tool of Chrome extensions
Compatibility Detector Tool of Chrome extensions
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Тестирование и Django
Тестирование и DjangoТестирование и Django
Тестирование и Django
 
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
 
YUI 3
YUI 3YUI 3
YUI 3
 
Spin Up Desktop Apps with Electron.js
Spin Up Desktop Apps with Electron.jsSpin Up Desktop Apps with Electron.js
Spin Up Desktop Apps with Electron.js
 
Day 5
Day 5Day 5
Day 5
 
jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010jQuery Bay Area Conference 2010
jQuery Bay Area Conference 2010
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
 
Java awt
Java awtJava awt
Java awt
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...
Educate 2017: Customizing Assessments: Why extending the APIs is easier than ...
 
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
 

More from Odoo

Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Odoo
 
Odoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & StrategyOdoo
 
Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Odoo
 
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityExtending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityOdoo
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooOdoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseOdoo
 
Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Odoo
 
Rock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsRock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsOdoo
 
Transition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationTransition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationOdoo
 
Synchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisSynchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisOdoo
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with OdooOdoo
 
Down Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooDown Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooOdoo
 
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to OdooOdoo
 
Preventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningPreventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningOdoo
 
Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Odoo
 
Instant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelInstant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelOdoo
 
How Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldHow Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldOdoo
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to OdooOdoo
 

More from Odoo (20)

Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!Timesheet Workshop: The Timesheet App People Love!
Timesheet Workshop: The Timesheet App People Love!
 
Odoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-ViewerOdoo 3D Product View with Google Model-Viewer
Odoo 3D Product View with Google Model-Viewer
 
Keynote - Vision & Strategy
Keynote - Vision & StrategyKeynote - Vision & Strategy
Keynote - Vision & Strategy
 
Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14Opening Keynote - Unveilling Odoo 14
Opening Keynote - Unveilling Odoo 14
 
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting CapabilityExtending Odoo with a Comprehensive Budgeting and Forecasting Capability
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
 
Managing Multi-channel Selling with Odoo
Managing Multi-channel Selling with OdooManaging Multi-channel Selling with Odoo
Managing Multi-channel Selling with Odoo
 
Product Configurator: Advanced Use Case
Product Configurator: Advanced Use CaseProduct Configurator: Advanced Use Case
Product Configurator: Advanced Use Case
 
Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?Accounting Automation: How Much Money We Saved and How?
Accounting Automation: How Much Money We Saved and How?
 
Rock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced OperationsRock Your Logistics with Advanced Operations
Rock Your Logistics with Advanced Operations
 
Transition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organizationTransition from a cost to a flow-centric organization
Transition from a cost to a flow-centric organization
 
Synchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the CrisisSynchronization: The Supply Chain Response to Overcome the Crisis
Synchronization: The Supply Chain Response to Overcome the Crisis
 
Running a University with Odoo
Running a University with OdooRunning a University with Odoo
Running a University with Odoo
 
Down Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in OdooDown Payments on Purchase Orders in Odoo
Down Payments on Purchase Orders in Odoo
 
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach foodOdoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
 
Migration from Salesforce to Odoo
Migration from Salesforce to OdooMigration from Salesforce to Odoo
Migration from Salesforce to Odoo
 
Preventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine LearningPreventing User Mistakes by Using Machine Learning
Preventing User Mistakes by Using Machine Learning
 
Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification Becoming an Odoo Expert: How to Prepare for the Certification
Becoming an Odoo Expert: How to Prepare for the Certification
 
Instant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping LabelInstant Printing of any Odoo Report or Shipping Label
Instant Printing of any Odoo Report or Shipping Label
 
How Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 FoldHow Odoo helped an Organization Grow 3 Fold
How Odoo helped an Organization Grow 3 Fold
 
From Shopify to Odoo
From Shopify to OdooFrom Shopify to Odoo
From Shopify to Odoo
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

How to develop automated tests

  • 1. How to develop automated tests Géry Debongnie
  • 2. Content 1. Automated tests 2. website.tour.js 3. Case study 4. Testing in practice
  • 3. Automated Tests Tour = Test or Tutorial
  • 5. Tutorials and Tests tutorialstutorials : sequence of steps. Each step wait for the user to do something, before moving to the next step. teststests : same, but the js code simulates an user · ·
  • 6. Use Cases guide your users with tutorials test any kind of business flow (customer buying an event ticket, ...) test any odoo addon (application in backend) (not ready yet) · · ·
  • 8. Architecture manage all tours (tests/tutorials) standalone (doesn't use odoo framework) save its state in local storage (survive a refresh/page change) simulates all DOM events automatically adds tutorials in the help menu tests will only be successful if all steps are completed · · · · · ·
  • 9. Simple example (test) website..Tour..register({({ id:: 'shop_customize',, name:: "Customize the page and search a product",, path:: '/shop',, mode:: 'test',, steps:: [[ {{ title:: "open customize menu",, element:: '#customize-menu-button',, },}, {{ title:: "click on 'Product Attribute's Filters'",, element:: "#customize-menu a:contains(Product Attribute's Filters)",, },}, {{ title:: "select product attribute memory 16 Go",, element:: 'form.js_attributes label:contains(16 Go) input:not(:checked)',, },}, ...... ]] });});
  • 10. API A tour is defined by some simple attributes: id name path mode id:: 'shop_customize',, name:: "Customize the page and search a product",, path:: '/shop',, mode:: 'test',, and a more complex one: steps. · · · ·
  • 11. Steps definition A step is defined with a selection of attributes: title element waitFor waitNot some others {{ title:: "open customize menu",, element:: '#customize-menu-button',, },}, {{ title:: "click on 'Product Attribute's Filters'",, element:: "#customize-menu a:contains(Product Attribute's Filters)",, },}, · · · · ·
  • 12. Steps definition (2) {{ title:: "select product attribute memory 16 Go",, element:: 'form.js_attributes label:contains(16 Go) input:not(:checked)',, },}, {{ title:: "check the selection",, waitFor:: 'form.js_attributes label:contains(16 Go) input:checked',, },}, {{ title:: "select ipod",, waitNot:: '.oe_website_sale .oe_product_cart:eq(2)',, element:: '.oe_product_cart a:contains("iPod")',, },}, {{ title:: "finish",, waitFor:: 'label:contains(32 Go) input',, }}
  • 13. Tests: automated actions! Actions are simulated on the 'element': mouseenter, mousedown, mouse click, mouse up, mouse leave if attribute sampleText: idem, then keydown, if input/select, value is set to sampleText otherwise, html is set to sampleText if snippet: simulates drag and drop with mousedown, mousemove,mouseup {{ title:: "set one iPod",, waitNot:: '#cart_products tr:contains("Apple In-Ear Headphones")',, element:: '#cart_products input.js_quantity',, sampleText:: '1',, },}, · · · · ·
  • 14. Case study a more complex example (tutorial)
  • 15. Create a product website..Tour..register({({ id:: 'shop',, name:: _t(("Create a product"),), steps:: [[ {{ title:: _t(("Welcome to your shop"),), content:: _t(("You successfully installed the e-commerce. This guide will help you to create your product a popover:: {{ next:: _t(("Start Tutorial"),), end:: _t(("Skip It")) },}, },}, {{ element:: '#content-menu-button',, placement:: 'left',, title:: _t(("Create your first product"),), content:: _t(("Click here to add a new product."),), popover:: {{ fixed:: truetrue },}, },}, ......
  • 16. Create a product (2) {{ element:: 'a[data-action=new_product]',, placement:: 'left',, title:: _t(("Create a new product"),), content:: _t(("Select 'New Product' to create it and manage its properties to boost your sales."),), popover:: {{ fixed:: truetrue },}, },}, {{ element:: '.modal #editor_new_product input[type=text]',, sampleText:: 'New Product',, placement:: 'right',, title:: _t(("Choose name"),), content:: _t(("Enter a name for your new product then click 'Continue'."),), },}, {{ waitNot:: '.modal input[type=text]:not([value!=""])',, element:: '.modal button.btn-primary',, placement:: 'right',, title:: _t(("Create Product"),), content:: _t(("Click <em>Continue</em> to create the product."),), },},
  • 17. It's really easy! Just follow the examples... website.tour.events.js website.tour.blog.js ... · · ·
  • 19. Testing with the runbot Example: test_sale_process.py inject == [[ (("openerp.website.Tour",, '.../static/src/js/website.tour.js')),)), (("openerp.website.Tour.ShopTest",, '.../src/js/website.tour.sale.js"))] classclass TestUi((openerp..tests..HttpCase):): defdef test_01_admin_shop_tour((self):): self..phantom_js(( "/",, "openerp.website.Tour.run('shop', 'test')",, "openerp.website.Tour.tours.shop",, login=="admin")) defdef test_02_admin_checkout((self):): self..phantom_js(( "/",, "openerp.website.Tour.run('shop_customize', 'test')",, "openerp.website.Tour.tours.shop_customize",, login=="admin",, inject==inject))
  • 20. Coming Soon (really) testing in backend file upload · ·