Skip to content

Latest commit

 

History

History
82 lines (70 loc) · 5.81 KB

README.md

File metadata and controls

82 lines (70 loc) · 5.81 KB

CodeSpecJS

Welcome to the CodeSpecJS. A Protractor and Cucumber.JS based framework that allow users to write UI Automation Tests without writing a single line of code.

Gherkin grammar is very popular among many BDD frameworks. CodeSpecJS is targeting to take it to the next level by eliminating the need to write code associated with the Gherkin grammar.

Key Feature

Getting Started

Step 1: Setting up the development environment

  1. You need to install NodeJs with NPM . You'll also need to install and configure Git .
  2. Latest version of Chrome

Step 2: Clone the project

git clone https://github.com/99xt/CodeSpecJS.git

Step 3: Install node packages

Step inside the project root folder and issue the following command to install node dependencies.

npm install

Step 4: Open sample tests

use VS Code to open the project

code .

now navigate to 'features' folder and open 'cat.feature' file see the readable test case

Feature: As a user I want to test google search so that I can search for Cats
   Scenario: Search google for cats
       Given Navigate to "http://www.google.com"
       And Wait for "Google Main Search Text Box" to appear
       Then I enter "Cats" to the "Google Main Search Text Box"
       And Click on "Search Button"
       And Wait for "Second Result Element Cats" to contain text "Cats"
  • This is a standard Cucumber feature specification file.
  • We are using CodeSpecJS pre-defined grammar to write the test above. A full set of Supported grammar with detail description can be found here

Thats it, you are now ready to run the test.

Step 5: Running the test

Inside the project root folder, issue the following command

npm run test

Note that first time execution may take few minutes since system need to download browser drivers and configure them You should see your test executed in Chrome browser, Results will be shown in your console log. A detailed HTML report is generated under <project_root>/results/reports. Open the html report and see the detailed results.

Where to go from here?

  1. Improve the tests you wrote here by learning how to integrate an Object Repository
  2. See what are the other pre-defined CodeSpecJS grammar you can use in your tests and experiment with them
  3. Learn how to integrate your test project with Jenkins (a proven Continuos Integration environment )
  4. Improve your productivity even more by configuring your IDE to auto complete CodeSpecJs Grammar