@maibornwolff/alt-core-js
Simple test framework supporting execution of different `scenarios` based on `action` templates. The framework supports definition of different action types in an *yaml* format, including e.g. which endpoints have to be called with which parameters as wel
Last updated 2 months ago by johannes.loher .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @maibornwolff/alt-core-js 
SYNC missed versions from official npm registry.

Acceptance & Load Testing (ALT) Framework

GitHub Npm Version Docker Runner CircleCI

The ALT framework is designed to test logic that spans multiple services/endpoints which might use different technologies and protocols.

It does so by executing scenarios (1 scenario = 1 complete use case) which are composed of actions (e.g. 1 action could be a call to and response from a service).

The framework supports the definition of different action types in a yaml format, including e.g. which endpoints have to be called with which parameters as well as defining validation rules to be applied on the responses. It also supports detailed report creation of the test results. For more detailed documentation, check out the wiki!

Features

  • simple definition of reusable REST, MQTT, WS, etc. action templates
  • ...
  • using Variables across multiple actions
  • validation of response payload from a REST action
  • ...
  • automatic retries of REST requests
  • automatic reconnections of WS sessions
  • ...
  • filtering on incomming MQTT & WS messages
  • publishing & listening of protobuf messages on MQTT broker

Get Started

First of all, you have to define actions (see Actions) which should be invoked. Let's say we want to test creation of new users in our system. For that, we'd need two actions: one for creating new user and one for retrieving the created user and checking if the attributes were stored correctly:

src/actions/create-new-user.yaml

type: REST
service: https://reqres.in/api
endpoint: /users
method: POST
headers:
  Content-Type: application/json
data:
  name: James
  job: Agent
responseValidation:
  - "res.data.first_name === James"

src/actions/query-user.yaml

type: REST
service: https://reqres.in/api
endpoint: /users/2
method: GET
responseValidation:
  - "res.data.first_name === Janet"

In order to execute those actions we need a 'playbook' that defines which action should be executed in which order: this is exactly what a scenario (see Scenarios) is made for:

src/scenarios/s1-my-first-scenario.yaml

description: "testing User-API of the system"
actions:
  - name: create-new-user
  - name: query-user

Scenarios also allow to reuse existing actions:

src/scenarios/s2-my-custom-scenario.yaml

description: "testing if the 'job' property is being saved correctly"
actions:
  - name: create-new-user
    data:
      name: Steve
      job: Teacher
    responseValidation:
      - "res.data.job === Teacher"

Now to run our scenarios, we have basically two options: either using plain JS or via custom build Docker image:

Node

First of all we need to download the ALT's dependency:

npm i -s @maibornwolff/alt-core-js

And then simply call the runScenario main entrypoint providing the paths to our scenarios' and actions directory:

const ALT = require('@maibornwolff/alt-core-js');
ALT.runScenario('src/scenarios/s1-my-first-scenario.yaml', 'src/actions');

Docker

There is special runner image available (see Docker Hub) which already contains the core framwork and also an invokation script for running a particular scanario. You can either use it in raw or as runner image on CI platforms like e.g. GitLab.

Example: Docker CLI

docker run
  -v `pwd`/src:/src                           # mounting scenarios' & actions' root directory
  -e ALT_SRC=/src                             # declaring the mounted path as resource directory
  -v `pwd`/output:/alt-runner-app/out         # output directory where .log files and diagrams will be saved after the execution
  maibornwolff/alt-runner-image:latest
  runScenario s1-my-first-scenario.yaml       # run command with scenario-name as input param

Example: .gitlab-ci.yml

run-my-scenario:
  stage: test
  image: maibornwolff/alt-runner-image:latest
  script:
  - export ALT_SRC=$(pwd)/src                 # directory path containing ./scenarios & ./actions directories
  - runScenario s1-my-first-scenario.yaml     # execution script available inside the container: 'runScenario'
  when: manual
  ...

Environment Config

todo

Reporting

Logging

During the executing there are 2 kind of logging: basic information on which Scenario/Action is being executed is logged to the console while detailed log containing Actions' paramters, results and stack traces are logged to files which are stored under out/: each scenario logs into its own .log file!

Diagrams

The framework can automatically create sequence diagrams from the given scenario definition which are also saved in out/;

Build locally

$ npm install
$ tsc
$ npm test

...

Current Tags

  • 1.14.1                                ...           latest (2 months ago)

132 Versions

  • 1.14.1                                ...           2 months ago
  • 1.14.0                                ...           2 months ago
  • 1.13.2                                ...           2 months ago
  • 1.13.1                                ...           6 months ago
  • 1.13.0                                ...           6 months ago
  • 1.12.0                                ...           7 months ago
  • 1.11.0                                ...           7 months ago
  • 1.10.0                                ...           7 months ago
  • 1.9.2                                ...           7 months ago
  • 1.9.1                                ...           7 months ago
  • 1.9.0                                ...           7 months ago
  • 1.8.0                                ...           7 months ago
  • 1.7.2                                ...           10 months ago
  • 1.7.1                                ...           10 months ago
  • 1.7.0                                ...           10 months ago
  • 1.6.2                                ...           10 months ago
  • 1.6.1                                ...           a year ago
  • 1.6.1-bb4                                ...           a year ago
  • 1.6.1-bb3                                ...           a year ago
  • 1.6.1-bb2                                ...           a year ago
  • 1.6.1-bb1                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.6.0-bb2                                ...           a year ago
  • 1.6.0-bb1                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.3-bb10                                ...           a year ago
  • 1.5.3-bb9                                ...           a year ago
  • 1.5.3-bb8                                ...           a year ago
  • 1.5.3-bb7                                ...           a year ago
  • 1.5.3-bb6                                ...           a year ago
  • 1.5.3-bb5                                ...           a year ago
  • 1.5.3-bb4                                ...           a year ago
  • 1.5.3-bb3                                ...           a year ago
  • 1.5.3-bb2                                ...           a year ago
  • 1.5.3-bb1                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.1-bb15                                ...           a year ago
  • 1.5.1-bb14                                ...           a year ago
  • 1.5.1-bb13                                ...           a year ago
  • 1.5.1-bb12                                ...           a year ago
  • 1.5.1-bb11                                ...           a year ago
  • 1.5.1-bb10                                ...           a year ago
  • 1.5.1-bb1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.5.0-bb4                                ...           a year ago
  • 1.5.0-bb3                                ...           a year ago
  • 1.5.0-bb2                                ...           a year ago
  • 1.5.0-bb1                                ...           a year ago
  • 1.4.1-bb12                                ...           a year ago
  • 1.4.1-bb11                                ...           a year ago
  • 1.4.1-bb10                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.1-bb6                                ...           a year ago
  • 1.4.1-bb5                                ...           a year ago
  • 1.4.1-bb4                                ...           a year ago
  • 1.4.1-bb3                                ...           a year ago
  • 1.4.1-bb2                                ...           a year ago
  • 1.4.1-bb1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.4.0-bb4                                ...           a year ago
  • 1.4.0-bb3                                ...           a year ago
  • 1.4.0-bb2                                ...           a year ago
  • 1.4.0-bb1                                ...           a year ago
  • 1.3.6                                ...           a year ago
  • 1.3.4-bb6                                ...           a year ago
  • 1.3.4-bb5                                ...           a year ago
  • 1.3.4-bb4                                ...           a year ago
  • 1.3.4-bb3                                ...           a year ago
  • 1.3.4-bb2                                ...           a year ago
  • 1.3.4-bb1                                ...           a year ago
  • 1.3.4                                ...           a year ago
  • 1.3.3                                ...           a year ago
  • 1.3.2-bb17                                ...           a year ago
  • 1.3.2-bb16                                ...           a year ago
  • 1.3.2-bb15                                ...           a year ago
  • 1.3.2-bb14                                ...           a year ago
  • 1.3.2-bb13                                ...           a year ago
  • 1.3.2-bb12                                ...           a year ago
  • 1.3.2-bb11                                ...           a year ago
  • 1.3.2-bb10                                ...           a year ago
  • 1.3.2-bb9                                ...           a year ago
  • 1.3.2-bb8                                ...           a year ago
  • 1.3.2-bb7                                ...           a year ago
  • 1.3.2-bb6                                ...           a year ago
  • 1.3.2-bb5                                ...           a year ago
  • 1.3.2-bb4                                ...           a year ago
  • 1.3.2-bb3                                ...           a year ago
  • 1.3.2-bb2                                ...           a year ago
  • 1.3.2-bb1                                ...           a year ago
  • 1.3.2                                ...           a year ago
  • 1.3.1-bb10                                ...           a year ago
  • 1.3.1-bb9                                ...           a year ago
  • 1.3.1-bb8                                ...           a year ago
  • 1.3.1-bb7                                ...           a year ago
  • 1.3.1-bb6                                ...           a year ago
  • 1.3.1-bb5                                ...           a year ago
  • 1.3.1-bb4                                ...           a year ago
  • 1.3.1-bb3                                ...           a year ago
  • 1.3.1-bb2                                ...           a year ago
  • 1.3.1-bb1                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.2.23-bb2                                ...           a year ago
  • 1.2.23-bb1                                ...           a year ago
  • 1.2.23                                ...           2 years ago
  • 1.2.22                                ...           2 years ago
  • 1.2.21                                ...           2 years ago
  • 1.2.20                                ...           2 years ago
  • 1.2.19                                ...           2 years ago
  • 1.2.18                                ...           2 years ago
  • 1.2.17                                ...           2 years ago
  • 1.2.15                                ...           2 years ago
  • 1.2.14                                ...           2 years ago
  • 1.2.13-bb3                                ...           2 years ago
  • 1.2.13-bb2                                ...           2 years ago
  • 1.2.13-bb1                                ...           2 years ago
  • 1.2.13                                ...           2 years ago
  • 1.2.12                                ...           2 years ago
  • 1.2.11                                ...           2 years ago
  • 1.2.10                                ...           2 years ago
  • 1.2.10-bb                                ...           2 years ago
  • 1.2.9                                ...           2 years ago
  • 1.2.8                                ...           2 years ago
  • 1.2.7                                ...           2 years ago
  • 1.2.6                                ...           2 years ago
  • 1.2.5                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (12)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |