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)

PPTX
Getting started with PHPUnit
PPTX
Selenium Training in Chennai
PDF
Continuous Integration at Mollie
PDF
Testing mit Codeception: Full-stack testing PHP framework
PPTX
Devops interview questions 2 www.bigclasses.com
PDF
TDD for joomla extensions
PDF
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
PDF
Unit testing symfony plugins with php unit
PPTX
Robot framework
PDF
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
PPTX
Robot Framework
PDF
Selenium Ide Tutorial
PDF
Php Conference Brazil - Phalcon Giant Killer
PPTX
Deploying your app.pptx
PPTX
Hudson
 
PPTX
Automation testing on ios platform using appium
PDF
Joomla Code Quality Control and Automation Testing
KEY
Continuous Integration In A PHP World
PPT
Php Development Stack
PPT
Php Development Stack
Getting started with PHPUnit
Selenium Training in Chennai
Continuous Integration at Mollie
Testing mit Codeception: Full-stack testing PHP framework
Devops interview questions 2 www.bigclasses.com
TDD for joomla extensions
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Unit testing symfony plugins with php unit
Robot framework
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
Robot Framework
Selenium Ide Tutorial
Php Conference Brazil - Phalcon Giant Killer
Deploying your app.pptx
Hudson
 
Automation testing on ios platform using appium
Joomla Code Quality Control and Automation Testing
Continuous Integration In A PHP World
Php Development Stack
Php Development Stack
Ad

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
bas. eng. economics group 4 presentation 1.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Welding lecture in detail for understanding
PPTX
Construction Project Organization Group 2.pptx
PPTX
Geodesy 1.pptx...............................................
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
Well-logging-methods_new................
PDF
Digital Logic Computer Design lecture notes
PPTX
web development for engineering and engineering
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
bas. eng. economics group 4 presentation 1.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
573137875-Attendance-Management-System-original
CYBER-CRIMES AND SECURITY A guide to understanding
Sustainable Sites - Green Building Construction
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Welding lecture in detail for understanding
Construction Project Organization Group 2.pptx
Geodesy 1.pptx...............................................
Arduino robotics embedded978-1-4302-3184-4.pdf
Well-logging-methods_new................
Digital Logic Computer Design lecture notes
web development for engineering and engineering
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx

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