Git Product home page Git Product logo

robot-youtube-sample's Introduction

Robot Youtube Sample

nishantrevo Sample project to run UI tests on youtube using:

  • Python3
  • Robot Framework
  • Selenium
  • Selenium Grid
  • CircleCI

Project structure

  • tests : Directory of test robot files.
  • lib : Directory of library of robot keywords and python files.
  • lib/pages : Directory of robot files for each page/component keywords.
  • resources : Directory of scripts and variable file.
  • requirements.txt : Dependecies list for pip.
  • .python-version : Python version for pyenv.

Pre-requisites

  • Python 3 - 3.9.0 and using pyenv is recommended. See docs to get started. Pyenv command
  • Browser installations for local execution

Setup

Create virutal environment

  • Install python 3.9.0 if pyenv is installed and configured correctly
pyenv install 3.9.0
  • cd to project directory
cd /path/to/robot-youtube-sample
  • Check pyenv switched to correct python version. Output should match to same version.
pyenv local
python -V
  • Create virtual environment
python -m venv venv
source venv/bin/activate

Install dependecies using pyenv and pip

  • Install dependecies
pip install -r requirements.txt

Install drivers for local execution

This project uses webdrivermanager for drivers dependecies

  • Install chromedriver
webdrivermanager chrome
  • Install geckodriver
webdrivermanager geckodriver

Start local Selenium grid

Pre-requisite

  • Docker installed and running

Change permission of script

chmod +rwx ./resources/grid.sh

Start grid

./resources/grid.sh up

Close grid

./resources/grid.sh down

Run Tests

  • Run test locally
robot --outputdir reports --variablefile resources/variables.yaml test/
  • Run test in local grid
robot --outputdir reports --variable grid_url:http://localhost:4444/wd/hub --variablefile resources/variables.yaml tests
  • Run test with different variables file Create a new yaml variable file
robot --outputdir reports --variablefile path/to/new.yaml tests/
  • Override variable in variables file
robot --outputdir reports --variable searchKeyword:"dua lipa break my heart" --variablefile var.yaml test

Reports

Following reports are generated:

  • reports/log.html : HTML log of test execution.
  • reports/report.html : HTML summary test result.
  • reports/output.xml : Robot default XML report.

robot-youtube-sample's People

Contributors

nishantrevo avatar

Watchers

 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.