Skip to content

Commit f79c161

Browse files
Merge pull request #112 from laravel/pest-ci
Integrate PestPHP 4 Browser Tests
2 parents c9f599c + 038e80b commit f79c161

File tree

16 files changed

+123
-29
lines changed

16 files changed

+123
-29
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
CHANGELOG.md export-ignore
1010
README.md export-ignore
11+
.github/workflows/browser-test.yml export-ignore
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: browser-tests
2+
3+
on:
4+
push:
5+
branches:
6+
- pest-ci
7+
- develop
8+
- main
9+
pull_request:
10+
branches:
11+
- pest-ci
12+
- develop
13+
- main
14+
15+
jobs:
16+
ci:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.4
27+
tools: composer:v2
28+
coverage: xdebug
29+
30+
- name: Setup Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
cache: 'npm'
35+
36+
- name: Install Node Dependencies
37+
run: npm ci
38+
39+
- name: Install Playwright Dependencies
40+
run: npm install playwright@latest
41+
42+
- name: Install Playwright Browsers
43+
run: npx playwright install --with-deps
44+
45+
- name: Add `laravel-labs/starter-kit-browser-tests` Repository
46+
run: |
47+
composer config repositories.browser-tests '{"type": "vcs", "url": "https://github.com/laravel-labs/starter-kit-browser-tests"}' --file composer.json
48+
composer remove "phpunit/phpunit" --dev --no-update
49+
composer require "laravel-labs/starter-kit-browser-tests:dev-main@dev" --dev --no-update
50+
51+
- name: Add Flux Credentials Loaded From ENV
52+
run: composer config http-basic.composer.fluxui.dev "${{ secrets.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}"
53+
54+
- name: Install Dependencies
55+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
56+
57+
- name: Copy Environment File
58+
run: cp .env.example .env
59+
60+
- name: Generate Application Key
61+
run: php artisan key:generate
62+
63+
- name: Setup Test Environment
64+
run: |
65+
cp vendor/laravel-labs/starter-kit-browser-tests/phpunit.xml.dist .
66+
rm phpunit.xml
67+
rm -Rf tests/
68+
cp -rf vendor/laravel-labs/starter-kit-browser-tests/tests/ tests/
69+
70+
- name: Build Assets
71+
run: npm run build
72+
73+
- name: Tests
74+
run: php vendor/bin/pest

resources/views/components/layouts/app/header.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
7373
<flux:menu.separator />
7474

7575
<flux:menu.radio.group>
76-
<flux:menu.item :href="route('settings.profile')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
76+
<flux:menu.item :href="route('profile.edit')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
7777
</flux:menu.radio.group>
7878

7979
<flux:menu.separator />
8080

8181
<form method="POST" action="{{ route('logout') }}" class="w-full">
8282
@csrf
83-
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full">
83+
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full" data-test="logout-button">
8484
{{ __('Log Out') }}
8585
</flux:menu.item>
8686
</form>

resources/views/components/layouts/app/sidebar.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
6060
<flux:menu.separator />
6161

6262
<flux:menu.radio.group>
63-
<flux:menu.item :href="route('settings.profile')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
63+
<flux:menu.item :href="route('profile.edit')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
6464
</flux:menu.radio.group>
6565

6666
<flux:menu.separator />
6767

6868
<form method="POST" action="{{ route('logout') }}" class="w-full">
6969
@csrf
70-
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full">
70+
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full" data-test="logout-button">
7171
{{ __('Log Out') }}
7272
</flux:menu.item>
7373
</form>
@@ -110,14 +110,14 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
110110
<flux:menu.separator />
111111

112112
<flux:menu.radio.group>
113-
<flux:menu.item :href="route('settings.profile')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
113+
<flux:menu.item :href="route('profile.edit')" icon="cog" wire:navigate>{{ __('Settings') }}</flux:menu.item>
114114
</flux:menu.radio.group>
115115

116116
<flux:menu.separator />
117117

118118
<form method="POST" action="{{ route('logout') }}" class="w-full">
119119
@csrf
120-
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full">
120+
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle" class="w-full" data-test="logout-button">
121121
{{ __('Log Out') }}
122122
</flux:menu.item>
123123
</form>

resources/views/components/settings/layout.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="flex items-start max-md:flex-col">
22
<div class="me-10 w-full pb-4 md:w-[220px]">
33
<flux:navlist>
4-
<flux:navlist.item :href="route('settings.profile')" wire:navigate>{{ __('Profile') }}</flux:navlist.item>
5-
<flux:navlist.item :href="route('settings.password')" wire:navigate>{{ __('Password') }}</flux:navlist.item>
6-
<flux:navlist.item :href="route('settings.appearance')" wire:navigate>{{ __('Appearance') }}</flux:navlist.item>
4+
<flux:navlist.item :href="route('profile.edit')" wire:navigate>{{ __('Profile') }}</flux:navlist.item>
5+
<flux:navlist.item :href="route('password.edit')" wire:navigate>{{ __('Password') }}</flux:navlist.item>
6+
<flux:navlist.item :href="route('appearance.edit')" wire:navigate>{{ __('Appearance') }}</flux:navlist.item>
77
</flux:navlist>
88
</div>
99

resources/views/livewire/auth/confirm-password.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function confirmPassword(): void
5353
viewable
5454
/>
5555

56-
<flux:button variant="primary" type="submit" class="w-full">{{ __('Confirm') }}</flux:button>
56+
<flux:button variant="primary" type="submit" class="w-full" data-test="confirm-password-button">
57+
{{ __('Confirm') }}
58+
</flux:button>
5759
</form>
5860
</div>

resources/views/livewire/auth/forgot-password.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public function sendPasswordResetLink(): void
3939
placeholder="[email protected]"
4040
/>
4141

42-
<flux:button variant="primary" type="submit" class="w-full">{{ __('Email password reset link') }}</flux:button>
42+
<flux:button variant="primary" type="submit" class="w-full" data-test="email-password-reset-link-button">
43+
{{ __('Email password reset link') }}
44+
</flux:button>
4345
</form>
4446

4547
<div class="space-x-1 rtl:space-x-reverse text-center text-sm text-zinc-400">

resources/views/livewire/auth/login.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ protected function throttleKey(): string
114114
<flux:checkbox wire:model="remember" :label="__('Remember me')" />
115115

116116
<div class="flex items-center justify-end">
117-
<flux:button variant="primary" type="submit" class="w-full">{{ __('Log in') }}</flux:button>
117+
<flux:button variant="primary" type="submit" class="w-full" data-test="login-button">
118+
{{ __('Log in') }}
119+
</flux:button>
118120
</div>
119121
</form>
120122

resources/views/livewire/auth/register.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function register(): void
8686
/>
8787

8888
<div class="flex items-center justify-end">
89-
<flux:button type="submit" variant="primary" class="w-full">
89+
<flux:button type="submit" variant="primary" class="w-full" data-test="register-user-button">
9090
{{ __('Create account') }}
9191
</flux:button>
9292
</div>

resources/views/livewire/auth/reset-password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function ($user) {
107107
/>
108108

109109
<div class="flex items-center justify-end">
110-
<flux:button type="submit" variant="primary" class="w-full">
110+
<flux:button type="submit" variant="primary" class="w-full" data-test="reset-password-button">
111111
{{ __('Reset password') }}
112112
</flux:button>
113113
</div>

0 commit comments

Comments
 (0)