I have a test project that tries to run a selenium test using phpunit. The selenium standalone runs as a service. It seems that php-webdriver is able to accesss the selenium service but I keep getting this:
Facebook\WebDriver\Exception\WebDriverException: JSON decoding of remote response failed. Error code: 4 ...some HTML code ... <p> Whoops! The URL specified routes to this help page. </p>
Here is the relevant part of my workflow file:
test: needs: build runs-on: ubuntu-latest container: image: php:7.4-apache env: TEST_BASE_URL: http://localhost SELENIUM_HOST: http://selenium:4444 services: selenium: image: selenium/standalone-chrome options: --health-cmd "curl http://selenium:4444" --health-interval=5s ports: - 4444:4444 steps: - name: Download built files uses: actions/download-artifact@v2 with: name: www-build - name: Extract artifacts run: | tar -xzf www-build.tar.gz ls -l - name: Copy files to web root run: | cp -R ./www/* /var/www/html - name: Restart apache server run: service apache2 restart - name: Check if site is accessible run: curl $TEST_BASE_URL - name: Run Test run: ./vendor/bin/phpunit test
What am I doing wrong? Is there a better way to do this?