Skip to content

A test framework for mobile, web and server integration test

Notifications You must be signed in to change notification settings

filehole/pychorus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pychorus

A test framework for mobile, web and server integration test, the old version is created by mzxu, refactored by myself.

Installation

python setup.py install

Create a project

>>chorussetup chorusproject

Launch

>>cd chorusproject
>>chorusrun

Modify Config file

>>chorusmodify -c default.cfg -s MYENV -k Scope -v Sanity,Regression
will change default.cfg file MYENV section key Scope value to "Sanity,Regression"

Supported assertions:

All unittest assertions

Internal assertions which will save baseline

>>assertBool(name, content, levels)
>>assertData(name, content, levels)
>>assertDataOnFly(name, data1, data2, levels, cptype)
>>assertHTTPResponse(name, response, levels, logic)
>>assertImageData(name, imagedata, levels, image_logic, imagetype)
>>assertScreenShot(name, driver, levels, image_logic, imagetype, elements, coordinates)
>>assertText(name, content, levels, logic)

Useful Tips

  1. chorusrun --color

It will give a colorful logs in command line, based on different log level.

  1. chorusrun -e MYENV

It will reload the environment to MYENV, and related keys in MYENV section will be reloaded in configinfo

  1. You may use from ChorusCore import ChorusGlobals to load global variables

  2. You may modify chorusrun.py to redesign the project preparation

  3. You may use from ChorusCore import Utils to import some common useful functions

  4. ChorusCore.APIManagement and ChorusCore.DBOperation will provide HTTPAPI and MySQL basic functions support

  5. You may create Performance report by below lines:

>>from ChorusCore.PerformanceManagement import Performance_Result
>>Performance_Result.add(name, status, detail, time_taken)

If there Performance_Result.data is not empty, then it will generate Performance.html in the Output folder

8.. You may generate your own log file by below lines:

>>from ChorusCore.ProjectConfiguration import ProjectConfiguration
>>from ChorusCore.LogServer import Level
>>proj = ProjectConfiguration()
>>proj.set_logserver(level=Level.debug)
>>proj.logserver.add_filehandler(level=Level.error, filepath = <filepath>, filename = "error.log")

About

A test framework for mobile, web and server integration test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published