SlideShare a Scribd company logo
1 of 20
Download to read offline
Functional testing easier than you thought
Bartosz Cisek
Edu-Space.pl
16.04.2014
Bartosz Cisek Functional testing easier than you thought 1 / 20
Do not reinvent the wheel
Moodle already has:
• integrated testing framework
• well defined building blocks
• prepared scripts
• detailed documentation
Bartosz Cisek Functional testing easier than you thought 2 / 20
Requirements
• php 5.4
• separate domain
• Internet access (only for installation)
Bartosz Cisek Functional testing easier than you thought 3 / 20
Installation
• Download composer and let it do the rest.
• Download Selenium, Java and chrome driver.
Bartosz Cisek Functional testing easier than you thought 4 / 20
Setup second platform
• First one runs test
• Second one is being tested
Bartosz Cisek Functional testing easier than you thought 5 / 20
Update configuration
• $CFG→behat prefix
• $CFG→behat dataroot
• $CFG→behat wwwroot
Bartosz Cisek Functional testing easier than you thought 6 / 20
Test run
• Start Selenium
command line
java -jar selenium-server-standalone-2.NN.N.jar
• Start behat
command line
php admin/tool/behat/cli/init.php
vendor/bin/behat –config /behat/dataroot/behat/behat.yml
• As an example run tests of default Moodle installation
Bartosz Cisek Functional testing easier than you thought 7 / 20
Writing test cases
• start favorite editor
• yaml format
• create a file with .feature extension in tests/behat directory
Bartosz Cisek Functional testing easier than you thought 8 / 20
File structure
@plugintype @plugintype_plugin
Feature: feature name description
Scenario: Short description of scenario
step 1
step 2
Scenario: Another scenario to test this feature
step 1
step 2
Bartosz Cisek Functional testing easier than you thought 9 / 20
Feature and Scenario
• Feature – Human-readable list of scenarios that describes
a feature.
• Scenario – Human-readable list of steps to describe
an expected behavior
Bartosz Cisek Functional testing easier than you thought 10 / 20
Scenario steps
• Steps – Human-readable sentences that describes an action.
• Steps definitions – php classes written in mink dialect
Bartosz Cisek Functional testing easier than you thought 11 / 20
Types of steps 1
• “Given” – describing the initial context
example
Given I log in as ”admin”
Bartosz Cisek Functional testing easier than you thought 12 / 20
Types of steps 2
• “When“ – action that leads to a change
example
When I click on a link
Bartosz Cisek Functional testing easier than you thought 13 / 20
Types of steps 3
• “Then” – check the results
example
Then I should see ”Moodle 101: Course Name”
Bartosz Cisek Functional testing easier than you thought 14 / 20
Fixtures
• Prepare predefined environment
• Testing enrollment requires users and courses
Given the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | COURSE1 | CAT1 | topics |
| Course 2 | COURSE2 | CAT2 | |
Bartosz Cisek Functional testing easier than you thought 15 / 20
Filtering
• You can filter features to test with –tags or –name options
Bartosz Cisek Functional testing easier than you thought 16 / 20
Continuous Integration Manager
• Jenkins
• Computers are good at
repeating procedures
• Automate mundane tasks
Bartosz Cisek Functional testing easier than you thought 17 / 20
Automatic Workflow
Bartosz Cisek Functional testing easier than you thought 18 / 20
Flexibility
• Build script (ant, phing)
• Repository (git, hg, svn)
• Head less window manager – Xvfb
Bartosz Cisek Functional testing easier than you thought 19 / 20
Summary
• It is not rocket science!
• http://docs.moodle.org/dev/Acceptance_testing
Contact:
• b.cisek@edu-space.pl
• +48 604 874 555
Bartosz Cisek Functional testing easier than you thought 20 / 20

More Related Content

What's hot

Intern_Poster_Xing_Wei
Intern_Poster_Xing_WeiIntern_Poster_Xing_Wei
Intern_Poster_Xing_Wei
Xing Wei
 

What's hot (11)

SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
 
Bccon use notes objects in memory and other useful
Bccon   use notes objects in memory and other usefulBccon   use notes objects in memory and other useful
Bccon use notes objects in memory and other useful
 
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architectureA look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architecture
 
Ms vs ibm_v1.3
Ms vs ibm_v1.3Ms vs ibm_v1.3
Ms vs ibm_v1.3
 
Intern_Poster_Xing_Wei
Intern_Poster_Xing_WeiIntern_Poster_Xing_Wei
Intern_Poster_Xing_Wei
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and more
 
IBM Connections Adminblast - Soccnx 12 Edition
IBM Connections Adminblast - Soccnx 12 EditionIBM Connections Adminblast - Soccnx 12 Edition
IBM Connections Adminblast - Soccnx 12 Edition
 
WordPress Workflows
WordPress WorkflowsWordPress Workflows
WordPress Workflows
 
11.Open Data Protocol(ODATA)
11.Open Data Protocol(ODATA) 11.Open Data Protocol(ODATA)
11.Open Data Protocol(ODATA)
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
 
CollabSphere 2018: How to build your SmartCloud Notes hybrid environment
CollabSphere 2018: How to build your SmartCloud Notes hybrid environmentCollabSphere 2018: How to build your SmartCloud Notes hybrid environment
CollabSphere 2018: How to build your SmartCloud Notes hybrid environment
 

Similar to Automatic functional testing easier than you thought Bartosz Cisek

UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
Ulrich Krause
 

Similar to Automatic functional testing easier than you thought Bartosz Cisek (20)

Math-Bridge Installation
Math-Bridge InstallationMath-Bridge Installation
Math-Bridge Installation
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuego
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
WordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationWordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow Presentation
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Categories of automation testing
Categories of automation testingCategories of automation testing
Categories of automation testing
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation Portal
 
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UKSitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
Sitecore9 key features by jitendra soni - Presented in Sitecore User Group UK
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
 
Intro to Pentesting Jenkins
Intro to Pentesting JenkinsIntro to Pentesting Jenkins
Intro to Pentesting Jenkins
 
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to use
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Web development with Python
Web development with PythonWeb development with Python
Web development with Python
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Sitecore 10 - ASP.NET Core Rendering with Docker and Sitecore 10
Sitecore 10 - ASP.NET Core Rendering with Docker and Sitecore 10Sitecore 10 - ASP.NET Core Rendering with Docker and Sitecore 10
Sitecore 10 - ASP.NET Core Rendering with Docker and Sitecore 10
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 

More from Ireland & UK Moodlemoot 2012

More from Ireland & UK Moodlemoot 2012 (20)

Transforming a learning curriculum Gideon Williams
Transforming a learning curriculum 	Gideon WilliamsTransforming a learning curriculum 	Gideon Williams
Transforming a learning curriculum Gideon Williams
 
Demistifying Databases: Making the most of the Database Activity Dan Jeffries
Demistifying Databases: Making the most of the Database Activity 	Dan JeffriesDemistifying Databases: Making the most of the Database Activity 	Dan Jeffries
Demistifying Databases: Making the most of the Database Activity Dan Jeffries
 
Customising Moodle with Course Formats Alex Walker
Customising Moodle with Course Formats 	Alex WalkerCustomising Moodle with Course Formats 	Alex Walker
Customising Moodle with Course Formats Alex Walker
 
Designing Active Learning in Moodle – a preview of the Learning Designer tool...
Designing Active Learning in Moodle – a preview of the Learning Designer tool...Designing Active Learning in Moodle – a preview of the Learning Designer tool...
Designing Active Learning in Moodle – a preview of the Learning Designer tool...
 
Enhancing the My home page to display news forum postings and more John Tut...
Enhancing the My home page to display news forum postings and more  	John Tut...Enhancing the My home page to display news forum postings and more  	John Tut...
Enhancing the My home page to display news forum postings and more John Tut...
 
Broadening the scope of a Maths module for student Technology teachers Sue Mi...
Broadening the scope of a Maths module for student Technology teachers	Sue Mi...Broadening the scope of a Maths module for student Technology teachers	Sue Mi...
Broadening the scope of a Maths module for student Technology teachers Sue Mi...
 
A proposal for integrating Serious Games made with Unity3D into Moodle course...
A proposal for integrating Serious Games made with Unity3D into Moodle course...A proposal for integrating Serious Games made with Unity3D into Moodle course...
A proposal for integrating Serious Games made with Unity3D into Moodle course...
 
Using Moodle to familiarise prospective students with HE level learning Carol...
Using Moodle to familiarise prospective students with HE level learning	Carol...Using Moodle to familiarise prospective students with HE level learning	Carol...
Using Moodle to familiarise prospective students with HE level learning Carol...
 
The Moodle Gradebook as a tool inducing regular revisions in students' learni...
The Moodle Gradebook as a tool inducing regular revisions in students' learni...The Moodle Gradebook as a tool inducing regular revisions in students' learni...
The Moodle Gradebook as a tool inducing regular revisions in students' learni...
 
Using the Moodle Quiz for Formative and Summative Assessment: Safe Exam Brows...
Using the Moodle Quiz for Formative and Summative Assessment: Safe Exam Brows...Using the Moodle Quiz for Formative and Summative Assessment: Safe Exam Brows...
Using the Moodle Quiz for Formative and Summative Assessment: Safe Exam Brows...
 
Delivering online exams using Moodle Tim Hunt, Mahmoud Kassaei
Delivering online exams using Moodle	Tim Hunt, Mahmoud KassaeiDelivering online exams using Moodle	Tim Hunt, Mahmoud Kassaei
Delivering online exams using Moodle Tim Hunt, Mahmoud Kassaei
 
Improving Edit quiz page Mahmoud Kassaei
Improving Edit quiz page 	Mahmoud KassaeiImproving Edit quiz page 	Mahmoud Kassaei
Improving Edit quiz page Mahmoud Kassaei
 
Surveys made easy with Moodle Mark Glynn, Gavin Henrick
Surveys made easy with Moodle	Mark Glynn, Gavin HenrickSurveys made easy with Moodle	Mark Glynn, Gavin Henrick
Surveys made easy with Moodle Mark Glynn, Gavin Henrick
 
Assessment Models Using Moodle Activities Phil Danby, Emily Webb, Chris Meadows
Assessment Models Using Moodle Activities	Phil Danby, Emily Webb, Chris MeadowsAssessment Models Using Moodle Activities	Phil Danby, Emily Webb, Chris Meadows
Assessment Models Using Moodle Activities Phil Danby, Emily Webb, Chris Meadows
 
Many a Mickle Makes a Muckle: A multitude of Moodle mods to enhance the stude...
Many a Mickle Makes a Muckle: A multitude of Moodle mods to enhance the stude...Many a Mickle Makes a Muckle: A multitude of Moodle mods to enhance the stude...
Many a Mickle Makes a Muckle: A multitude of Moodle mods to enhance the stude...
 
Timeline, our Moodle-Integrated Social Network Alex Walker
Timeline, our Moodle-Integrated Social Network	Alex WalkerTimeline, our Moodle-Integrated Social Network	Alex Walker
Timeline, our Moodle-Integrated Social Network Alex Walker
 
Moving Moodle: “The journey is the reward” Laura Widger
Moving Moodle: “The journey is the reward” 	Laura WidgerMoving Moodle: “The journey is the reward” 	Laura Widger
Moving Moodle: “The journey is the reward” Laura Widger
 
The Open Science Laboratory - Cosmetic Surgery for Moodle Sam Marshall
The Open Science Laboratory - Cosmetic Surgery for Moodle 	Sam MarshallThe Open Science Laboratory - Cosmetic Surgery for Moodle 	Sam Marshall
The Open Science Laboratory - Cosmetic Surgery for Moodle Sam Marshall
 
Workbook: Extending Active Learning in the Book Andrew James
Workbook: Extending Active Learning in the Book  	Andrew JamesWorkbook: Extending Active Learning in the Book  	Andrew James
Workbook: Extending Active Learning in the Book Andrew James
 
Design approach and evaluation of Moodle 2.4 course to support induction of r...
Design approach and evaluation of Moodle 2.4 course to support induction of r...Design approach and evaluation of Moodle 2.4 course to support induction of r...
Design approach and evaluation of Moodle 2.4 course to support induction of r...
 

Recently uploaded

Recently uploaded (10)

Understanding Poverty: A Community Questionnaire
Understanding Poverty: A Community QuestionnaireUnderstanding Poverty: A Community Questionnaire
Understanding Poverty: A Community Questionnaire
 
DAY 0 8 A Revelation 05-19-2024 PPT.pptx
DAY 0 8 A Revelation 05-19-2024 PPT.pptxDAY 0 8 A Revelation 05-19-2024 PPT.pptx
DAY 0 8 A Revelation 05-19-2024 PPT.pptx
 
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdfMicrosoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
Microsoft Fabric Analytics Engineer (DP-600) Exam Dumps 2024.pdf
 
The Influence and Evolution of Mogul Press in Contemporary Public Relations.docx
The Influence and Evolution of Mogul Press in Contemporary Public Relations.docxThe Influence and Evolution of Mogul Press in Contemporary Public Relations.docx
The Influence and Evolution of Mogul Press in Contemporary Public Relations.docx
 
Breathing in New Life_ Part 3 05 22 2024.pptx
Breathing in New Life_ Part 3 05 22 2024.pptxBreathing in New Life_ Part 3 05 22 2024.pptx
Breathing in New Life_ Part 3 05 22 2024.pptx
 
Databricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdfDatabricks Machine Learning Associate Exam Dumps 2024.pdf
Databricks Machine Learning Associate Exam Dumps 2024.pdf
 
ServiceNow CIS-Discovery Exam Dumps 2024
ServiceNow CIS-Discovery Exam Dumps 2024ServiceNow CIS-Discovery Exam Dumps 2024
ServiceNow CIS-Discovery Exam Dumps 2024
 
2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx2024-05-15-Surat Meetup-Hyperautomation.pptx
2024-05-15-Surat Meetup-Hyperautomation.pptx
 
Deciding The Topic of our Magazine.pptx.
Deciding The Topic of our Magazine.pptx.Deciding The Topic of our Magazine.pptx.
Deciding The Topic of our Magazine.pptx.
 
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdfACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
ACM CHT Best Inspection Practices Kinben Innovation MIC Slideshare.pdf
 

Automatic functional testing easier than you thought Bartosz Cisek

  • 1. Functional testing easier than you thought Bartosz Cisek Edu-Space.pl 16.04.2014 Bartosz Cisek Functional testing easier than you thought 1 / 20
  • 2. Do not reinvent the wheel Moodle already has: • integrated testing framework • well defined building blocks • prepared scripts • detailed documentation Bartosz Cisek Functional testing easier than you thought 2 / 20
  • 3. Requirements • php 5.4 • separate domain • Internet access (only for installation) Bartosz Cisek Functional testing easier than you thought 3 / 20
  • 4. Installation • Download composer and let it do the rest. • Download Selenium, Java and chrome driver. Bartosz Cisek Functional testing easier than you thought 4 / 20
  • 5. Setup second platform • First one runs test • Second one is being tested Bartosz Cisek Functional testing easier than you thought 5 / 20
  • 6. Update configuration • $CFG→behat prefix • $CFG→behat dataroot • $CFG→behat wwwroot Bartosz Cisek Functional testing easier than you thought 6 / 20
  • 7. Test run • Start Selenium command line java -jar selenium-server-standalone-2.NN.N.jar • Start behat command line php admin/tool/behat/cli/init.php vendor/bin/behat –config /behat/dataroot/behat/behat.yml • As an example run tests of default Moodle installation Bartosz Cisek Functional testing easier than you thought 7 / 20
  • 8. Writing test cases • start favorite editor • yaml format • create a file with .feature extension in tests/behat directory Bartosz Cisek Functional testing easier than you thought 8 / 20
  • 9. File structure @plugintype @plugintype_plugin Feature: feature name description Scenario: Short description of scenario step 1 step 2 Scenario: Another scenario to test this feature step 1 step 2 Bartosz Cisek Functional testing easier than you thought 9 / 20
  • 10. Feature and Scenario • Feature – Human-readable list of scenarios that describes a feature. • Scenario – Human-readable list of steps to describe an expected behavior Bartosz Cisek Functional testing easier than you thought 10 / 20
  • 11. Scenario steps • Steps – Human-readable sentences that describes an action. • Steps definitions – php classes written in mink dialect Bartosz Cisek Functional testing easier than you thought 11 / 20
  • 12. Types of steps 1 • “Given” – describing the initial context example Given I log in as ”admin” Bartosz Cisek Functional testing easier than you thought 12 / 20
  • 13. Types of steps 2 • “When“ – action that leads to a change example When I click on a link Bartosz Cisek Functional testing easier than you thought 13 / 20
  • 14. Types of steps 3 • “Then” – check the results example Then I should see ”Moodle 101: Course Name” Bartosz Cisek Functional testing easier than you thought 14 / 20
  • 15. Fixtures • Prepare predefined environment • Testing enrollment requires users and courses Given the following "courses" exist: | fullname | shortname | category | format | | Course 1 | COURSE1 | CAT1 | topics | | Course 2 | COURSE2 | CAT2 | | Bartosz Cisek Functional testing easier than you thought 15 / 20
  • 16. Filtering • You can filter features to test with –tags or –name options Bartosz Cisek Functional testing easier than you thought 16 / 20
  • 17. Continuous Integration Manager • Jenkins • Computers are good at repeating procedures • Automate mundane tasks Bartosz Cisek Functional testing easier than you thought 17 / 20
  • 18. Automatic Workflow Bartosz Cisek Functional testing easier than you thought 18 / 20
  • 19. Flexibility • Build script (ant, phing) • Repository (git, hg, svn) • Head less window manager – Xvfb Bartosz Cisek Functional testing easier than you thought 19 / 20
  • 20. Summary • It is not rocket science! • http://docs.moodle.org/dev/Acceptance_testing Contact: • b.cisek@edu-space.pl • +48 604 874 555 Bartosz Cisek Functional testing easier than you thought 20 / 20