Giter Site home page Giter Site logo

postman-jmeter-example's Introduction

postman-jmeter-example

Build Status

Automatizing a Postman test with JMeter

PostMan API 示例

JMeter GitHub Examples

postman2jmx

JMeter Bootstrap

jmeter -n -t src/wdsm.jmx -l result.jtl
pm.test("response is ok", function () {
    pm.response.to.have.status(200);
});

pm.test("response must be valid and have a body", function () {
     pm.response.to.be.ok;
     pm.response.to.be.withBody;
     pm.response.to.be.json;
});

pm.test("首页 API 应该返回正确的 top, hot, new 长度", function () {
    pm.expect(pm.response.json().top.length).to.eql(3);
    pm.expect(pm.response.json().hot.length).to.eql(3);
    pm.expect(pm.response.json().new.length).to.eql(6);
});

pm.test("首页 API 的 top 字段应该返回正确字段名", function () {
    pm.expect(Object.keys(pm.response.json().top[0])).to.eql(["id","user","user_bio","title","slug","description","updated","content","featured_image","categories","related_posts"]);
});

pm.test("首页 API 的 new 的第一个值的 ID 应该是 195", function () {
    pm.expect(pm.response.json().new[0].id).to.eql(195);
});

postman-jmeter-example's People

Contributors

phodal avatar

Watchers

 avatar James Cloos 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.