diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..994c4f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Robot Framework output +output/ +log.html +report.html + +# Python +__pycache__/ +*.py[cod] +.venv/ +venv/ + +# VS Code +.vscode/ + +# OS +.DS_Store + +# Test artefacts +screenshots/ +videos/ +results/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..6711f57 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Introduction +This repository contains instructions and scripts for creating and using a Robot Framework environment with the Browser Library. + +# Getting Started + +## Visual Studio Code Setup +Follow these steps: +1. Run the `create_robot_venv.sh` script in the VS Code terminal. +2. Install the RobotCode extension. +3. Select the Python interpreter from the .venv directory. + +# Build and Test +Using RobotCode Extension: +Use **Run Test** from the RobotCode extension. + +Using Terminal: +`robot -d results tests/` \ No newline at end of file diff --git a/create_robot_venv.sh b/create_robot_venv.sh new file mode 100755 index 0000000..1b90622 --- /dev/null +++ b/create_robot_venv.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -e + +# 1. Navigate to your project root +# cd /path/to/your/project + +# 2. Create a virtual environment named .venv +python3 -m venv .venv + +# 3. Activate the virtual environment +source .venv/bin/activate + +# 4. Upgrade pip +pip install --upgrade pip + +# 5. Install Robot Framework and Browser library +pip install robotframework +pip install robotframework-browser + +# 6. Initialize Browser library (downloads Playwright browsers) +rfbrowser init + +# 7. (Optional) Install extra libraries +# pip install robotframework-seleniumlibrary robotframework-requests + +# 8. Freeze dependencies +pip freeze > requirements.txt + +echo "✅ Setup complete! Activate with: source .venv/bin/activate" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a17abc3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,16 @@ +click==8.3.1 +grpcio==1.76.0 +grpcio-tools==1.76.0 +natsort==8.4.0 +overrides==7.7.0 +protobuf==6.33.2 +psutil==7.2.1 +PyYAML==6.0.3 +robotframework==7.4.1 +robotframework-assertion-engine==3.0.3 +robotframework-browser==19.12.3 +robotframework-pythonlibcore==4.4.1 +seedir==0.5.1 +setuptools==80.9.0 +typing_extensions==4.15.0 +wrapt==2.0.1 diff --git a/tests/sanity/environment_sanity.robot b/tests/sanity/environment_sanity.robot new file mode 100644 index 0000000..94afad6 --- /dev/null +++ b/tests/sanity/environment_sanity.robot @@ -0,0 +1,12 @@ +*** Settings *** +Library Browser + +*** Test Cases *** +Hello World Test + Log Hello, Robot Framework! + +Open Example Page + New Browser chromium + New Page https://example.com + Get Title == Example Domain + Close Browser