SlideShare a Scribd company logo
Test automation with
PHP Codeception
By Buddhi Eashwarage
What is Test automation
• Test automation means testing some application or software
by using another software tool or software framework to
compare actual outcomes with predicted outcomes.
• Or simply we can say, it is a process different from manual
testing 
What is Codeception
• Codeception is a modern full-stack testing framework for PHP.
Inspired by BDD, it provides you an absolutely new way of
writing acceptance, functional and even unit tests. Powered
by PHPUnit.
What is the application which
we are going to test
• We are going to test Joomla with Codeception.
• At the moment latest Joomla release is Joomla 3.4.1
• Joomla is a CMS built with PHP.
How to install Codeception
• Codeception allows two methods to install it. Those are ‘Phar’
and ‘Composer’ methods.
• I prefer to do the installation using Codeceptions’ Phar file.
• Phar is a php file type which allows to compress several php
files into a single php file. But user doesn’t need to extract it
to local drive to install it. By simply executing several
commands can install Codeception framework into application
being tested.
• My system specifications: Windows, XAMPP
Test automation with php codeception
• Once downloaded the Phar file, paste it to your website root
folder.
• In my case i’m using XAMPP. So my Phar file will go to
‘C:xampphtdocsJoomlacodecept.phar’
• Then open up your command line tool and I assume you have
already installed php into your system. You can check it by
simply entering ‘php -v’.
• If it shows your php version there then you have installed php
already.
PHP version
• Then navigate inside to your website root folder.
• Now let’s install Codeception.
• Type following commands in command line tool.
• ‘php codecept.phar bootstrap’
• This command creates codeception.yml file and tests
directory.
• Tests directory contains all the test scripts.
• Basically codeception has three types of testings. Such as
acceptance,functional and unit testings.
Acceptance Test
• Now we are going to crate our first acceptance test in
Codeception.
• Run following command in command line tool.
• This will creates BackendloginCept.php file inside acceptance
tests directory.
• Following is Joomla backend. We’re going to automate the
login process.
• First open following file to add the base url.
• Add your websites’ base url there.
• Add following lines to your acceptance test script.
• Finally you have to run the test script. For that type following
command in command line tool.
• ‘php codecept.phar run’
• You can see the output on your command line. If you have
done it correctly it should pass all the tests and assertions
successfully!!!
• Thank You

More Related Content

PDF
Testing with Codeception
PDF
Codeception: introduction to php testing
PDF
Codeception presentation
PDF
Acceptance testing in php with Codeception - Techmeetup Edinburgh
PDF
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
PDF
Codeception introduction and use in Yii
PDF
Acceptance & Functional Testing with Codeception - Devspace 2015
PDF
Testing PHP with Codeception
Testing with Codeception
Codeception: introduction to php testing
Codeception presentation
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Codeception introduction and use in Yii
Acceptance & Functional Testing with Codeception - Devspace 2015
Testing PHP with Codeception

What's hot (20)

PPTX
CI / CD w/ Codeception
PDF
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
PDF
Codeception
PPTX
Codeception
PDF
PHP Unit Testing in Yii
PDF
Testing with Codeception (Webelement #30)
PDF
Codeception: introduction to php testing (v2 - Aberdeen php)
PPTX
Automated Testing using JavaScript
PPTX
Automation using Javascript
PDF
Front-End Testing: Demystified
PDF
Unit-testing and E2E testing in JS
PPTX
Automated UI testing done right (DDDSydney)
PDF
Automated Web Testing using JavaScript
KEY
Jellyfish, JSCONF 2011
PDF
Testing Web Applications
PDF
Join the darkside: Selenium testing with Nightwatch.js
DOCX
Automation Frame works Instruction Sheet
PPTX
Automation testing with Drupal 8
PDF
Selenium 2 - PyCon 2011
ODP
Integration Testing in Python
CI / CD w/ Codeception
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Codeception
Codeception
PHP Unit Testing in Yii
Testing with Codeception (Webelement #30)
Codeception: introduction to php testing (v2 - Aberdeen php)
Automated Testing using JavaScript
Automation using Javascript
Front-End Testing: Demystified
Unit-testing and E2E testing in JS
Automated UI testing done right (DDDSydney)
Automated Web Testing using JavaScript
Jellyfish, JSCONF 2011
Testing Web Applications
Join the darkside: Selenium testing with Nightwatch.js
Automation Frame works Instruction Sheet
Automation testing with Drupal 8
Selenium 2 - PyCon 2011
Integration Testing in Python
Ad

Similar to Test automation with php codeception (20)

PDF
Testing mit Codeception: Full-stack testing PHP framework
PPTX
Code ceptioninstallation
PPTX
Codeception @ New Business Dept Adira Finance
PDF
Codeception Testing Framework -- English #phpkansai
PDF
Mykhailo Bodnarchuk "The history of the Codeception project"
PDF
WordCamp Montreal - Catching regressions faster with automated acceptance tests
PDF
From Good to Great: Functional and Acceptance Testing in WordPress.
PPTX
Autotests introduction - Codeception + PHP Basics
PDF
TDD for joomla extensions
KEY
Workshop quality assurance for php projects tek12
PPT
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
PDF
Intro to PHP Testing
PDF
Put an end to regression with codeception testing
PDF
Quality Assurance for PHP projects - ZendCon 2012
PDF
Catching regressions faster with automated acceptance tests
PDF
Testing TYPO3 Applications
PPTX
Joomla! Testing - J!DD Germany 2016
PPTX
Automated Testing
PPTX
Automated tests
KEY
Prepare for PHP Test Fest 2009
Testing mit Codeception: Full-stack testing PHP framework
Code ceptioninstallation
Codeception @ New Business Dept Adira Finance
Codeception Testing Framework -- English #phpkansai
Mykhailo Bodnarchuk "The history of the Codeception project"
WordCamp Montreal - Catching regressions faster with automated acceptance tests
From Good to Great: Functional and Acceptance Testing in WordPress.
Autotests introduction - Codeception + PHP Basics
TDD for joomla extensions
Workshop quality assurance for php projects tek12
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Intro to PHP Testing
Put an end to regression with codeception testing
Quality Assurance for PHP projects - ZendCon 2012
Catching regressions faster with automated acceptance tests
Testing TYPO3 Applications
Joomla! Testing - J!DD Germany 2016
Automated Testing
Automated tests
Prepare for PHP Test Fest 2009
Ad

Recently uploaded (20)

PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PPTX
web development for engineering and engineering
PPTX
OOP with Java - Java Introduction (Basics)
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
PDF
ETO & MEO Certificate of Competency Questions and Answers
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Geodesy 1.pptx...............................................
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPTX
436813905-LNG-Process-Overview-Short.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPT
Project quality management in manufacturing
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
web development for engineering and engineering
OOP with Java - Java Introduction (Basics)
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
ETO & MEO Certificate of Competency Questions and Answers
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Geodesy 1.pptx...............................................
Structs to JSON How Go Powers REST APIs.pdf
CH1 Production IntroductoryConcepts.pptx
Simulation of electric circuit laws using tinkercad.pptx
436813905-LNG-Process-Overview-Short.pptx
573137875-Attendance-Management-System-original
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Operating System & Kernel Study Guide-1 - converted.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
bas. eng. economics group 4 presentation 1.pptx
Project quality management in manufacturing
Arduino robotics embedded978-1-4302-3184-4.pdf

Test automation with php codeception

  • 1. Test automation with PHP Codeception By Buddhi Eashwarage
  • 2. What is Test automation • Test automation means testing some application or software by using another software tool or software framework to compare actual outcomes with predicted outcomes. • Or simply we can say, it is a process different from manual testing 
  • 3. What is Codeception • Codeception is a modern full-stack testing framework for PHP. Inspired by BDD, it provides you an absolutely new way of writing acceptance, functional and even unit tests. Powered by PHPUnit.
  • 4. What is the application which we are going to test • We are going to test Joomla with Codeception. • At the moment latest Joomla release is Joomla 3.4.1 • Joomla is a CMS built with PHP.
  • 5. How to install Codeception • Codeception allows two methods to install it. Those are ‘Phar’ and ‘Composer’ methods. • I prefer to do the installation using Codeceptions’ Phar file. • Phar is a php file type which allows to compress several php files into a single php file. But user doesn’t need to extract it to local drive to install it. By simply executing several commands can install Codeception framework into application being tested. • My system specifications: Windows, XAMPP
  • 7. • Once downloaded the Phar file, paste it to your website root folder. • In my case i’m using XAMPP. So my Phar file will go to ‘C:xampphtdocsJoomlacodecept.phar’ • Then open up your command line tool and I assume you have already installed php into your system. You can check it by simply entering ‘php -v’. • If it shows your php version there then you have installed php already.
  • 9. • Then navigate inside to your website root folder. • Now let’s install Codeception. • Type following commands in command line tool. • ‘php codecept.phar bootstrap’ • This command creates codeception.yml file and tests directory. • Tests directory contains all the test scripts. • Basically codeception has three types of testings. Such as acceptance,functional and unit testings.
  • 10. Acceptance Test • Now we are going to crate our first acceptance test in Codeception. • Run following command in command line tool.
  • 11. • This will creates BackendloginCept.php file inside acceptance tests directory. • Following is Joomla backend. We’re going to automate the login process.
  • 12. • First open following file to add the base url. • Add your websites’ base url there.
  • 13. • Add following lines to your acceptance test script.
  • 14. • Finally you have to run the test script. For that type following command in command line tool. • ‘php codecept.phar run’ • You can see the output on your command line. If you have done it correctly it should pass all the tests and assertions successfully!!! • Thank You