Browse Source

travis run dusk

jqh 5 years ago
parent
commit
5d4b9aafb3
4 changed files with 36 additions and 19 deletions
  1. 2 1
      .travis.yml
  2. 30 0
      phpunit.dusk.xml
  3. 0 18
      phpunit.xml.dist
  4. 4 0
      src/Console/Development/LinkCommand.php

+ 2 - 1
.travis.yml

@@ -32,6 +32,7 @@ install:
   - cp -rf ./composer.json ./laravel-tests/dcat-admin
   - rm -rf ./laravel-tests/tests
   - cp -rf ./tests ./laravel-tests/tests
+  - cp -f ./phpunit.dusk.xml ./laravel-tests
   - cd ./laravel-tests
   - php artisan admin:composer-config
   - travis_retry composer require dcat/laravel-admin:*@dev
@@ -43,7 +44,7 @@ install:
 
 before_script:
   - chmod 777 ./vendor/laravel/dusk/bin/chromedriver-linux
-  - ./vendor/laravel/dusk/bin/chromedriver-linux --headless --disable-gpu &
+  - ./vendor/laravel/dusk/bin/chromedriver-linux --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
   - php artisan serve &
 
 script:

+ 30 - 0
phpunit.dusk.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="vendor/autoload.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false">
+    <testsuites>
+        <testsuite name="Browser Test Suite">
+            <directory suffix="Test.php">./tests/Browser</directory>
+        </testsuite>
+
+        <testsuite name="Unit">
+            <directory suffix="Test.php">./tests/Unit</directory>
+        </testsuite>
+
+        <testsuite name="Feature">
+            <directory suffix="Test.php">./tests/Feature</directory>
+        </testsuite>
+
+    </testsuites>
+    <filter>
+        <whitelist processUncoveredFilesFromWhitelist="true">
+            <directory suffix=".php">./app</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 0 - 18
phpunit.xml.dist

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="false"
-         backupStaticAttributes="false"
-         bootstrap="vendor/autoload.php"
-         colors="true"
-         convertErrorsToExceptions="true"
-         convertNoticesToExceptions="true"
-         convertWarningsToExceptions="true"
-         processIsolation="false"
-         stopOnFailure="true"
-         verbose="true"
->
-    <testsuites>
-        <testsuite name="all">
-            <directory>tests/</directory>
-        </testsuite>
-    </testsuites>
-</phpunit>

+ 4 - 0
src/Console/Development/LinkCommand.php

@@ -35,6 +35,10 @@ class LinkCommand extends Command
      */
     protected function linkTests($files)
     {
+        if (! is_file(base_path('phpunit.dusk.xml'))) {
+            $files->copy(realpath(__DIR__.'/../../../phpunit.dusk.xml'), base_path('phpunit.dusk.xml'));
+        }
+
         $target = base_path('tests');
         $testsPath = realpath(__DIR__.'/../../../tests');