Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/asl/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License.
UI Testing is one of the important part of SDLC. This repo contains sample website which can be hosted as S3 website. AWS CodeBuild has been used to perform the Automated UI testing using Selenium Webdriver on Firefox and Chrome. AWS CodeBuild also have been used to trigger asyncronous headless UI testing on PhantomJS using AWS Lambda. AWS CodePipeline have been used to orchestrate the Continuous Delivery pipeline with multiple stages such as Source, UI Testing, Approval & Production Deployment. This repo contains the CloudFormtaion template which will create the CodePipeline and the corresponding resources (AWS CodeCommit repository needs to be created manually and files should be commited).
Details about using this repo is detailed in the blog post.
Let's start by creating the repository and enabling Continuous Delivery pipeline for automated UI testing.
Create a CodeCommit repository as mentioned below.
aws codecommit create-repository --repository-name automated-ui-testing --repository-description "Repository for Automated UI Testing and Continuous Delivery using CodePipeline."
Once the CodeCommit repository has been created, clone this GitHub repository and upload the content to automated-ui-testing
.
There is a JSON (CloudFormation Configuration) file in the repo.
automated-ui-testing-params.json: - CloudFormation parameter configuration file for Continuous Delivery Pipeline.
Update the configuration file with appropriate values for SourceRepo, ApprovalTopic, ProductionBucket based on the requirement.
Once the configuration file has been updated, execute the following command to create the CloudFormation stack which will create the required CodePipeline.
aws cloudformation create-stack --stack-name automated-ui-testing --template-body file://automated-ui-testing.yml --parameters file://automated-ui-testing-params.json --capabilities CAPABILITY_NAMED_IAM
Once the CloudFormation successfully creates the stack, it would have created a CodePipeline with similar stages as shown below.
Note: While deleting, the CloudFormation will retain the S3 buckets it has created. If not needed, the buckets created by CloudFormation will contian the stack name as part of bucket name, identify those buckets and delete them.