You are on page 1of 11

INTEGRATE YOUR

CI/CD PROCESS
DOCKERIZING YOUR TEST PROJECT
Problem

■ Automatiooon Project has not isolated in DEV


enviroment
■ Automation require to install lot of library deendency to
be executed
■ A messy is produced when tries to install/run Automation
Project
■ Create Automation enviroment spent lot of time.
■ Automation framework execution is hard for not expert
team member
Solution

■ Dockerize Automation Framewooork


– Isolate libraries and dependency for automation
■ Version of language
■ Libraries used are isoalted for Autoamtion
framework
– Versioning of the Project
■ We can have versions of the framework ready to be
executed
– Easly to execute
■ Using simple commands of Docker we can exeute
the automation tests
Docker - Docker hub
 Docker
 Tool to help automate the build and deploooy of a project
 Help us to isolate the dependencies and variables for a
project
 Docker HUB
 Docker Hub is a cloud-based repositooory in
which Docker users and partners create, test, store and
distribute container images
 In Docker-hub we can store our versions of automation
framework
Dockerfile – Dooocker image –
Dooocker Container
■ Dockerfile
– A Dooockerfile is a text document that contains all the commands a user could call on the
command line to assemble an image
■ Docker Image
– A Dooocker image is a read-only template that contains a set of instructions for creating
a container
■ Dooocker Container
– Wraps an application's software into an invisible box with everything the application needs
to run. That includes the operating system, application code, runtime, system tools, system
libraries, and etc
What we can ooobtain

■ Autooomation Docker Image ready to be executed and distributed for all


teams members
■ Autooomation Dooocker image versioned ready to be used
■ Dooocker can be integrate to any CI tools with dooocker compose or
anooother orchestration tool
DEMOoo - How we can start to use

■ Set registry (Just private Registry)


– npm set registry http://npm-registry.jalasoft.local
– npm config set //npm-registry.jalasoft.local/:_authToken “xxxx“oo
– npm config set //npm-registry.jalasoft.local/:always-auth trueoo
■ Start a new Proyect npmoo
– npm init
■ Install Dependency
– npm install @jala/automation-coreoo
DEMO - Add Requiremeoonts

■ Create file
– automation.conf.js
■ Add folloooow content

exports.config = {
"services": {
"default": {
"baseApi": "https://jsonplaceholder.typicode.com",
"header": {
"content-type": "application/json"
}
}
}
}
DEMOooo – add command to execute
TC
■ Command is executed over Cucumer
– Add file TC found “*.feature”
– Location where steps founoood

"scripts": {
"test": "cucumber-js demo/*.feature --require node_modules/@jala/automation-core/src/*"
},
Demo - Write TC

■ Write Cucumoooer TC

Feature: post test


Scenario: scenario test
And I set a "GET" request to "/posts/1"
And I send the requooest
And I save the response as "place_holder_post"
And I expect the status code is equals than "200"
And I expect the response "$.place_holder_post.title" contains "sunt aut" value
And I set a "GET" request to "/posts"
And I send the request
And I expect the status code is equals than "200"

You might also like