diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..cd17d58 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,44 @@ +name: Browser E2E + +on: + pull_request: + branches: [master] + +jobs: + playwright: + name: Playwright Chromium + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + extensions: mbstring, xml, curl, intl, json, sockets, sqlite3 + coverage: none + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: Enable pnpm + run: corepack enable + + - name: Install JavaScript dependencies + run: pnpm install --frozen-lockfile + + - name: Install Chromium + run: pnpm exec playwright install --with-deps chromium + + - name: Run browser tests + run: pnpm e2e + + - name: Upload Playwright report + if: failure() && !cancelled() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 14 diff --git a/.gitignore b/.gitignore index 538debb..65c4a5d 100644 --- a/.gitignore +++ b/.gitignore @@ -60,13 +60,15 @@ writable/session/* writable/uploads/* !writable/uploads/index.html -writable/debugbar/* -!writable/debugbar/.gitkeep - -writable/database/* -!writable/database/.gitkeep - -php_errors.log +writable/debugbar/* +!writable/debugbar/.gitkeep + +writable/database/* +!writable/database/.gitkeep + +writable/websocket_tokens.json + +php_errors.log # Legacy CI3 paths application/config/database.php @@ -146,8 +148,10 @@ _/ .claude CLAUDE.md -/results/ -/phpunit*.xml +/results/ +/phpunit*.xml +/playwright-report/ +/test-results/ #------------------------- # Static Analysis Cache diff --git a/app/Commands/ChatWebSocketServer.php b/app/Commands/ChatWebSocketServer.php index f2b6887..f620ed7 100644 --- a/app/Commands/ChatWebSocketServer.php +++ b/app/Commands/ChatWebSocketServer.php @@ -23,42 +23,42 @@ class ChatWebSocketServer extends BaseCommand * * @var string */ - protected string $group = 'Chat'; + protected $group = 'Chat'; /** * The Command's Name * * @var string */ - protected string $name = 'chat:websocket'; + protected $name = 'chat:websocket'; /** * The Command's Description * * @var string */ - protected string $description = 'Starts the WebSocket server for the chat application'; + protected $description = 'Starts the WebSocket server for the chat application'; /** * The Command's Usage * * @var string */ - protected string $usage = 'chat:websocket [options]'; + protected $usage = 'chat:websocket [options]'; /** * The Command's Arguments * * @var array */ - protected array $arguments = []; + protected $arguments = []; /** * The Command's Options * * @var array */ - protected array $options = [ + protected $options = [ '--port' => 'Port to run the WebSocket server on (default: 8080)', ]; diff --git a/app/Views/chat/chatView.php b/app/Views/chat/chatView.php index c002041..00d6f22 100644 --- a/app/Views/chat/chatView.php +++ b/app/Views/chat/chatView.php @@ -1,5 +1,5 @@ - +
Loading...