GithubHelp home page GithubHelp logo

easytester / testcase-automaker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amazingtest/testcase-automaker

0.0 0.0 0.0 34 KB

测试用例自动生成器

License: GNU Affero General Public License v3.0

Python 100.00%

testcase-automaker's Introduction

testcase-automaker

testcase-automaker can be used to create interface testcase with different params combo base on pairwise strategy.

Installation

pip install allpairspy
pip install testcase-automaker

Best practice

from testcase_automaker.interface.http_params_generator import http_params_generator

params_structure = {
            'name': {
                'type': 'string',
                'value': '',
                'range': ['张三', '李四'],
                'iscompulsory': True
            },
            'phone': {
                'type': 'number',
                'value': '',
                'iscompulsory': True
            },
            'claimant': {
                'type': 'object',
                'value': {
                    'name': {
                        'type': 'string',
                        'value': '',
                        'iscompulsory': True
                    },
                    'phone': {
                        'type': 'number',
                        'value': '',
                        'iscompulsory': True
                    }
                },
                'iscompulsory': True
            },
            'informations': {
                'type': 'array',
                'value': [{
                        'claimant': {
                            'type': 'object',
                            'value': {
                                'name': {
                                    'type': 'string',
                                    'value': '',
                                    'iscompulsory': True
                                },
                                'phone': {
                                    'type': 'number',
                                    'value': '',
                                    'iscompulsory': True
                                }
                            },
                            'iscompulsory': True
                        }
                    },
                    {
                        'name': {
                            'type': 'string',
                            'value': '',
                            'iscompulsory': True
                        }
                    }
                ],
                'iscompulsory': True
            }
        }

if __name__ == '__main__':
    params_generator = http_params_generator(parameters_structure=params_structure)
    params_list = params_generator.generate_params_list()
    print(params_generator.generated_params_list)

run the script then u may get output like this:

[{'name': '李四', 'phone': 15746159038, 'claimant': {'name': '华蔹绍', 'phone': 15698064521}, 'informations': [{'claimant': {'name': '齐檠', 'phone': 18912976530}}, {'name': '翟伽硝'}]}, {'name': '张三', 'phone': None, 'claimant': {'name': None, 'phone': None}, 'informations': [{'claimant': {'name': None, 'phone': None}}, {'name': '莫僖烹'}]}, {'name': '李四', 'phone': 18557203961, 'claimant': {'name': None, 'phone': 13736054179}, 'informations': [{'claimant': {'name': None, 'phone': 18810456792}}, {'name': None}]}, {'name': '李四', 'phone': None, 'claimant': {'name': '浦农', 'phone': None}, 'informations': [{'claimant': {'name': '阴桎煅', 'phone': None}}, {'name': None}]}, {'name': '张三', 'phone': None, 'claimant': {'name': None, 'phone': 18238590241}, 'informations': [{'claimant': {'name': '弓肓', 'phone': None}}, {'name': None}]}, {'name': '张三', 'phone': 18265714928, 'claimant': {'name': '昝胀噎', 'phone': None}, 'informations': [{'claimant': {'name': '应兰仓', 'phone': None}}, {'name': None}]}, {'name': '李四', 'phone': None, 'claimant': {'name': '毋羹', 'phone': None}, 'informations': [{'claimant': {'name': None, 'phone': 15701289735}}, {'name': None}]}]

Process finished with exit code 0

which is a list that contains the params combo base on pairwise and the given params structure

Contact me

For information and suggestions you can contact me at [email protected]

testcase-automaker's People

Contributors

amazingtest 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.