Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes file upload test on Selenium 3 #385

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading