Skip to content

Sample Robot Framework against SauceDemo web app using Robot Framework and Browser library powered by Playwright

Notifications You must be signed in to change notification settings

hoangthach252/RobotFrameworkDemo

Repository files navigation

Robot Framework Demo

This is sample Robot Framework project, I have developed 2 test cases against SauceDemo web app.

This project is developed to demontrate Web UI automation using Robot Framework and Browser library powered by Playwright.

File organization

|- ROBOTFWDEMO/                              // Home folder for robotframework project
  |- configs/TestConfigs.robot               // Test env and browser configurations
  |- pages/*.robot                           // Page objects locators and keywords
  |- tests/DemoTestCase.robot                // Test cases agaist SauceDemo Web application
  |- user_data/*.json                        // Test data
|- .gitignore                                // Exclude the unnecessary files
|- README.md                                 // Overview and guideline to setup and run tests

Installation

  1. Download and Install Python.

  2. Check Python installation

    > python3 -V

  3. Install pip.

    > python get-pip.py

  4. install pipenv > pip install --user pipenv

  5. Install Dependencies such as Browser library and JSONLibrary from Pipfile.lock.

> pipenv shell 
> pipenv sync
  1. Initialize the Browser library. > rfbrowser init
  2. Download and install VSCode VSCode.
  3. Install Robot Framework Language Server extension from VSCode's Marketplace

Run/Debug Test

  1. Run/Debug using VSCODE IDE
  2. Run using commandline thachhoang@Thachs-Air RobotFwDemo % robot tests/DemoTestCase.robot

Run Tests in parallel using Pabot plugin

  1. install plugin pabot thachhoang@Thachs-Air RobotFwDemo % pip install -U robotframework-pabot
  2. run tests in parallel of test level thachhoang@Thachs-Air RobotFwDemo % pabot --testlevelsplit tests/DemoTestCase.robot
  3. run tests in parallel of suite level thachhoang@Thachs-Air RobotFwDemo % pabot tests

Run Tests using Docker

  1. create Dockerfile with these 2 commands below:
 FROM marketsquare/robotframework-browser:latest
 RUN pip3 install --no-cache-dir --user --upgrade robotframework-jsonlibrary
  1. build a custom docker image from base image marketsquare/robotframework-browser thachhoang@Thachs-Air RobotFwDemo % docker build -t marketsquare/robotframework-browser:custom .
  2. run tests in docker container thachhoang@Thachs-Air RobotFwDemo % docker run --rm -v $(pwd)/:/test --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json marketsquare/robotframework-browser:custom bash -c "robot --outputdir /test/output /test"

About

Sample Robot Framework against SauceDemo web app using Robot Framework and Browser library powered by Playwright

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published