Git Product home page Git Product logo

pi-tester's Introduction

Installation

$ pip install pitester
$ python setup.py install

Usage

$ pitester -h

# run a testsuite with a csv file
$ pitester -s testsuite.csv

# run a specific test case
$ pitester -c Dummy_0101

Create a Test Suite

Test suite written with csv format. The column name of the first row is fixed, please refer the sample as below. TestCase ID and Run are required.

Prefix,TestCase ID,Title,Type,Run,Result,Log,Duration Time
,Dummy_0101,,,0,,,
,Dummy_0102,,,1,,,
,Dummy_0103,,,1,,,
,Dummy_0104,,,1,,,
,Dummy_0105,,,1,,,
,Dummy_0106,,,1,,,
,Dummy_0107,,,1,,,
,Dummy_0108,,,1,,,
,Dummy_0109,,,,,,
,Dummy_0110,,,,,,

Naming convention of TestCase ID

The naming of the TestCase ID follows this rule: <TestSuiteName>_<ID Number>. Actually TestCase ID is like index, pi-tester will try to find the test script from the name then execute the case.

  • The TestSuiteName is the same as the name of test script.
  • ID Number is arbitrary.
  • The TestCase ID is a class name in the test script.

Run

  • 1: excute it.
  • 0: not excute it.

Create Test Cases

1. Create a directory for test cases

The name(Dummy) of the directory must the same as the name of test script(Dummy.py)

$ mkdir Dummy
$ cd Dummy
$ touch Dummy.py

2. Write down the test script in the .py file.

  • The class name is same as TestCase ID
  • The method run must be implemented.
  • Return value of run
    • first value: True means Pass, Flase means Fail
    • second value: log meesage.
class Dummy_0101:
    '''
    write doc here
    '''
    def __init__(self):
        pass

    def run(self):
        return True, 'call dummy api success'

pi-tester's People

Contributors

dkentw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.