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.
|- 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
-
Download and Install Python.
-
Check Python installation
> python3 -V
-
Install pip.
> python get-pip.py
-
install pipenv
> pip install --user pipenv
-
Install Dependencies such as Browser library and JSONLibrary from Pipfile.lock.
> pipenv shell
> pipenv sync
- Initialize the Browser library.
> rfbrowser init
- Download and install VSCode VSCode.
- Install Robot Framework Language Server extension from VSCode's Marketplace
- Run/Debug using VSCODE IDE
- Run using commandline
thachhoang@Thachs-Air RobotFwDemo % robot tests/DemoTestCase.robot
- install plugin pabot
thachhoang@Thachs-Air RobotFwDemo % pip install -U robotframework-pabot
- run tests in parallel of test level
thachhoang@Thachs-Air RobotFwDemo % pabot --testlevelsplit tests/DemoTestCase.robot
- run tests in parallel of suite level
thachhoang@Thachs-Air RobotFwDemo % pabot tests
- create Dockerfile with these 2 commands below:
FROM marketsquare/robotframework-browser:latest
RUN pip3 install --no-cache-dir --user --upgrade robotframework-jsonlibrary
- build a custom docker image from base image marketsquare/robotframework-browser
thachhoang@Thachs-Air RobotFwDemo % docker build -t marketsquare/robotframework-browser:custom .
- 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"