-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-routing.js
More file actions
41 lines (32 loc) · 1.28 KB
/
test-routing.js
File metadata and controls
41 lines (32 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const puppeteer = require('puppeteer');
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
(async () => {
try {
console.log('Testing frontend routing...');
const browser = await puppeteer.launch({ headless: false, slowMo: 200 });
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 800 });
// Visit home page
await page.goto('http://localhost:5173');
await delay(2000);
// Check if we can reach login page
console.log('Checking login page...');
await page.goto('http://localhost:5173/auth/login');
await delay(2000);
console.log('Login page URL:', page.url());
// Check if we can reach register page
console.log('Checking register page...');
await page.goto('http://localhost:5173/auth/register');
await delay(2000);
console.log('Register page URL:', page.url());
// Check if we can reach email verification page
console.log('Checking email verification page...');
await page.goto('http://localhost:5173/auth/verify');
await delay(2000);
console.log('Email verification page URL:', page.url());
await browser.close();
console.log('✅ Routing test complete');
} catch (error) {
console.error('❌ Error:', error);
}
})();