Pages

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.

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 dataH. 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)