Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.



Michael Bodnarchuk

April 25, 2019
Tweet

More Decks by Michael Bodnarchuk

Other Decks in Technology

Transcript

  1. 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
  2. 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?
  3. 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?
  4. EVOLUTION OF PHP EVOLUTION OF PHP PHP was a templating

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

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

    Selenium? Can we test without English text What is BDD?
  7. 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
  8. 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');
  9. MY STORY (2012) MY STORY (2012) Project failed symfony1 stopped

    development Alternative frameworks: Zend, Yii, Symfony 2 but what about tests?
  10. MY STORY (2013-2016) MY STORY (2013-2016) Golden Age Sponsorship by

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

    phpunit wrapper (5.0-8.0) Community modules/extensions
  12. 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 $
  13. EVOLUTION OF PHP EVOLUTION OF PHP Business Logic in PHP

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

    unit tests integration tests functional (framework) acceptance (webserver-browser) => Codeception
  15. WHEN PHP IS NOT ENOUGH? WHEN PHP IS NOT ENOUGH?

    JS Testing Browser Testing JSON Wire WebDriver Protocol Mobile Testing native solutions Appium
  16. CONCLUSION CONCLUSION Find suitable level of testing unit integration functional

    acceptance Use what Codeception offers Use CodeceptJS for SPA or Mobile Testing Contribute back!