Skip to content
An example configuration demonstrating Selenium Grid via Docker on AWS via Terraform for IaC
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources
.env.dist Now able to trigger remote Selenium invokation. Selenium Grid and SUT… Apr 27, 2019
.gitignore
CONTRIBUTING ADDED COTRIBUTING AND LICENSE Apr 28, 2019
LICENSE ADDED COTRIBUTING AND LICENSE Apr 28, 2019
README.md UPDATED README.md and shell ./resource/* scripts. Done. Apr 28, 2019
data.tf
defaults.tf
outputs.tf Now able to trigger remote Selenium invokation. Selenium Grid and SUT… Apr 27, 2019
providers.tf
resources.tf Now able to trigger remote Selenium invokation. Selenium Grid and SUT… Apr 27, 2019
variables.tf Selenium Grid host start up completed. Apr 27, 2019

README.md

DAST

(Docker + AWS + Selenium (Grid) + Terrform)

About

An example configuration demonstrating Selenium Grid via Docker on AWS via Terraform for IaC.

Usage

Install

git clone https://github.com/davidjeddy/docker_aws_selenium_terraform.git
cd ./docker_aws_selenium_terraform
cp .env.dist .env
vim .env
terraform init

Execution

# build Terraform plan file
terraform plan --out ./out.plan -var-file=.env

# apply Terraform plan file
terraform apply -lock=true ./out.plan

# copy setup script for Selenium to remote host
scp -i ~/.ssh/$(terraform output "SSH pem key").pem -oStrictHostKeyChecking=no ./resources/selenium.sh ubuntu@$(terraform output "Selenium Grid Public DNS"):/home/ubuntu/selenium.sh

# ...  and execute
ssh -i ~/.ssh/$(terraform output "SSH pem key").pem -oStrictHostKeyChecking=no ubuntu@$(terraform output "Selenium Grid Public DNS") "chmod +x /home/ubuntu/selenium.sh && sudo /home/ubuntu/selenium.sh"

# copy setup script for Web App to remote host
scp -i ~/.ssh/$(terraform output "SSH pem key").pem -oStrictHostKeyChecking=no ./resources/web_app.sh ubuntu@$(terraform output "Web App Public DNS"):/home/ubuntu/web_app.sh

# ...  and execute
ssh -i ~/.ssh/$(terraform output "SSH pem key").pem -oStrictHostKeyChecking=no ubuntu@$(terraform output "Web App Public DNS") "chmod +x /home/ubuntu/web_app.sh && cd /home/ubuntu/ && sudo ./web_app.sh"

# Run Selenium tests from Web App host to Selenium Grid host
ssh -i ~/.ssh/$(terraform output "SSH pem key").pem -oStrictHostKeyChecking=no ubuntu@$(terraform output "Web App Public DNS") "cd /home/ubuntu/spring-petclinic && sudo mvn test -Dtest=SeleniumExampleTest -DSG_FQDN=\"$(terraform output "Selenium Grid Public DNS")\" -DWEB_APP_FQDN=\"$(terraform output "Web App Public DNS")\""

Remove

terraform destroy -auto-approve -var-file=.env

Prereq

You can’t perform that action at this time.