SlideShare a Scribd company logo
CodeCeption
Important: testing is important for every project
Codeception is a modern full-stack testing framework for PHP. Inspired
by BDD, it provides an absolutely new way of writing acceptance,
functional and even unit tests. Powered by PHPUnit.
$I->amOnPage('/');
$I->click('Pages');
$I->click('New');
$I->see('New Page');
$I->submitForm('form#new_page', ['title' => 'Movie Review']);
$I->see('page created'); // notice generated
$I->see('Movie Review','h1'); // head of page of is our title
$I->seeInCurrentUrl('pages/movie-review'); // slug is generated
$I->seeInDatabase('pages', ['title' => 'Movie Review']); // data is
stored in database
Sample test
Codeception
installation
1. Install via Composer
composer require "codeception/codeception" –dev
2. Execute:
php vendor/bin/codecept bootstrap
This creates configuration file codeception.yml and tests directory and default test suites.
3. Create Test
3.Generate your first acceptance test. Acceptance tests emulate behavior of a real user visiting your site.
php vendor/bin/codecept generate:cest acceptance First
4. Please make sure your local development server is running.
Put application URL into: tests/acceptance.suite.yml
actor: AcceptanceTester
modules:
enabled:
- PhpBrowser: url: {YOUR APP'S URL}
- HelperAcceptance
5. Write a Basic Test
It's now time to write your first test. Edit the file we've just created tests/acceptance/FirstCest.php
class FirstCest
{
public function frontpageWorks(AcceptanceTester $I)
{
$I->amOnPage('/');
$I->see('Home');
}
}
It will check that your frontpage contains the word Home in it.
Summary
https://codeception.com/quickstart
https://www.slideshare.net/AndreiBurian/codeception-presentation

More Related Content

PDF
Javascript Test Automation Workshop (21.08.2014)
PDF
Introduction to Protractor
PPTX
Protractor framework – how to make stable e2e tests for Angular applications
PPTX
Testing frontends with nightwatch & saucelabs
KEY
Agile JavaScript Testing
PDF
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
PPTX
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
PDF
Vuejs testing
Javascript Test Automation Workshop (21.08.2014)
Introduction to Protractor
Protractor framework – how to make stable e2e tests for Angular applications
Testing frontends with nightwatch & saucelabs
Agile JavaScript Testing
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Vuejs testing

What's hot (20)

PDF
Better Testing With PHP Unit
PDF
The Road to Native Web Components
PPTX
Automation testing with Drupal 8
PDF
Nicolas Embleton, Advanced Angular JS
PDF
Painless JavaScript Testing with Jest
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
PPT
Testing in AngularJS
PDF
Automated Testing with Ruby
DOC
Selenium Automation Using Ruby
PDF
CasperJs Enjoy Functional Testing
PDF
Superfast Automated Web Testing with CasperJS & PhantomJS
PDF
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
PPTX
A few good JavaScript development tools
PDF
CasperJS and PhantomJS for Automated Testing
PDF
Intro to testing Javascript with jasmine
PDF
Testing MeteorJS using CasperJS
PDF
Backbone.js
KEY
BDD with Behat and Symfony2
PDF
One step in the future: CSS variables
PDF
Testing mit Codeception: Full-stack testing PHP framework
Better Testing With PHP Unit
The Road to Native Web Components
Automation testing with Drupal 8
Nicolas Embleton, Advanced Angular JS
Painless JavaScript Testing with Jest
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Testing in AngularJS
Automated Testing with Ruby
Selenium Automation Using Ruby
CasperJs Enjoy Functional Testing
Superfast Automated Web Testing with CasperJS & PhantomJS
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
A few good JavaScript development tools
CasperJS and PhantomJS for Automated Testing
Intro to testing Javascript with jasmine
Testing MeteorJS using CasperJS
Backbone.js
BDD with Behat and Symfony2
One step in the future: CSS variables
Testing mit Codeception: Full-stack testing PHP framework
Ad

Similar to Code ceptioninstallation (20)

PDF
Acceptance testing in php with Codeception - Techmeetup Edinburgh
PDF
Testing PHP with Codeception
PDF
Codeception: introduction to php testing
PDF
Codeception: introduction to php testing (v2 - Aberdeen php)
PPTX
Codeception
PDF
Codeception presentation
PPTX
Test automation with php codeception
PDF
Mykhailo Bodnarchuk "The history of the Codeception project"
PDF
Testing with Codeception
PDF
Acceptance & Functional Testing with Codeception - Devspace 2015
PDF
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
PDF
Codeception introduction and use in Yii
PDF
Testing TYPO3 Applications
PDF
Testing with Codeception (Webelement #30)
PDF
Workshop quality assurance for php projects - phpdublin
KEY
Workshop quality assurance for php projects tek12
PDF
Quality Assurance for PHP projects - ZendCon 2012
PDF
Refactoring using Codeception
PDF
Code Coverage for Total Security in Application Migrations
PDF
From Good to Great: Functional and Acceptance Testing in WordPress.
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Testing PHP with Codeception
Codeception: introduction to php testing
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception
Codeception presentation
Test automation with php codeception
Mykhailo Bodnarchuk "The history of the Codeception project"
Testing with Codeception
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Codeception introduction and use in Yii
Testing TYPO3 Applications
Testing with Codeception (Webelement #30)
Workshop quality assurance for php projects - phpdublin
Workshop quality assurance for php projects tek12
Quality Assurance for PHP projects - ZendCon 2012
Refactoring using Codeception
Code Coverage for Total Security in Application Migrations
From Good to Great: Functional and Acceptance Testing in WordPress.
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Institutional Correction lecture only . . .
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Classroom Observation Tools for Teachers
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
VCE English Exam - Section C Student Revision Booklet
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Institutional Correction lecture only . . .
Microbial disease of the cardiovascular and lymphatic systems
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
TR - Agricultural Crops Production NC III.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Anesthesia in Laparoscopic Surgery in India
102 student loan defaulters named and shamed – Is someone you know on the list?
Classroom Observation Tools for Teachers
Module 4: Burden of Disease Tutorial Slides S2 2025
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
VCE English Exam - Section C Student Revision Booklet

Code ceptioninstallation

  • 1. CodeCeption Important: testing is important for every project
  • 2. Codeception is a modern full-stack testing framework for PHP. Inspired by BDD, it provides an absolutely new way of writing acceptance, functional and even unit tests. Powered by PHPUnit. $I->amOnPage('/'); $I->click('Pages'); $I->click('New'); $I->see('New Page'); $I->submitForm('form#new_page', ['title' => 'Movie Review']); $I->see('page created'); // notice generated $I->see('Movie Review','h1'); // head of page of is our title $I->seeInCurrentUrl('pages/movie-review'); // slug is generated $I->seeInDatabase('pages', ['title' => 'Movie Review']); // data is stored in database Sample test
  • 3. Codeception installation 1. Install via Composer composer require "codeception/codeception" –dev 2. Execute: php vendor/bin/codecept bootstrap This creates configuration file codeception.yml and tests directory and default test suites. 3. Create Test 3.Generate your first acceptance test. Acceptance tests emulate behavior of a real user visiting your site. php vendor/bin/codecept generate:cest acceptance First 4. Please make sure your local development server is running. Put application URL into: tests/acceptance.suite.yml actor: AcceptanceTester modules: enabled: - PhpBrowser: url: {YOUR APP'S URL} - HelperAcceptance
  • 4. 5. Write a Basic Test It's now time to write your first test. Edit the file we've just created tests/acceptance/FirstCest.php class FirstCest { public function frontpageWorks(AcceptanceTester $I) { $I->amOnPage('/'); $I->see('Home'); } } It will check that your frontpage contains the word Home in it.