8K Views

Testing with codeception

Updated 10 December 2021

Facebook Linkedin

This article is part of a series on Testing with Codeception in general and How we start our Automation Testing with Codeception in PHP in particular:

Here we’re discussing Codeception, what is Codeception and why we use Codeception in testing. Before Codeception we have to know about what is Testing, it means to validate or verify any software or technology.

We use Codeception framework for testing in any application now Codeception is testing framework for PHP in which we write Acceptance, Functional and Unit Test scenarios.

Acceptance Testing means testing done on the client side, it is also called User Acceptance Testing which means to verify any product on the client side.
Functional Testing means testing done to check the functionality of system whether our applications are working fine or not.
Unit Testing means unit part of components of the application is going to be tested. Now Welcome to the world of Codeception, It allows writing Unit, Functional, Integration, and Acceptance tests in a single, coherent style.

All Codeception tests are written in a descriptive manner. Just by looking at the test body, you can clearly understand what is being tested and how it is performed. Likewise, we have many frameworks in testing but in Codeception we associated with  BDD (Behavior Driven Development) framework and  TDD (Test driven development) now to understand Codeception we have to go through above two development framework.

The Main advantage of Codeception is we do not have to work for only one type of testing, we have all Three! and later or sooner we will need all Three. That’s why Codeception consists “Suites” means collection. A “Unit suite” for all Unit tests, a “Functional suite” for all Functional tests, and an “Acceptance suite” for all Acceptance tests.

Here We use Codeception testing to test Create Ticket Panel in UVdesk.

Now we are using two type of framework in Codeception, that is BDD means “Behavior Driven Development” and TDD means “Test Driven development”, TDD focuses on how something will work, BDD focuses on why we build it at all.
what is BDD and why BDD?

BDD is normally for a nontechnical user, who is not able to understand any codes or framework like, we write scenarios in simple language below is the example for testing the Create Ticket request in UVdesk.

BDD test scenarios Represent Like:

so basically our purpose is to write scenarios which are easily understood by the Non-technical person in BDD framework.

As in above module, we know about BDD framework but one most important name associated with BDD that is ‘Behat‘. Behat is a tool that makes BDD possible and Behat is test framework for behavior driven development and Behat is written in PHP programming framework in a simple way, we can say Behat is used to make communication easy between clients and developers and many other during software development process. Behat scenarios are a series of Given, When and Then like an example is given below.

Behat is a tool that makes BDD possible and Behat is test framework for behavior driven development and Behat is written in PHP programming framework in a simple way, we can say Behat is used to make communication easy between clients and developers and many other during software development process. Behat scenarios are a series of Given, When and Then like an example is given below.

As a customer, I have some query regarding any product. I want to create a ticket in UVdesk panel regarding my product.
scenarios are described as:

These are the scenario of How Behat will work and it Represent BDD framework, so non-technical people easily understand the scenarios.
Now we will talk about TDD, TDD makes you think about the required behavior and hence the term ‘Behavior’ is more useful than the term ‘Test’. BDD is Behavior Driven Development which focuses on behavior and not tests. So here we discuss codes which are used to run our scenarios in TDD framework. A significant advantage of TDD is, it enables you to take small steps when writing software.

TDD is neither about “Testing” nor about “Design”.
TDD does not mean “write some of the tests, then build a system that passes the tests.
TDD does not mean “do lots of Testing”.

Before we perform TDD test, we have to know about basic guidelines.

These are the basic terms that we have to know before we start using TDD framework in testing.

Below are the examples for testing the Create Ticket in UVdesk in TDD manner, in which we test how a user can create a ticket in UVdesk.

Tag(s) BDD BEHAT TDD
Category(s) Codeception UVdesk
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.