diff --git a/Dockerfile b/Dockerfile index 483b65292..715fedf5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,6 +69,7 @@ RUN if [ "$DEVELOPMENT_BUILD" = '1' ]; then \ apt-get install -y \ cmake \ rsync \ + libzip-dev `# needed for Laravel Dusk/Selenium` \ && \ `# Cypress dependencies` \ apt-get install -y \ @@ -89,7 +90,8 @@ RUN if [ "$DEVELOPMENT_BUILD" = '1' ]; then \ chown root /tmp/.X11-unix/ && \ mkdir -p /var/www/.cache/mesa_shader_cache && \ pecl install xdebug && \ - docker-php-ext-enable xdebug; \ + docker-php-ext-enable xdebug && \ + docker-php-ext-install zip; \ fi # Create an npm cache directory for www-data diff --git a/app/cdash/tests/CMakeLists.txt b/app/cdash/tests/CMakeLists.txt index dfc78971b..86ef44d87 100644 --- a/app/cdash/tests/CMakeLists.txt +++ b/app/cdash/tests/CMakeLists.txt @@ -222,8 +222,11 @@ set_tests_properties(/Feature/GraphQL/CoverageTypeTest PROPERTIES DEPENDS /Featu add_laravel_test(/Feature/PurgeUnusedProjectsCommand) set_tests_properties(/Feature/PurgeUnusedProjectsCommand PROPERTIES DEPENDS "/Feature/GraphQL/TestTypeTest;/Feature/GraphQL/TestMeasurementTypeTest;/Feature/GraphQL/NoteTypeTest;/Feature/GraphQL/BuildMeasurementTypeTest;/Feature/GraphQL/CoverageTypeTest") +add_laravel_test(/Browser/Pages/ProjectSitesPageTest) +set_tests_properties(/Browser/Pages/ProjectSitesPageTest PROPERTIES DEPENDS /Feature/PurgeUnusedProjectsCommand) + add_laravel_test(/Feature/MeasurementPositionMigration) -set_tests_properties(/Feature/MeasurementPositionMigration PROPERTIES DEPENDS /Feature/PurgeUnusedProjectsCommand) +set_tests_properties(/Feature/MeasurementPositionMigration PROPERTIES DEPENDS /Browser/Pages/ProjectSitesPageTest) add_laravel_test(/Feature/RemoveMeasurementCheckboxesMigration) set_tests_properties(/Feature/RemoveMeasurementCheckboxesMigration PROPERTIES DEPENDS /Feature/MeasurementPositionMigration) diff --git a/composer.json b/composer.json index 971507465..f71bd6000 100644 --- a/composer.json +++ b/composer.json @@ -50,9 +50,11 @@ "ext-dom": "*", "ext-gd": "*", "ext-xdebug": "*", + "ext-zip": "*", "fakerphp/faker": "1.23.1", "friendsofphp/php-cs-fixer": "3.64.0", "larastan/larastan": "^2.7", + "laravel/dusk": "8.2.11", "mockery/mockery": "1.6.12", "phpstan/extension-installer": "1.4.3", "phpstan/phpstan": "1.12.7", diff --git a/composer.lock b/composer.lock index 897a738b3..959b553d0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9d8e01be40b00282e6be411c5886beab", + "content-hash": "a2de0e201f0d4b75d7b071bf919e56d1", "packages": [ { "name": "24slides/laravel-saml2", @@ -9647,6 +9647,78 @@ ], "time": "2024-10-15T19:41:22+00:00" }, + { + "name": "laravel/dusk", + "version": "v8.2.11", + "source": { + "type": "git", + "url": "https://github.com/laravel/dusk.git", + "reference": "c667db6d8795f0ccc8f63d54a7780ce8a0cc3d3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/dusk/zipball/c667db6d8795f0ccc8f63d54a7780ce8a0cc3d3c", + "reference": "c667db6d8795f0ccc8f63d54a7780ce8a0cc3d3c", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-zip": "*", + "guzzlehttp/guzzle": "^7.5", + "illuminate/console": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "php": "^8.1", + "php-webdriver/webdriver": "^1.9.0", + "symfony/console": "^6.2|^7.0", + "symfony/finder": "^6.2|^7.0", + "symfony/process": "^6.2|^7.0", + "vlucas/phpdotenv": "^5.2" + }, + "require-dev": { + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.19|^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.1|^11.0", + "psy/psysh": "^0.11.12|^0.12" + }, + "suggest": { + "ext-pcntl": "Used to gracefully terminate Dusk when tests are running." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Dusk\\DuskServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Dusk\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Dusk provides simple end-to-end testing and browser automation.", + "keywords": [ + "laravel", + "testing", + "webdriver" + ], + "support": { + "issues": "https://github.com/laravel/dusk/issues", + "source": "https://github.com/laravel/dusk/tree/v8.2.11" + }, + "time": "2024-11-07T21:51:32+00:00" + }, { "name": "mockery/mockery", "version": "1.6.12", @@ -9958,6 +10030,72 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-webdriver/webdriver", + "version": "1.15.1", + "source": { + "type": "git", + "url": "https://github.com/php-webdriver/php-webdriver.git", + "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/cd52d9342c5aa738c2e75a67e47a1b6df97154e8", + "reference": "cd52d9342c5aa738c2e75a67e47a1b6df97154e8", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-zip": "*", + "php": "^7.3 || ^8.0", + "symfony/polyfill-mbstring": "^1.12", + "symfony/process": "^5.0 || ^6.0 || ^7.0" + }, + "replace": { + "facebook/webdriver": "*" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.20.0", + "ondram/ci-detector": "^4.0", + "php-coveralls/php-coveralls": "^2.4", + "php-mock/php-mock-phpunit": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpunit/phpunit": "^9.3", + "squizlabs/php_codesniffer": "^3.5", + "symfony/var-dumper": "^5.0 || ^6.0" + }, + "suggest": { + "ext-SimpleXML": "For Firefox profile creation" + }, + "type": "library", + "autoload": { + "files": [ + "lib/Exception/TimeoutException.php" + ], + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", + "homepage": "https://github.com/php-webdriver/php-webdriver", + "keywords": [ + "Chromedriver", + "geckodriver", + "php", + "selenium", + "webdriver" + ], + "support": { + "issues": "https://github.com/php-webdriver/php-webdriver/issues", + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.15.1" + }, + "time": "2023-10-20T12:21:20+00:00" + }, { "name": "phpmyadmin/sql-parser", "version": "5.10.0", @@ -12541,7 +12679,8 @@ "platform-dev": { "ext-dom": "*", "ext-gd": "*", - "ext-xdebug": "*" + "ext-xdebug": "*", + "ext-zip": "*" }, "plugin-api-version": "2.6.0" } diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 0e93821d7..0398cd3a2 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -12,6 +12,7 @@ services: - ..:/cdash_src:ro links: - ldap + - selenium # Used for testing LDAP authentication ldap: @@ -26,3 +27,19 @@ services: LDAP_USERS: ldapuser01,ldapuser02 LDAP_PASSWORDS: password1,password2 LDAP_PORT_NUMBER: 389 + + # Used for live browser testing + selenium: + image: selenium/standalone-chromium + container_name: selenium + volumes: + - /dev/shm:/dev/shm + ports: + - 4444:4444 + - 7900:7900 + environment: + # Allows developers to view running jobs via browser-based VNC at localhost:7900 + VNC_NO_PASSWORD: true + # Selenium takes a long time to detect idle+clean up, so allow a large number of sessions to exist at once if needed. + SE_NODE_OVERRIDE_MAX_SESSIONS: true + SE_NODE_MAX_SESSIONS: 500 diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5670fa208..a9ddbe21a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -32355,11 +32355,6 @@ parameters: count: 5 path: tests/Feature/GraphQL/ProjectTypeTest.php - - - message: "#^Binary operation \"\\.\" between mixed and '_' results in an error\\.$#" - count: 1 - path: tests/Feature/GraphQL/SiteTypeTest.php - - message: "#^Cannot access offset 'edges' on mixed\\.$#" count: 3 diff --git a/resources/js/vue/components/ProjectSitesPage.vue b/resources/js/vue/components/ProjectSitesPage.vue index 3245b5206..dabab5576 100644 --- a/resources/js/vue/components/ProjectSitesPage.vue +++ b/resources/js/vue/components/ProjectSitesPage.vue @@ -1,5 +1,5 @@