coba
Functional Testing boilerplate
Last updated 4 years ago by sunupf .
MIT · Original npm · Tarball · package.json
$ cnpm install coba -g
SYNC missed versions from official npm registry.

Coba

Coba is simple tool to help us to do functional system testing easier.

##Installation

To install coba using npm you just need type

npm install coba

##Usage

coba support create test case, generate data

###Initiate Test

You can initiate functional test with

coba init name

//for example

coba init registration_page

###Generate data

For now coba just generate normal data and null data for invalid data.

First you need to edit config.js file and

var config = {
  /*
    browser that you use
  */
  'browser':'firefox',
  
  /*
    Scenario Test
  */
  'scenario':'test.js',

  /*
    Input form that available on your test page 
    Ex: 
      [
        {
          'type':'string',
          'selector':'.sel',
        }
      ]
  */
  'input':[
    {
      'type':'name',
      'selector': "[name='name']",
      'name':'name',
      'validation':['required','min:8','max:20']
    },
    {
      'type':'email',
      'selector': "[name='email']",
      'name':'email',
      'validation':['required','min:8','max:20']
    },
    {
      'type':'password',
      'selector': "[name='password']",
      'name':'password',
      'validation':['required','min:8']
    }
  ],
  
  /*
    your page test url
    Ex : http://www.example.com
  */
  'url':'http://todoapps.dev/register',
  
  /*
    data location ehich store our generated data
  */
  'data':'data.json'
  
}

After that we can call coba generate syntax

  coba generate input

after that you will have generated dataon your data.json. It will be like this

 {
    "value": {
      "[name='name']": "Cyril Kub",
      "[name='email']": "Summer.Hauck72@yahoo.com",
      "[name='password']": "qm0LbBWjANepvOy"
    },
    "result": "Your account has been created and activation link already send to your email"
  },
  {
    "value": {},
    "result": [
      "The name field is required.",
      "The email field is required.",
      "The password field is required."
    ]
  },
  {
    "value": {
      "[name='name']": "Camila Russel"
    },
    "result": [
      "The email field is required.",
      "The password field is required."
    ]
  }

And offcourse we provide result of the process, the result generated base on your validation on the input. for now it's just recognize required property :D

You can modified result message by create message.js on your current test folder

var messages = {
  'success': 'Your account has been created and activation link already send to your email',
  'required: "${name} field absolutelly required"
}

module.exports = messages;

After you generated input you can run test by

coba test config.js

But remember, before you run test you need Selenium standalone server to be run, check http://seleniumhq.com for download link

PS: Please note this, this project is unfinished project.

Current Tags

  • 1.0.29                                ...           latest (3 years ago)

29 Versions

  • 1.0.29                                ...           3 years ago
  • 1.0.28                                ...           3 years ago
  • 1.0.27                                ...           3 years ago
  • 1.0.26                                ...           3 years ago
  • 1.0.25                                ...           3 years ago
  • 1.0.24                                ...           3 years ago
  • 1.0.23                                ...           3 years ago
  • 1.0.22                                ...           4 years ago
  • 1.0.21                                ...           4 years ago
  • 1.0.20                                ...           4 years ago
  • 1.0.19                                ...           4 years ago
  • 1.0.18                                ...           4 years ago
  • 1.0.17                                ...           4 years ago
  • 1.0.16                                ...           4 years ago
  • 1.0.15                                ...           4 years ago
  • 1.0.14                                ...           4 years ago
  • 1.0.13                                ...           4 years ago
  • 1.0.12                                ...           4 years ago
  • 1.0.11                                ...           4 years ago
  • 1.0.10                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (15)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |