Save 37% off PRO during our Black Friday Sale! »

Codeception 3.0: Long Bloody Story

Codeception 3.0: Long Bloody Story

Codeception is a popular framework for all kind of testing. It helps you to find suitable level of testing and start writing tests in a pleasant and elegant way. This year a new major version of Codeception was released with new features to improve testing experience.

What stands behind this? Let's hear the story of Michael Bodnarchuk, PHP developer who started Codeception 7 years ago, and his journey to testing. What he learned by maintaining a testing framework and working as test consultant nowadays.



Aa0518da9d7119444cb02a8f27017d8a?s=128

Michael Bodnarchuk

April 25, 2019
Tweet

Transcript

  1. CODECEPTION 3.0 CODECEPTION 3.0 BLOODY LONG STORY BLOODY LONG STORY

  2. ABOUT ME ABOUT ME Michael Bodnarchuk @davert Lead developer of

    Codeception Testing Framework Also author of CodeceptJS, Robo and others Consultant @ Web developer from Kyiv, Ukraine SDCLabs
  3. CONFERENCE SPEAKER CONFERENCE SPEAKER

  4. TESTING IN PHP TESTING IN PHP

  5. UGLY PAST UGLY PAST <div id="page"> <div id="header" role="banner"> <div

    id="headerimg"> <h1><a href="<?php echo home_url(); ?>/"> <?php bloginfo('name'); ?></a> </h1> <div class="description"> <?php bloginfo('description'); ?> </div> </div> </div> <hr /> How would we test this?
  6. ELEGANT MODERNITY ELEGANT MODERNITY import React from 'react'; export default

    React.createClass({ render() { return ( <div className='container'> <Header title={this.props.title} link={this.props.home}> <div className="description"> {this.props.description} </div> </Header> {this.props.children} </div> ); } How would we test this?
  7. EVOLUTION OF PHP EVOLUTION OF PHP PHP was a templating

    language Business logic in C MiniSQL/MySQL - storage Commons - CMSes/Frameworks
  8. UNIT TESTS? UNIT TESTS? how? is PHP designed for unit

    testing? mocks? is PHP designed for long run?
  9. BROWSER TESTS ??? BROWSER TESTS ??? Can we test without

    Selenium? Can we test without English text What is BDD?
  10. MY STORY (2011) MY STORY (2011) Symfony1 project 2 developers

    framework-level functional tests lime testing framework tests saved our lives no one understood them
  11. MY VISION MY VISION $I = new TestGuy(); $I->amOnPage('/register'); $I->fillField('login',

    'davert'); $I->fillField('password', '123345'); $I->fillField('password_confirmation', '123345'); $I->click('Register'); $I->see('Hello, Davert');
  12. TESTGUY 1.0 TESTGUY 1.0 (original title) symfony1 plugin alternative to

    Behat+Mink
  13. MY STORY (2012) MY STORY (2012) Project failed symfony1 stopped

    development Alternative frameworks: Zend, Yii, Symfony 2 but what about tests?
  14. CODECEPTION 1.0 CODECEPTION 1.0 Symfony components PHPUnit wrapper Modules /

    Actors Suites Cept Self tests?
  15. MARKETING MARKETING Post on habr.ru reddit.com/r/php Comments in others post

    Early adopters Conferences
  16. MY STORY (2013-2016) MY STORY (2013-2016) Golden Age Sponsorship by

    Rebilly & 2Amigos Codeception = Full time job Getting traction and stability
  17. TODAY TODAY All major frameworks supported Custom modules (over 10)

    phpunit wrapper (5.0-8.0) Community modules/extensions
  18. ELEGANT MODERNITY ELEGANT MODERNITY <?php class Scanner { protected $url;

    protected $httpClient; public function __construct(HttpClient $httpClient, string $url) { $this->httpClient = $httpClient; $this->urls = $url; } public function isInvalidUrl() : bool { try { $statusCode = $this->getStatusCodeForUrl($url); \ i $
  19. EVOLUTION OF PHP EVOLUTION OF PHP Business Logic in PHP

    No templating SOLID principles Depdency Management via Composer
  20. HOW WOULD WE TEST THIS? HOW WOULD WE TEST THIS?

    unit tests integration tests functional (framework) acceptance (webserver-browser) => Codeception
  21. CODECEPTION 3.0 CODECEPTION 3.0

  22. PHPUNIT INTEGATION PHPUNIT INTEGATION PHPUnit 6.0-8.0 PHPUnit tests compatible Codecoverage

    Reports Assertions
  23. PHPUNIT COMPATIBILITY PHPUNIT COMPATIBILITY

  24. HOA CONSOLE HOA CONSOLE $I->pause(); Interactive REPL [Live Demo]

  25. CODE GENERATION CODE GENERATION Multiple Inheritance Auto Rebuilds Step Decorators

    loggers events conditional assertions tryTo retry
  26. MODULES MODULES PhpBrowser WebDriver Symfony/Laravel REST Db

  27. WHEN PHP IS NOT ENOUGH? WHEN PHP IS NOT ENOUGH?

    JS Testing Browser Testing JSON Wire WebDriver Protocol Mobile Testing native solutions Appium
  28. WHAT CAN WE DO? WHAT CAN WE DO? ==> CodeceptJS

    codecept.io
  29. CodeceptJS I.amOnPage('https://bugira.app/auth'); I.fillField('Email', email); I.click('Login'); I.wait(2); I.fillField('Password', secret(password)); I.click('Sign in');

    I.see('CodeceptJS Projects');
  30. CODECEPTJS HELPERS CODECEPTJS HELPERS webdriverio Protractor Puppeteer Appium REST

  31. CONCLUSION CONCLUSION Find suitable level of testing unit integration functional

    acceptance Use what Codeception offers Use CodeceptJS for SPA or Mobile Testing Contribute back!
  32. THANK YOU! THANK YOU! Try Codeception3 / CodeceptJS today! codeception.com

    codecept.io