Skip to content

Commit fec2e04

Browse files
committed
Commiting Template MMORPG Code
1 parent 66a4971 commit fec2e04

File tree

9 files changed

+2157
-75
lines changed

9 files changed

+2157
-75
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,22 @@ A real-time multiplayer dungeon crawler with **Vampire Survivors-style combat**,
4343

4444
### Services Overview
4545

46+
4647
```
4748
┌───────────────────────────────────────────────────────────────────┐
48-
│ Docker Compose
49-
├─────────────┬─────────────┬─────────────┬────────────────────────┤
50-
│ Profile │ Profile │ Game Server │ Game Client │
51-
│ Client │ API │ │ (React/Three.js) │
52-
│ (React) │ (Express) │ (Socket.IO) │ │
53-
│ │ │ │ │
54-
│ Port: 3000 │ Port: 3001 │ Port: 3030 │ Port: 5173 │
55-
│ ───────── │ ───────── │ ───────── │ ───────── │
56-
│ • Login UI │ • Auth API │ • Gameplay │ • Three.js Rendering │
57-
│ • Register │ • Sessions │ • Combat │ • Game UI/Tabs │
58-
│ • Dashboard │ • SQLite │ • Parties │ • Socket.IO Client │
59-
│ • Routing │ • Play Ticket Auth│ • Chat │ • Camera Controls │
60-
└─────────────┴─────────────┴─────────────┴────────────────────────┘
49+
│ Docker Compose │
50+
├─────────────┬─────────────┬─────────────┬────────────────────────
51+
│ Profile │ Profile │ Game Server │ Game Client
52+
│ Client │ API │ │ (React/Three.js)
53+
│ (React) │ (Express) │ (Socket.IO) │
54+
│ │ │ │
55+
│ Port: 3000 │ Port: 3001 │ Port: 3030 │ Port: 5173
56+
│ ───────── │ ───────── │ ───────── │ ─────────
57+
│ • Login UI │ • Auth API │ • Gameplay │ • Three.js Rendering
58+
│ • Register │ • Sessions │ • Combat │ • Game UI/Tabs
59+
│ • Dashboard │ • SQLite │ • Parties │ • Socket.IO Client
60+
│ • Routing │ • Play Ticket Auth│ • Chat│ • Camera Controls
61+
└─────────────┴─────────────┴─────────────┴────────────────────────
6162
```
6263

6364
### Directory Structure

__tests__/playwright.test.js

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,50 @@
11
const { test, expect } = require('@playwright/test');
22

3-
test('hello world test', async ({ page }) => {
4-
await page.goto('http://localhost:3000'); // Adjust the URL as needed
5-
const title = await page.title();
6-
expect(title).toBe('Expected Title'); // Replace with the expected title of your application
7-
});
3+
// Simple smoke test to ensure the profile/login app is up
4+
test('profile login page loads', async ({ page }) => {
5+
await page.goto('http://localhost:3000/login');
6+
await expect(page).toHaveTitle(/Dungeon Crawler - Login/i);
7+
});
8+
9+
// Happy path: register -> login -> go to game client -> create party -> see Start Dungeon enabled
10+
test('can register, login, open game, and create a party', async ({ page }) => {
11+
const unique = Date.now();
12+
const username = `testuser_${unique}`;
13+
const password = 'TestPass123!';
14+
15+
// Go to register page
16+
await page.goto('http://localhost:3000/register');
17+
18+
// Fill and submit registration form
19+
await page.getByLabel(/Username/i).fill(username);
20+
await page.getByLabel(/Password/i).fill(password);
21+
await page.getByLabel(/Confirm Password/i).fill(password);
22+
await page.getByRole('button', { name: /Register/i }).click();
23+
24+
// After successful register, we should land on /home
25+
await page.waitForURL('**/home');
26+
27+
// From home, open the game client via the "⚔️ Enter Game" button
28+
const playButton = await page.getByRole('button', { name: /Enter Game/i });
29+
await playButton.click();
30+
31+
// New tab/window with game client at 5173
32+
const [gamePage] = await Promise.all([
33+
page.context().waitForEvent('page'),
34+
]);
35+
36+
await gamePage.waitForLoadState('domcontentloaded');
37+
38+
// Ensure we are on game client
39+
await expect(gamePage).toHaveTitle(/Dungeon Crawler/i);
40+
41+
// Open Social tab
42+
await gamePage.getByRole('button', { name: 'Social' }).click();
43+
44+
// Click "Create Party"
45+
await gamePage.getByRole('button', { name: /Create Party/i }).click();
46+
47+
// Wait for Start Dungeon button to appear and be enabled
48+
const startButton = await gamePage.getByRole('button', { name: /Start Dungeon/i });
49+
await expect(startButton).toBeEnabled();
50+
});

0 commit comments

Comments
 (0)