项目作者: abhidp

项目描述 :
WEB and API automation Tests
高级语言: JavaScript
项目地址: git://github.com/abhidp/aws-sdk-ec2-api-test.git
创建时间: 2018-08-27T06:12:26Z
项目社区:https://github.com/abhidp/aws-sdk-ec2-api-test

开源协议:

下载


aws-sdk-ec2-api-test

This repo contains tests written in JavaScript ES6 with Mocha BDD framework

API Tests

located under : test/api/specs

API tests calls Methods from AWS SDK for NodeJs
using Mocha executor and Chai assertions

Test Scenario:

  1. Step 1 - Request an EC2 Instance and Validate its Up and Running
  2. Step 2 - Request Teardown of the EC2 Instance and Validate its Terminated

A Live GIF recording of the above can be seen here

Pre-Reqs:

  • To run this you must have a Access Key ID and Secret Access Key
    Add those keys/values to the .env file(explained later). Also your userRole should have AmazonEC2FullAccess permission

  • Add ImageId, Region, API Version and Instance Type: Please use Free Tier Assets to avoid surprises in you next Credit-Card bill

What the Test does:
EC2_CRUD_Test Like UI tests, this API tests takes help of helper/action functions to test the above scenario

  • Checks everytime if a Key Pair exists, if exists then use it for EC2 creation, if doesn’t then create one on the fly and use it
  • Send request for EC2 Instance creation and wait until status of the instance is running. Validate this status with help of Chai assertions
  • Send request for EC2 Instance termination and wait until status is terminated. Validate this status with help of Chai assertions

Note: The above test is not set up to run in CI as I have a public CircleCI account and don’t wanna risk exposing my AWS access key-id credential to the www

Getting Started

Pre-Req

Java Development Kit 1.8 or higher

Running Tests Locally

  • [ ] Clone this repo : git clone https://github.com/abhimassive/dr-litmos-test.git

  • [ ] Install dependencies : npm install

  • [ ] Create a .env file in you root directory. Paste contents from .env-sample to .env and populate the values for each key

  • [ ] API - Run EC2 Test : npm run api

TODO:

API
  • Store AWS security credentials in S3 Bucket
  • Add pre-step in CircleCI to pull secrets from S3 before running AWS API tests

@Author Abhi