What are the modules in Codeception? Why we use those?

In this article we are going to see the all available modules of codeception and we will try to find out why we use which one.
As we know, codeception works in 3 ways(so 3 type test suites are there). I am adding modules under the suit category

1. Acceptance Test : Codeception test with browser. So, it works externally. We do not need application codebase to test that. All type of acceptance tests, user level functional test can be in this type. And available module 

A. WebDriver:  Previously it was Selenium and Selenium2. We need selenium selenium server and supported browsers. We can also add phantomJS browser in the server to run test. Note, we need to start the server before running tests.
B. PhpBrowser : Used in acceptance tests with non-javascript browser. One of the popular test browser in Codeception.
C. SOAP : For testing SOAP WSDL web services with PhpBrowser or Frameworks. It sends requests and check if response matches the pattern.
D: REST : To test REST WebService with PhpBrowser or Frameworks.
E: XMLRPC : For testing XMLRPC WebService with frameworks or PHPBrowser

2. Functional Test : Codeception test with command line frameworks. So, all functional and API tests are in this category. We need project code to test them.

A. Dbd: This replaced Db module (in functional and unit testing). It requires PDO instance to be set.
B. Laravel 4 : For writing functional tests for Laravel
C. Symfony1 : For working with Symfony 1.4 application. Doctrine and sfDoctrineGuardPlugin are used to Authorization features.
D. Symfony2 : Uses Symfony2 crawler and HttpKernel to emulate requests & get responses.
E. Yii1 : it provides integration with Yii framework. We need to install Codeception-Yii Bridge which have component wrappers.
F: Yii2: This module provides integration with Yii2 Framework.
G: ZF1 : To run tests inside Zend Framework. It is like ControllerTestCase with Codeception syntax.
H: ZF2 : This module allows you to run tests inside Zend Framework 2.
I : Silex : For testing Silex applications like you would regularly do with Silex\WebTestCase
J : Phalcon1 : This module provides integration with Phalcon framework (1.x) for testing.
K : Kohana : Used for integration with Kohana v3 functional tests.

3. Unit Test : Like as functional test, codeception run that internally with PHPUnit. So , we need code to test.
A: Dbh : (described in functional test)

4. API Test : For testing api with wither acceptance test or functional tests
A. Facebook : Provides testing for projects integrated with Facebook API

Independent Module : Some spatial modules can be used commonly or independently with any suit. 
A. AMQP : This module interacts with message broker software that implements the AMQP(Advanced Message Queuing Protocol) standard. 
B. CLI : Which is a wrapper for basic shell command. 
C: Doctrine1 : Allows integration and testing for projects with Doctrine1.x ORM. 
D: Doctrine2 : Allows integration and testing for projects with Doctrine2 ORM. 
E: Db: This module works with SQL Database. 
F. Filesystem : Module for testing local file system. (extendable for FTP/Amazon s3, others ) 
G. MongoDb : Works on MongoDB database. In order to have your database populated with data you need a valid js file with data 
H. Redis : Works on Redis Database. 
I. Sequence : It works on data clean up. This is used for initiating data in database for testing and we can clean up. It has no effect on testing but have on initiating test data. 
J. Memcache : Connects to memcached to perform cleanup by flashing all values after each test run.
K : Asserts : A module for different assertions (validations)


No comments:

Post a Comment