Git Product home page Git Product logo

newman-orchard-parallel-tests-'s Introduction

This script was written to allow simulating concurrent requests to tenant of Orchard CMS. Note that since JavaScript is single threaded, what this script really does is fire off calls in rapid succession, without waiting for one to end before firing off the next.

To run this script

This script is supposed to be run using Node.js. Setup instructions are available online.

The script uses two modules:

The easiest way to get the script running is to install both packages locally by running from command line:

$ npm install --save newman
$ npm install --save async

After setup is complete, you can run

$ node ParallelTests.js

The execution will stop as soon as one of the calls from the projection fails. At each iteration, the script will increase the number of concurrent collections it will run.

Customizing the script

Before running the script, you should customize it for your needs.

For authenticated calls, the first thing you should do is to input a valid authentication cookie string in the corresponding variable in the code. When setting up the calls for your collection, make sure to add the following header:

cookie:.ASPXAUTH={{aspAuthCookie}};

The aspAuthCookie variable is set by the script to the hardcoded value you input.

You should verify that the collection name in the code corresponds to the name of your exported collection. The json collection file should be in the same folder that ParallelTests.js is in. The example collection uses a {{baseUrl}} parameter to point to a specific tenant. The repository contains an example collection that we used locally on an ad-hoc instance.

Example scripts

ParallelTests.js contains the basic script.

ParallelTests-ChangeTitles.js changes a Postman global variable so it is different for every collection in a given recursion step.

ParallelTests-CreateUsers.js shows how to change Postman global variables so they are different for every collection being run in a test run.

ParallelTests-Delayed.js contains a script that we used to test the minimum delay between two calls to see concurrency-related errors.

License

This software is licensed under Apache-2.0. Copyright Laser S.r.l.. See the LICENSE file for more information.

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.