Git Product home page Git Product logo

yudongya / auto-create-test-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mmkxyu/auto-create-test-data

0.0 0.0 0.0 268 KB

该工具作用是快速造数据,按照你想要的规则将造好的测试数据存入csv,方便postman,jmeter等工具做接口自动化 我们知道当我们做接口自动化的时候,制作入参的csv表格手动填写很麻烦,特别是当项目某个字段的规则变了以后,那么所有涉及到这个字段的正常和异常用例数据可能都需要改变,维护的工作量比较大 该工具就是帮助你用代码的方式去造csv数据,一旦接口的字段规则变了,只需要变动生成数据的代码规则即可

Java 100.00%

auto-create-test-data's Introduction

autotest

说明

该工程作用是快速造数据,按照你想要的规则将造好的测试数据存入csv,方便postman,jmeter等工具做接口自动化
我们知道当我们做接口自动化的时候,制作入参的csv表格手动填写很麻烦,特别是当项目某个字段的规则变了以后,那么所有涉及到这个字段的正常和异常用例数据可能都需要改变,维护的工作量比较大 该工具就是帮助你用代码的方式去造csv数据,一旦接口的字段规则变了,只需要变动生成数据的代码规则即可

制作完成的表格效果如图

自动化造csv测试数据

工程中各类作用

该工程直接运行ExecutionMain类即可

  • DataEntity:数据实体类,即测试用例表头的各字段

  • CsvWriterExtend:java写csv文件类,是基于CsvWriter工具包的基础上,优化了一些功能:
    1:解决CsvWriter写入csv文件,打开后中文乱码问题
    2:解决CsvWriter写入csv文件,末尾行总会多出一个/r或/n即空格行问题
    3:解决CsvWriter写入csv文件,空字符串""(不处于第一列时)不被写入显示null的问题

  • CreateDataModel:创建数据类,即创建符合规则的测试用例数据,并写入csv文件中

  • ExecutionMain:执行类,执行该类即可生成一个csv文件

备注

此处给出postman通过使用该csv文件进行测试的结果 postman使用自动化造的csv文件进行接口自动化

auto-create-test-data's People

Contributors

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