Giter Site home page Giter Site logo

thapaharibishnu / selenium-grid-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikoly/selenium-grid-docker

0.0 2.0 0.0 7 KB

Run UI tests: Selenium Grid, Docker Compose, Jenkins Pipeline

Python 19.54% RobotFramework 12.18% Shell 68.28%

selenium-grid-docker's Introduction

Selenium Tests in Docker

UI Selenium tests can be executed using Docker tools. What does it give?

  • Integrate user interface tests into your build pipeline.
    • Execute the tests on every version of your application that is not deployed yet.
    • Execute the tests before merging into the main branch which is going to deployed.
  • Run your tests always in the same environment. That helps to have the tests stable.

Getting Started

Asumption is that an application under test is managed by Git with Github, and Continuous Integration is managed by Jenkins with Pipeline. These tools are integrated with each other.

The tests are implemented using RobotFramework with Selenium Library.

The setup explained here are executed and tested on XOS.

Install Docker

To install Docker please refer to this link and read a little bit about it.

Dockerfile for Test Project

To make a test project (any software project actually) ready for Docker a Dockerfile needs to be added

testui/Dockerfile

The ubuntu based image built with the Dockerfile will contain a test project in a folder frontend-integration-tests and it's going to be a working directory.

To build the image execute

docker build -t robottests:1

where robottests is image name and 1 is a tag.

Dockerfile for App Project

See a README in app/ to find out how to run the app. The app is there only as an example for running the Selenium tests.

Run tests

docker-compose will be used to run the tests using the command

docker-compose run robottests robot -d reports  --variablefile variables/config.py  --variable BROWSER:chrome tests/

docker-compose uses docker-compose.yaml where images and other things are described. Amongst other things worth to mention

  1. Volume
    volumes:

      - {WORKSPACE}/reports:/frontend-integration-tests/reports

where {WORKSPACE} is a path to the directory where the reports should be stored.

When the tests are executed with the Docker, the report will be saved inside a container where they run. A volume is needed to pass the reports outside the container.

  1. Network
    networks:
        robottestsnw:
            driver: bridge

Network is needed to avoid various conflicts (e.g., ports). So called user defined network allows to run the containers in an isolated network environment.

selenium-grid-docker's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.