Selenium Tests using GitHub action

rahulbhave

rahulbhave

Posted on December 6, 2021

Selenium Tests using GitHub action

My Workflow

This flow is created, to setup github action for running selenium Tests using headless chrome browser.

GitHub action steps:

I. Install dependencies-

name: Run Python Test
on:
  push:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Python 3
        uses: actions/setup-python@v1
        with:
          python-version: 3.8
      - name: Install dependencies
        run: |
          set -ex
          wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
          sudo apt install ./google-chrome-stable_current_amd64.deb
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install msedge-selenium-tools
Enter fullscreen mode Exit fullscreen mode

II. Run Tests

# Execute Test
      - name: Run test 
        run: python -m pytest tests/test_form.py 
Enter fullscreen mode Exit fullscreen mode

Submission Category:

DIY Deployments

Yaml File:

name: Run Python Test
on:
  push:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Python 3
        uses: actions/setup-python@v1
        with:
          python-version: 3.8
      - name: Install dependencies
        run: |
          set -ex
          wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
          sudo apt install ./google-chrome-stable_current_amd64.deb
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install msedge-selenium-tools
      # Execute Test
      - name: Run test
        run: python -m pytest tests/test_form.py

Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
rahulbhave
rahulbhave

Posted on December 6, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Selenium Tests using GitHub action
actionshackathon21 Selenium Tests using GitHub action

December 6, 2021