Skip to content

Commit b1f3c59

Browse files
authored
Merge pull request #385 from aik099/file-upload-test-selenium3-fix
Fixes file upload test on Selenium 3
2 parents 897e7d7 + d6fb204 commit b1f3c59

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ jobs:
7171
7272
- name: Start Selenium
7373
run: |
74-
docker run --net host --name selenium --volume /dev/shm:/dev/shm --shm-size 2g selenium/standalone-firefox:2.53.1 &> ./logs/selenium.log &
74+
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 &
7575
7676
- name: Wait for browser & PHP to start
7777
run: |
7878
while ! nc -z localhost 4444 </dev/null; do echo Waiting for remote driver to start...; sleep 1; done
7979
while ! nc -z localhost 8002 </dev/null; do echo Waiting for PHP server to start...; sleep 1; done
8080
8181
- name: Run tests
82+
env:
83+
DRIVER_MACHINE_BASE_PATH: /fixtures/
8284
run: |
8385
vendor/bin/phpunit -v --coverage-clover=coverage.xml
8486
@@ -91,6 +93,6 @@ jobs:
9193
if: ${{ failure() }}
9294
uses: actions/upload-artifact@v2
9395
with:
94-
name: logs_php-${{ matrix.php }}
96+
name: logs_php-${{ matrix.php }}_selenium-2.53.1_firefox
9597
path: |
9698
logs

tests/Selenium2Config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ public function createDriver(): DriverInterface
2323
return new Selenium2Driver($browser, null, $seleniumHost);
2424
}
2525

26+
public function mapRemoteFilePath($file): string
27+
{
28+
if (!isset($_SERVER['TEST_MACHINE_BASE_PATH'])) {
29+
$webFixturesPath = dirname(__DIR__) . '/vendor/mink/driver-testsuite/web-fixtures';
30+
$_SERVER['TEST_MACHINE_BASE_PATH'] = realpath($webFixturesPath) . DIRECTORY_SEPARATOR;
31+
}
32+
33+
return parent::mapRemoteFilePath($file);
34+
}
35+
2636
public function skipMessage($testCase, $test): ?string
2737
{
2838
if (

0 commit comments

Comments
 (0)