2014-04-24

How to initiate CodeCeption Test Suite?

In this article we are going to see commands on how to start CodeCeption Test by initiating Test Suit. In this part we will see
A. How to install codeception? and
B. How to generate test suite ? in Two ways.

As we know, in codeception test, a Test Suite will contain, Acceptance Test case, Functional Test Case and Unit Test Case. So, when we initiate the suite, a folder structure will be generated where these there type of test will be there. I will make a separate post on what are those folder structure.

I am using PHPstorm as IDE. We must have PHP installed and set in environment path(see this post)
So, We can generate in 2 ways.

1. Using codecept.phar : (If we download this phar and then try to make the suit) : (download link)

a. Keep the downloaded codecept.phar in root of the project
b. Open Command Line and go to the root of the project
c. Write Command : php codecept.phar bootstrap
image

We will see a new folder inside of the project root tests and a configuration settings yml file codeception.yml
So, we have created the test suite for codeception test.

2. Using composer package manager: Install composer and keep composer in path variable(you can use my this post)

a. Go to project Root folder and create a composer.json file(I use empty text file and rename). This is actually composer package definition file. We will add our codeception package here.
b. open that composer.json file with text editor and add following in this file
{
    "require": {
        "codeception/codeception": "*"
    }
}
image
c. Open command prompt and go to Root of the project.
image
d. Write Command (for updating package, this will install codeception) :  composer update
We will see a folder named vendor. It contains codeception executable along with all necessary packages(from method 1, our codecept.phar contains all in zipped format)
image
e. From command prompt write and run the command : 
For Windows .\vendor\bin\codecept bootstrap
For Linux : ./vendor/bin/codecept bootstrap

image
This will do the the same thing like as previous method. It will create tests folder that contain three type of tests along with codeception.yml.
 So, test suit created. Now we are ready for writing test cases.

Thanks …:) 

2014-04-12

How to install GIT in Windows

In this article, we are going to learn about how to install GIT system in windows. Specifically Git and GitHub Client. The main goal is to make a software development environment with GIT.

As we know, GIT is a file management system with version controlling. We will use git to manage our developed source files. And, as Git maintain repository(public free, private paid), we will use them. I will make separate posts for GIT architecture and Git Commands.

So, For installing GIT System( lets call is system because it consists of more than one software). we need to download these two installers.

A. Git Environment Installer : We need that to support git commands in the system . Use latest build. I will use 1.9
B. Git- Hub windows client : We will use the GUI to manage out repository(folder in git hub & Local)
And, dont’ forget to have a account in github.com. Its free. Now, lets get started with following steps.

Step 1.
Run Git-1.9.0-preview20140217.exe installer in windows( I am using windows 7x64). Follow the full process of installation. In the process you have to take care of following things.

a. Select the advance context menu
image
b.  I like to use Windows Command Prompt rather than others
image

c. I prefer windows style for checking & commit.
image

d. Though the application will include in the path but make sure that you have this in your path variable.
image

Please check that you have installed Git. To do that, open command prompt and type git –version
And you will see git version number

image

We will get Git-Bash and Git Gui in program files. Git Gui is gui control of git command. We can create SSH key , repository using GUI also.  We will use Git hub client to do that.
So, we have successfully Installed Git in the system. Now, it is time to install Git Hub client.

Step 2.
Run Git hub windows client (GitHubSetup.exe). And follow steps that required to complete setup.

a. Log in with exist username /password or create a new account in GitHub.
image

b, After log in, We will see that our Windows Client has already add a SSH key with PC Name. If we go to this link with our account , we see a new entry. I will provide another post for how to create and use custom SSH key with key generation tool.

image

c. Now, we have define the Local directory where our repository will be downloaded. To do that,image

we have to go to Tools –> Option, Then we get the default location and PowerShell as default shell. This part is fully optional, I like Git Bash, so I use GitBash(some time I use Cmd also).
image
Now, press Update and we have completed the Github Windows Client setup.
We can Get our repositories from left panel of client and select the project/repository and click Clone. (actually cloning the repository)
image image

I will provide a separate blog for Git Architecture, Terms as well as Commands. 

Note : We may use TortoiseGIT which is very handy. If you are too much familiar with TortoiseSVN, I would recommend to use TortoiseGIT.

Thanks.. :)