Github Actions, Selenium, Python and Firefox

Heyy!
I have a doubt, right now I’m working with a pipeline that runs Selenium through a python file but I’m getting this error (image). I’m not very experienced so any tips about CI/CD will be helpful!

And this is my workflow.yml:

name: Build and Test

on: ["push", "pull_request"]

jobs:
  build:
    runs-on: ubuntu-latest
    
    strategy:
      matrix: 
        node-version: ["12.16.3"]
        os: ["ubuntu-latest"]
        
    steps:
    
      - name: Step 1 - Log the pre-build disc space
        run: df
    
      - name: Step 2 - Checkout 
        uses: actions/checkout@v2
        
 #     - name: Nodejs ${{ matrix.node-version }}
 #       uses: actions/setup-node@v2
 #       with:
 #        node-version: ${{ matrix.node-version }}
 #         check-latest: true
          
      - name: Step 3 - Workdir
        run: |
         pwd     
         ls -la
         rm package-lock.json
        # rm .yarnrc
        # rm -rf .yarn
         
        
      - name: Step 4 - Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
          
      - name: Step 5 - Node Version
        run: node -v
        
      - name: Step 6 - GitHub Action for Yarn
        run: npm install yarn -g
        
      - name: Step 7 - Yarn Set Version 1.22.4
        run: yarn set version 1.22.4
        
      - name: Step 8 - Yarn Version
        run: yarn -v
      
      - name: Step 9 - Update 
        run: sudo apt-get update
        
      - name: Step 10 - Install MongoDB
        run: sudo apt-get install -y mongodb-org
        
      - name: Step 11 - Install Postgres
        uses: harmon758/postgresql-action@v1
        with:
           postgresql version: '11'
        
      # Use preinstalled PostgreSQL 
      - name: Step 12 - Start PostgreSQL on Ubuntu
        run: |
          sudo systemctl start postgresql
          sudo systemctl enable postgresql
      - name: Step 13 - PostgresSQL Client 
        run: |
         sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres';"
         sudo -u postgres psql -c "ALTER USER postgres WITH SUPERUSER;"
         sudo -u postgres psql -c "CREATE DATABASE apidev;"
         sudo -u postgres psql -c "GRANT ALL privileges on database apidev to postgres;"
         
    #  - name: Install Redis
    #    run: |
    #     sudo apt-get install epel-release
    #     sudo apt-get install redis
    #     sudo systemctl start redis
    #     sudo systemctl enable redis
    #     redis-cli ping

      - name: Step 14 - Yarn Install
        run: yarn -y
        
      - name: Step 15 - Install pm2
        run: npm install pm2 -g
        
     # - name: Upload a Build Artifact
     #   uses: actions/upload-artifact@main
     #   with:
     #     name: webpack artifacts
     #     # A file, directory or wildcard pattern that describes what to upload
     #     path: /home/runner/work/test3OS/test3OS/
          
 # test:
 #   needs: build
 #   runs-on: ubuntu-latest
    
 #   steps:
 #   - name: Checkout 
 #     uses: actions/checkout@v2
      
 #   - name: Download a Build Artifact
 #     uses: actions/download-artifact@main
 #     with: 
 #       name: webpack artifacts
 #       path: /home/runner/work/test3OS/test3OS
        
      - name: Step 16 - Run Frontend
        run: |
            yarn s &
        env:
           CI: true
           
      - name: Step 17 - Check connection
        run: lsof -i:8003
        
      - name: PIP Version
        run: pip -V 
        
      - name: Prepare Firefox
        uses: browser-actions/setup-firefox@latest
      
      - name: Firefox version
        run: firefox --version
        
      - name: Install Selenium
        run: pip install selenium
        
      - name: Install Geckodriver
        run: yarn add geckodriver 
        
      - name: Run headless test
        uses: GabrielBB/xvfb-action@v1
        with:
          run: python e2e/test.py
    
      - name: Step 17 - Log the post-build disc space 
        run: df
        
      - name: Step 18 - List Ubuntu Enviroment Variables
        run: env
        
     # - name: Step 19 - Report Status Slack
     #   if: always()
     #   uses: ravsamhq/notify-slack-action@master
     #   with:
     #     status: ${{ job.status }}
     #     notify_when: 'failure'
     #   env:
     #     SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
        

The stack trace in your screenshot looks like the test is trying to navigate to http://[::]:8003/. That can’t work: :: is the IPv6 wildcard address, used primarily when you want to bind a server port on all available addresses. If you want to reach localhost (which might make sense here), you need ::1.

Try to figure out where the test script gets the wrong IP address, and go from there. :slightly_smiling_face:

I use “http://localhost:8003/” and it works! Ty :grin: