Merge pull request #131 from Cars-n/dev #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Selenium Test Suite | |
on: | |
push: | |
branches: [ "main","dev","Selenium","selenium-test-room-change","selenium-behavioral-tests"] | |
pull_request: | |
branches: [ "main","dev" ] | |
jobs: | |
Test-Selenium: | |
runs-on: ubuntu-latest | |
steps: | |
#Set up environment | |
- name: Checking out repo | |
uses: actions/checkout@v3 | |
- name: Setting up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Installing package list #Not sure what this | |
run: apt list --installed | |
#Chrome dependencies | |
- name: Update | |
run: sudo apt update -y | |
- name: Install Chrome Shared Libraries | |
run: | | |
sudo apt-get update && sudo apt-get install -y \ | |
ca-certificates \ | |
fonts-liberation \ | |
libasound2 \ | |
libatk-bridge2.0-0 \ | |
libatk1.0-0 \ | |
libc6 \ | |
libcairo2 \ | |
libcups2 \ | |
libdbus-1-3 \ | |
libexpat1 \ | |
libfontconfig1 \ | |
libgbm1 \ | |
libgcc1 \ | |
libglib2.0-0 \ | |
libgtk-3-0 \ | |
libnspr4 \ | |
libnss3 \ | |
libpango-1.0-0 \ | |
libpangocairo-1.0-0 \ | |
libstdc++6 \ | |
libx11-6 \ | |
libx11-xcb1 \ | |
libxcb1 \ | |
libxcomposite1 \ | |
libxcursor1 \ | |
libxdamage1 \ | |
libxext6 \ | |
libxfixes3 \ | |
libxi6 \ | |
libxrandr2 \ | |
libxrender1 \ | |
libxss1 \ | |
libxtst6 \ | |
lsb-release \ | |
wget \ | |
xdg-utils | |
- name: Removing previous chrome instances on runner #This probably isnt necessary to have | |
run: sudo apt purge google-chrome-stable | |
continue-on-error: true | |
# Actually installing chrome | |
- name: Install Chrome | |
run: | | |
sudo wget https://dl-ssl.google.com/linux/linux_signing_key.pub -O /tmp/google.pub | |
sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/google-chrome.gpg --import /tmp/google.pub | |
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list | |
sudo apt-get update -y | |
sudo apt-get install google-chrome-stable -y | |
sudo apt-get install -y chromium-browser chromium-chromedriver -y | |
sudo apt-get update -y | |
# Need to fetch reqs if needed | |
- name: Installing all necessary packages | |
run: pip install -r tests/selenium/requirements.txt | |
- name : Start Python's HTTP Server | |
run: | | |
echo "$ python3 -m http.server" | |
python3 -m http.server --bind 127.0.0.1 & | |
- name: Running behavioral tests | |
run: behave tests/selenium/behavioral/menu.feature | |
# Run tests | |
- name: Running the Python script | |
run: python3 tests/selenium/seleniumTests.py | |