SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Testing with 
CODECEPTION 
“boot your tests in PHP is a real pain” 
Adam Štipák | @new_POPE
Testing tools 
● PHPUnit [https://phpunit.de/] 
● NetteTester [http://tester.nette.org/en/] 
● Simpletest [http://www.simpletest.org/] 
● Testify.php [http://tutorialzine.com/projects/testify/] 
● etc ...
Testing tools 
Yes, they are really cool, 
but it is a little problem here.
Problem 
LOW LEVEL
How can I set up other things? 
● Selenium tests 
● API tests 
● Functional tests 
● Access to DB for check a state or setup prerequisities 
● Data cleanup 
● and many, many things...
You can set up it manually, 
but WHY???
Just try CODECEPTION
Features 
● very fast setup 
● Unit (powered by PHPUnit) 
● API (REST, SOAP, XML-RPC) 
● Functional (Symfony2, Laravel, Yii, Zend) 
● Acceptance (PhpBrowser, Selenium) 
● Db (Db, Doctrine 1 & 2) 
● BDD - style readable tests 
● Modules & Addons !!!
Very fast setup - installation 
$ bin/composer.phar require “codeception/codeception:*” 
$ vendor/bin/codeception bootstrap 
$ .../codeception generate:cept acceptance Welcome
Very fast setup - write a test 
// /tests/acceptance/WelcomeCept.php 
$I = new AcceptanceTester($scenario); 
$I->wantTo('ensure that frontpage works'); 
$I->amOnPage('/'); 
$I->see('Home');
Very fast setup - configure 
// /tests/acceptance.suite.yml 
class_name: AcceptanceGuy 
modules: 
enabled: [PhpBrowser, AcceptanceHelper] 
# WebDriver instead of PhpBrowser for Selenium 
config: 
PhpBrowser: 
url: '{YOUR APP'S URL}'
Very fast setup - run 
$ vendor/bin/codeception run 
Suite acceptance started 
Trying to ensure that frontpage works (WelcomeCept.php) - Ok 
Suite functional started 
Suite unit started 
Time: 1 second, Memory: 21.00Mb 
OK (1 test, 1 assertions)
API - config 
class_name: ApiTester 
modules: 
enabled: [PhpBrowser, REST, ApiHelper] 
config: 
PhpBrowser: 
url: http://serviceapp/ 
REST: 
url: http://serviceapp/api/v1
API - test 
$I = new ApiTester($scenario); 
$I->wantTo('create a user via API'); 
$I->haveHttpHeader('Content-Type', 
'application/json'); 
$I->sendPOST('/users', ['name' => 'davert']); 
$I->seeResponseCodeIs(201); 
$I->seeResponseIsJson(); 
$I->seeResponseContains('{"result":"ok"}');
Db - config 
modules: 
enabled: [Db] 
config: 
Db: 
dsn: 'mysql:host=localhost;dbname=testdb' 
user: 'root' 
password: '' 
dump: 'tests/_data/dump.sql' 
populate: true 
cleanup: false
Db - test 
$I->haveInDatabase('users', ['name' => 'miles']); //* 
// $I->dontSeeInDatabase 
$I->seeInDatabase('users', [ 
'name' => 'Davert', 
'email' => 'davert@mail.com' 
]);
Modules & addons 
● PhpBrowser 
● Queue 
● REST 
● Redis 
● SOAP 
● Sequence 
● Silex 
● Symfony 1 
● Symfony 2 
● WebDriver 
● XMLRPC 
● Yii 1 
● Yii2 
● Zend 1 & 2 
● AMQP 
● Asserts 
● Cli 
● Db 
● Dbh 
● Doctrine 1 & 2 
● FTP 
● Facebook 
● Filesystem 
● Kohana 
● Laravel4 
● Memcache 
● MongoDb 
● Phalcon1
Modules & addons 
● PhpBuiltinServer 
● Phantoman 
● and many others ...
FAQ 
● how can I setup different URLs for REST? 
● can I write OO oriented tests? 
● what is interactive console? 
● can I use DRY principle in tests (for login)?
Thanks 
Adam Štipák | @new_POPE

Más contenido relacionado

La actualidad más candente

Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentationAndrei Burian
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in YiiIlPeach
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Joe Ferguson
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Adam Christian
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and ProtractorFilipe Falcão
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascriptkhanhdang1214
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScriptSimon Guest
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: DemystifiedSeth McLaughlin
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8nagpalprachi
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web ApplicationsSeth McLaughlin
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeColdFusionConference
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David TorroijaDavid Torroija
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJSKrishna Kumar
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsLuís Bastião Silva
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsSeth McLaughlin
 

La actualidad más candente (20)

Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011
 
AngularJS and Protractor
AngularJS and ProtractorAngularJS and Protractor
AngularJS and Protractor
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
 
Intro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio CodeIntro to JavaScript Tooling in Visual Studio Code
Intro to JavaScript Tooling in Visual Studio Code
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
Codeception
CodeceptionCodeception
Codeception
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJS
 
Codeception
CodeceptionCodeception
Codeception
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 

Similar a Testing with Codeception (Webelement #30)

Developing your own OpenStack Swift middleware
Developing your own OpenStack Swift middlewareDeveloping your own OpenStack Swift middleware
Developing your own OpenStack Swift middlewareChristian Schwede
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentMark Niebergall
 
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciollaJavascript tdd byandreapaciolla
Javascript tdd byandreapaciollaAndrea Paciolla
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)Ryan Mauger
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2markstory
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifePeter Gfader
 
Introducere in web
Introducere in webIntroducere in web
Introducere in webAlex Eftimie
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component PresentationJohn Coonen
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
 
Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)Ryan Mauger
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unitsitecrafting
 
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEnterprise PHP Center
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 

Similar a Testing with Codeception (Webelement #30) (20)

Developing your own OpenStack Swift middleware
Developing your own OpenStack Swift middlewareDeveloping your own OpenStack Swift middleware
Developing your own OpenStack Swift middleware
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to Deployment
 
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciollaJavascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)Webinar: Zend framework Getting to grips (ZF1)
Webinar: Zend framework Getting to grips (ZF1)
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs Life
 
Introducere in web
Introducere in webIntroducere in web
Introducere in web
 
Full Stack Unit Testing
Full Stack Unit TestingFull Stack Unit Testing
Full Stack Unit Testing
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Core Php Component Presentation
Core Php Component PresentationCore Php Component Presentation
Core Php Component Presentation
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)Zend framework: Getting to grips (ZF1)
Zend framework: Getting to grips (ZF1)
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Better Testing With PHP Unit
Better Testing With PHP UnitBetter Testing With PHP Unit
Better Testing With PHP Unit
 
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur PurnamaEPHPC Webinar Slides: Unit Testing by Arthur Purnama
EPHPC Webinar Slides: Unit Testing by Arthur Purnama
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 

Más de Adam Štipák

Techforce #5 es in 2018
Techforce #5   es in 2018Techforce #5   es in 2018
Techforce #5 es in 2018Adam Štipák
 
Rubyslava #66 (container edition)
Rubyslava #66 (container edition) Rubyslava #66 (container edition)
Rubyslava #66 (container edition) Adam Štipák
 
FEI Bratislava 2017 - Docker
FEI Bratislava 2017 - DockerFEI Bratislava 2017 - Docker
FEI Bratislava 2017 - DockerAdam Štipák
 
Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Adam Štipák
 
Introduction to Domain Driven Design (Webtlak #7)
Introduction to Domain Driven Design (Webtlak #7)Introduction to Domain Driven Design (Webtlak #7)
Introduction to Domain Driven Design (Webtlak #7)Adam Štipák
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAdam Štipák
 
from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)Adam Štipák
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local developmentAdam Štipák
 
Improve your workflow
Improve your workflowImprove your workflow
Improve your workflowAdam Štipák
 
Docker on OSX without pain
Docker on OSX without painDocker on OSX without pain
Docker on OSX without painAdam Štipák
 
How to be a full stack developer
How to be a full stack developerHow to be a full stack developer
How to be a full stack developerAdam Štipák
 
Independent components in Nette Framework
Independent components in Nette FrameworkIndependent components in Nette Framework
Independent components in Nette FrameworkAdam Štipák
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)Adam Štipák
 
Nette framework (WebElement #27 lightning talk)
Nette framework (WebElement #27 lightning talk)Nette framework (WebElement #27 lightning talk)
Nette framework (WebElement #27 lightning talk)Adam Štipák
 
FEI 2013 - Nette framework
FEI 2013 - Nette frameworkFEI 2013 - Nette framework
FEI 2013 - Nette frameworkAdam Štipák
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJSAdam Štipák
 
FEI - Nette framework
FEI - Nette frameworkFEI - Nette framework
FEI - Nette frameworkAdam Štipák
 

Más de Adam Štipák (19)

Techforce #5 es in 2018
Techforce #5   es in 2018Techforce #5   es in 2018
Techforce #5 es in 2018
 
Rubyslava #66 (container edition)
Rubyslava #66 (container edition) Rubyslava #66 (container edition)
Rubyslava #66 (container edition)
 
FEI Bratislava 2017 - Docker
FEI Bratislava 2017 - DockerFEI Bratislava 2017 - Docker
FEI Bratislava 2017 - Docker
 
Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?
 
Introduction to Domain Driven Design (Webtlak #7)
Introduction to Domain Driven Design (Webtlak #7)Introduction to Domain Driven Design (Webtlak #7)
Introduction to Domain Driven Design (Webtlak #7)
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local development
 
Improve your workflow
Improve your workflowImprove your workflow
Improve your workflow
 
Docker on OSX without pain
Docker on OSX without painDocker on OSX without pain
Docker on OSX without pain
 
How to be a full stack developer
How to be a full stack developerHow to be a full stack developer
How to be a full stack developer
 
Independent components in Nette Framework
Independent components in Nette FrameworkIndependent components in Nette Framework
Independent components in Nette Framework
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)
 
Nette framework (WebElement #27 lightning talk)
Nette framework (WebElement #27 lightning talk)Nette framework (WebElement #27 lightning talk)
Nette framework (WebElement #27 lightning talk)
 
FEI 2013 - Nette framework
FEI 2013 - Nette frameworkFEI 2013 - Nette framework
FEI 2013 - Nette framework
 
Why PhpStorm?
Why PhpStorm?Why PhpStorm?
Why PhpStorm?
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
 
FEI - Nette framework
FEI - Nette frameworkFEI - Nette framework
FEI - Nette framework
 
DP1
DP1DP1
DP1
 

Último

Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Balliameghakumariji156
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsMonica Sydney
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsMonica Sydney
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsPriya Reddy
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查ydyuyu
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...kumargunjan9515
 

Último (20)

Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 

Testing with Codeception (Webelement #30)

  • 1. Testing with CODECEPTION “boot your tests in PHP is a real pain” Adam Štipák | @new_POPE
  • 2. Testing tools ● PHPUnit [https://phpunit.de/] ● NetteTester [http://tester.nette.org/en/] ● Simpletest [http://www.simpletest.org/] ● Testify.php [http://tutorialzine.com/projects/testify/] ● etc ...
  • 3. Testing tools Yes, they are really cool, but it is a little problem here.
  • 5. How can I set up other things? ● Selenium tests ● API tests ● Functional tests ● Access to DB for check a state or setup prerequisities ● Data cleanup ● and many, many things...
  • 6. You can set up it manually, but WHY???
  • 8. Features ● very fast setup ● Unit (powered by PHPUnit) ● API (REST, SOAP, XML-RPC) ● Functional (Symfony2, Laravel, Yii, Zend) ● Acceptance (PhpBrowser, Selenium) ● Db (Db, Doctrine 1 & 2) ● BDD - style readable tests ● Modules & Addons !!!
  • 9. Very fast setup - installation $ bin/composer.phar require “codeception/codeception:*” $ vendor/bin/codeception bootstrap $ .../codeception generate:cept acceptance Welcome
  • 10. Very fast setup - write a test // /tests/acceptance/WelcomeCept.php $I = new AcceptanceTester($scenario); $I->wantTo('ensure that frontpage works'); $I->amOnPage('/'); $I->see('Home');
  • 11. Very fast setup - configure // /tests/acceptance.suite.yml class_name: AcceptanceGuy modules: enabled: [PhpBrowser, AcceptanceHelper] # WebDriver instead of PhpBrowser for Selenium config: PhpBrowser: url: '{YOUR APP'S URL}'
  • 12. Very fast setup - run $ vendor/bin/codeception run Suite acceptance started Trying to ensure that frontpage works (WelcomeCept.php) - Ok Suite functional started Suite unit started Time: 1 second, Memory: 21.00Mb OK (1 test, 1 assertions)
  • 13. API - config class_name: ApiTester modules: enabled: [PhpBrowser, REST, ApiHelper] config: PhpBrowser: url: http://serviceapp/ REST: url: http://serviceapp/api/v1
  • 14. API - test $I = new ApiTester($scenario); $I->wantTo('create a user via API'); $I->haveHttpHeader('Content-Type', 'application/json'); $I->sendPOST('/users', ['name' => 'davert']); $I->seeResponseCodeIs(201); $I->seeResponseIsJson(); $I->seeResponseContains('{"result":"ok"}');
  • 15. Db - config modules: enabled: [Db] config: Db: dsn: 'mysql:host=localhost;dbname=testdb' user: 'root' password: '' dump: 'tests/_data/dump.sql' populate: true cleanup: false
  • 16. Db - test $I->haveInDatabase('users', ['name' => 'miles']); //* // $I->dontSeeInDatabase $I->seeInDatabase('users', [ 'name' => 'Davert', 'email' => 'davert@mail.com' ]);
  • 17. Modules & addons ● PhpBrowser ● Queue ● REST ● Redis ● SOAP ● Sequence ● Silex ● Symfony 1 ● Symfony 2 ● WebDriver ● XMLRPC ● Yii 1 ● Yii2 ● Zend 1 & 2 ● AMQP ● Asserts ● Cli ● Db ● Dbh ● Doctrine 1 & 2 ● FTP ● Facebook ● Filesystem ● Kohana ● Laravel4 ● Memcache ● MongoDb ● Phalcon1
  • 18. Modules & addons ● PhpBuiltinServer ● Phantoman ● and many others ...
  • 19. FAQ ● how can I setup different URLs for REST? ● can I write OO oriented tests? ● what is interactive console? ● can I use DRY principle in tests (for login)?
  • 20. Thanks Adam Štipák | @new_POPE