Compare commits
3 Commits
85f918b397
...
2c3480f980
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c3480f980 | |||
| 22a2cba3fe | |||
| 01717b392c |
4
.github/workflows/playwright.yml
vendored
4
.github/workflows/playwright.yml
vendored
@ -25,8 +25,8 @@ jobs:
|
||||
- name: Install Playwright Browsers
|
||||
run: pnpm exec playwright install --with-deps
|
||||
- name: Run the service that will be tested
|
||||
run: HOSTNAME=localhost node .next/standalone/server.js &
|
||||
run: HOSTNAME=127.0.0.1 node .next/standalone/server.js &
|
||||
- name: Wait for the service to be ready
|
||||
run: npx wait-on http://localhost:3000/default/dashboard/guests --timeout 30000
|
||||
run: npx wait-on http://127.0.0.1:3000/default/ --timeout 30000
|
||||
- name: Run Playwright tests
|
||||
run: DEBUG=pw:api pnpm exec playwright test
|
||||
|
||||
@ -15,12 +15,15 @@ import SkeletonTable from '@/app/ui/guests/skeleton-row';
|
||||
import GuestsTable from '@/app/ui/guests/table';
|
||||
import { TabPanel, TabView } from 'primereact/tabview';
|
||||
import { Toast } from 'primereact/toast';
|
||||
import { Suspense, useRef, useState } from 'react';
|
||||
import { Suspense, useEffect, useRef, useState } from 'react';
|
||||
import InvitationsBoard from '@/app/ui/invitations/board';
|
||||
import { Invitation, InvitationSerializer } from '@/app/lib/invitation';
|
||||
|
||||
|
||||
export default function Page() {
|
||||
const [slug, setSlug] = useState<string | null>(null);
|
||||
useEffect(() => { setSlug(getSlug()) }, []);
|
||||
|
||||
const toast = useRef<Toast>(null);
|
||||
|
||||
function refreshGuests() {
|
||||
@ -45,7 +48,7 @@ export default function Page() {
|
||||
}
|
||||
|
||||
function resetAffinities() {
|
||||
fetch(`/api/${getSlug()}/groups/affinities/reset`, {
|
||||
fetch(`/api/${slug}/groups/affinities/reset`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
|
||||
@ -16,11 +16,11 @@ export default async function Page() {
|
||||
if (getCsrfToken() == 'unknown') {
|
||||
retrieveCSRFToken();
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem('slug', await params.slug);
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem('slug', params.slug);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen flex-col p-6">
|
||||
|
||||
@ -14,6 +14,9 @@ import { getSlug } from '@/app/lib/utils';
|
||||
export default function LoginForm() {
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const [slug, setSlug] = useState<string | null>(null);
|
||||
useEffect(() => {setSlug(getSlug())}, []);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@ -41,7 +44,7 @@ export default function LoginForm() {
|
||||
password: password,
|
||||
onLogin: (user) => {
|
||||
setCurrentUser(user);
|
||||
router.push(`${getSlug()}/dashboard`)
|
||||
router.push(`${slug}/dashboard`)
|
||||
}
|
||||
})}>
|
||||
Sign in
|
||||
|
||||
@ -17,7 +17,9 @@ export default function RegistrationForm() {
|
||||
const [email, setEmail] = useState<string>("");
|
||||
const [password, setPassword] = useState<string>("");
|
||||
const [passwordConfirmation, setPasswordConfirmation] = useState<string>("");
|
||||
const [slug, setSlug] = useState<string>(getSlug());
|
||||
|
||||
const [slug, setSlug] = useState<string | null>(null);
|
||||
useEffect(() => { setSlug(getSlug()) }, []);
|
||||
|
||||
const [captchaId, setCaptchaId] = useState<string>("");
|
||||
const [captchaUrl, setCaptchaUrl] = useState<string>("");
|
||||
|
||||
@ -25,7 +25,7 @@ export default defineConfig({
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: 'http://localhost:3000',
|
||||
baseURL: 'http://127.0.0.1:3000',
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
@ -67,7 +67,7 @@ export default defineConfig({
|
||||
/* Run your local dev server before starting the tests */
|
||||
// webServer: {
|
||||
// command: 'npm run start',
|
||||
// url: 'http://localhost:3000',
|
||||
// url: 'http://127.0.0.1:3000',
|
||||
// reuseExistingServer: !process.env.CI,
|
||||
// },
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user