chore: save WIP before workstation switch
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
const BASE_URL = process.env.CI ? 'https://euchre-ci.notsosm.art' : 'http://localhost:3000';
|
||||
|
||||
|
||||
function getTestCredentials() {
|
||||
@@ -36,11 +37,11 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
testName = credentials.name;
|
||||
|
||||
// Create admin user via API
|
||||
const response = await fetch('http://localhost:3000/api/auth/sign-up/email', {
|
||||
const response = await fetch(`${BASE_URL}/api/auth/sign-up/email`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Origin': 'http://localhost:3000'
|
||||
'Origin': BASE_URL
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email: testEmail,
|
||||
@@ -82,7 +83,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
|
||||
test('Tournament creation page exists and loads', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
await page.fill('input[name="email"]', testEmail);
|
||||
await page.fill('input[name="password"]', testPassword);
|
||||
await page.click('button[type="submit"]');
|
||||
@@ -91,7 +92,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
|
||||
|
||||
// Navigate to new tournament page
|
||||
await page.goto('http://localhost:3000/admin/tournaments/new');
|
||||
await page.goto('/admin/tournaments/new');
|
||||
|
||||
// Check for form
|
||||
await expect(page.locator('form')).toBeVisible();
|
||||
@@ -99,7 +100,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
|
||||
test('Tournament form has required fields', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
await page.fill('input[name="email"]', testEmail);
|
||||
await page.fill('input[name="password"]', testPassword);
|
||||
await page.click('button[type="submit"]');
|
||||
@@ -107,7 +108,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
// Wait for redirect to admin or player profile (indicates successful login)
|
||||
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
|
||||
|
||||
await page.goto('http://localhost:3000/admin/tournaments/new');
|
||||
await page.goto('/admin/tournaments/new');
|
||||
|
||||
// Check for required fields
|
||||
await expect(page.locator('input[name="name"]')).toBeVisible();
|
||||
@@ -117,7 +118,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
|
||||
test('Create tournament with valid data', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
await page.fill('input[name="email"]', testEmail);
|
||||
await page.fill('input[name="password"]', testPassword);
|
||||
await page.click('button[type="submit"]');
|
||||
@@ -126,7 +127,7 @@ test.describe.serial('Epic 4: Tournament Creation', () => {
|
||||
await page.waitForURL(/\/(admin|players)/, { timeout: 10000 });
|
||||
|
||||
// Navigate to new tournament page
|
||||
await page.goto('http://localhost:3000/admin/tournaments/new');
|
||||
await page.goto('/admin/tournaments/new');
|
||||
|
||||
const tournamentName = `Test Tournament ${Date.now()}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user