Skip to content

Commit

Permalink
Merge pull request #385 from aik099/file-upload-test-selenium3-fix
Browse files Browse the repository at this point in the history
Fixes file upload test on Selenium 3
  • Loading branch information
aik099 authored Oct 31, 2024
2 parents 897e7d7 + d6fb204 commit b1f3c59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ jobs:
- name: Start Selenium
run: |
docker run --net host --name selenium --volume /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
docker run --net host --name selenium --volume /dev/shm:/dev/shm --volume ./vendor/mink/driver-testsuite/web-fixtures:/fixtures --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
- name: Wait for browser & PHP to start
run: |
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
- name: Run tests
env:
DRIVER_MACHINE_BASE_PATH: /fixtures/
run: |
vendor/bin/phpunit -v --coverage-clover=coverage.xml
Expand All @@ -91,6 +93,6 @@ jobs:
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: logs_php-${{ matrix.php }}
name: logs_php-${{ matrix.php }}_selenium-2.53.1_firefox
path: |
logs
10 changes: 10 additions & 0 deletions tests/Selenium2Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ public function createDriver(): DriverInterface
return new Selenium2Driver($browser, null, $seleniumHost);
}

public function mapRemoteFilePath($file): string
{
if (!isset($_SERVER['TEST_MACHINE_BASE_PATH'])) {
$webFixturesPath = dirname(__DIR__) . '/vendor/mink/driver-testsuite/web-fixtures';
$_SERVER['TEST_MACHINE_BASE_PATH'] = realpath($webFixturesPath) . DIRECTORY_SEPARATOR;
}

return parent::mapRemoteFilePath($file);
}

public function skipMessage($testCase, $test): ?string
{
if (
Expand Down

0 comments on commit b1f3c59

Please sign in to comment.