Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

CHANGELOG.md export-ignore
README.md export-ignore
.github/workflows/browser-test.yml export-ignore
71 changes: 71 additions & 0 deletions .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: browser-tests

on:
push:
branches:
- pest-ci
- develop
- main
pull_request:
branches:
- pest-ci
- develop
- main

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: xdebug

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install Node Dependencies
run: npm ci

- name: Install Playwright Dependencies
run: npm install playwright@latest

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Add `laravel-labs/starter-kit-browser-tests` Repository
run: |
composer config repositories.browser-tests '{"type": "vcs", "url": "https://github.com/laravel-labs/starter-kit-browser-tests"}' --file composer.json
composer remove "phpunit/phpunit" --dev --no-update
composer require "laravel-labs/starter-kit-browser-tests:dev-main@dev" --dev --no-update

- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader

- name: Copy Environment File
run: cp .env.example .env

- name: Generate Application Key
run: php artisan key:generate

- name: Setup Test Environment
run: |
cp vendor/laravel-labs/starter-kit-browser-tests/phpunit.xml.dist .
rm phpunit.xml
rm -Rf tests/
cp -rf vendor/laravel-labs/starter-kit-browser-tests/tests/ tests/

- name: Build Assets
run: npm run build

- name: Tests
run: php vendor/bin/pest
4 changes: 2 additions & 2 deletions resources/js/components/delete-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function DeleteUser() {

<Dialog>
<DialogTrigger asChild>
<Button variant="destructive">Delete account</Button>
<Button variant="destructive" data-test="delete-user-button">Delete account</Button>
</DialogTrigger>
<DialogContent>
<DialogTitle>Are you sure you want to delete your account?</DialogTitle>
Expand Down Expand Up @@ -67,7 +67,7 @@ export default function DeleteUser() {
</DialogClose>

<Button variant="destructive" disabled={processing} asChild>
<button type="submit">Delete account</button>
<button type="submit" data-test="confirm-delete-user-button">Delete account</button>
</Button>
</DialogFooter>
</>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/user-menu-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function UserMenuContent({ user }: UserMenuContentProps) {
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link className="block w-full" href={logout()} as="button" onClick={handleLogout}>
<Link className="block w-full" href={logout()} as="button" onClick={handleLogout} data-test="logout-button">
<LogOut className="mr-2" />
Log out
</Link>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/layouts/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Heading from '@/components/heading';
import { Button } from '@/components/ui/button';
import { Separator } from '@/components/ui/separator';
import { cn } from '@/lib/utils';
import { appearance } from '@/routes';
import { edit as editAppearance } from '@/routes/appearance';
import { edit as editPassword } from '@/routes/password';
import { edit } from '@/routes/profile';
import { type NavItem } from '@/types';
Expand All @@ -22,7 +22,7 @@ const sidebarNavItems: NavItem[] = [
},
{
title: 'Appearance',
href: appearance(),
href: editAppearance(),
icon: null,
},
];
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/auth/confirm-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function ConfirmPassword() {
</div>

<div className="flex items-center">
<Button className="w-full" disabled={processing}>
<Button className="w-full" disabled={processing} data-test="confirm-password-button">
{processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
Confirm password
</Button>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/auth/forgot-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function ForgotPassword({ status }: { status?: string }) {
</div>

<div className="my-6 flex items-center justify-start">
<Button className="w-full" disabled={processing}>
<Button className="w-full" disabled={processing} data-test="email-password-reset-link-button">
{processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
Email password reset link
</Button>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function Login({ status, canResetPassword }: LoginProps) {
<Label htmlFor="remember">Remember me</Label>
</div>

<Button type="submit" className="mt-4 w-full" tabIndex={4} disabled={processing}>
<Button type="submit" className="mt-4 w-full" tabIndex={4} disabled={processing} data-test="login-button">
{processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
Log in
</Button>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/auth/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function Register() {
<InputError message={errors.password_confirmation} />
</div>

<Button type="submit" className="mt-2 w-full" tabIndex={5}>
<Button type="submit" className="mt-2 w-full" tabIndex={5} data-test="register-user-button">
{processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
Create account
</Button>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/auth/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function ResetPassword({ token, email }: ResetPasswordProps) {
<InputError message={errors.password_confirmation} className="mt-2" />
</div>

<Button type="submit" className="mt-4 w-full" disabled={processing}>
<Button type="submit" className="mt-4 w-full" disabled={processing} data-test="reset-password-button">
{processing && <LoaderCircle className="h-4 w-4 animate-spin" />}
Reset password
</Button>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/pages/settings/appearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { type BreadcrumbItem } from '@/types';

import AppLayout from '@/layouts/app-layout';
import SettingsLayout from '@/layouts/settings/layout';
import { appearance } from '@/routes';
import { edit as editAppearance } from '@/routes/appearance';

const breadcrumbs: BreadcrumbItem[] = [
{
title: 'Appearance settings',
href: appearance().url,
href: editAppearance().url,
},
];

Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/settings/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function Password() {
</div>

<div className="flex items-center gap-4">
<Button disabled={processing}>Save password</Button>
<Button disabled={processing} data-test="update-password-button">Save password</Button>

<Transition
show={recentlySuccessful}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/settings/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail:
)}

<div className="flex items-center gap-4">
<Button disabled={processing}>Save</Button>
<Button disabled={processing} data-test="update-profile-button">Save</Button>

<Transition
show={recentlySuccessful}
Expand Down
2 changes: 1 addition & 1 deletion routes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

Route::get('settings/appearance', function () {
return Inertia::render('settings/appearance');
})->name('appearance');
})->name('appearance.edit');
});