Sunday, September 14, 2014

Installation and Configuration of Codeception with Composer

Installation and Configuration of Codeception with Composer:

What is Composer: Basically composer is dependency manager for php.If you have ever worked with PHP you must have got the feeling that for some of the common tasks you need to look for the dependencies for various frameworks like zend, laravel or symphony etc.
This is where Composer comes into play.
It will manage all the dependencies required for different frameworks.
Composer will pull all the required stuffs(libraries,dependencies) and put them all in a common place.


1. Install composer to your projects root folder.
You can download the composer here.

2. Then we need to download all the codeception libraries and dependencies.

3. So create a new test folder say MyFirstTest and within this folder create a new json file called Composer.json.
Include the below lines od code within the Composer.json

{
"require-dev": {
"codeception/codeception": "*"
}
}


4. Now navigate to the MyFirstTest test folderand fire the below command.

composer install

You will notice a new folder called 'vendor' is added within our test folder.

5. Now to initialize our testing environment we need to install bootstrap.
Simply navigate to the path Codecept/vendor/bin and fire the below command.

codecept bootstrap

6. A new folder called tests should be added under bin folder after bootstrap installation.

7. Navigate to tests folder and you will see all unit,functional and acceptance folder has been created to define our tests.

Now we are ready to define our first acceptance test.

I have already discussed in my previous post. Please find it here.

Related Posts:

  • Codeception Helpers Codeception has always the flexibilty to add the add the custom actions to the test suite. It just doesn't restrict to add custom actions. 'bootstrap' is the command to that codeception generates these modules. These modules… Read More
  • Repopulation of database using mysql instead of db module What is DB module: The DB module is used to cleaning database before each test. So this module was added into codeception.yml. To have your database properly cleaned you should configure it to access the database. Also pro… Read More
  • Creation Of Cest Ever wanted a structure as classes for your Cepts! Then Cest format should be your choice. The biggest advantage is that it is very simple and compatibility with Cept scenarios. So if your script/test is bit lengthy and you … Read More
  • Codeception:Variables for UI Elements As we know we can write complex tests using codeception.Think of a scenario of a login page. We have generally 3 fields in login page. 1.User id fiels 2.Password field 3.Sign in button. We have created a test using codecep… Read More
  • Codeception Modules In Codception various modules are comes as packages initially. Some of them are Webdriver,symphony,Laravel etc. Modules allow you to choose the actions and assertions that can be performed in tests. All actions and assertion… Read More

0 comments:

Post a Comment

Powered by Blogger.