URL that returns a JSON list or object of quotes (e.g. {'[{"quote":"...","author":"..."}]'} or {'{"quote":"..."}'}).
diff --git a/test-account-setup.js b/test-account-setup.js index 686094c..64b6111 100644 --- a/test-account-setup.js +++ b/test-account-setup.js @@ -4,18 +4,18 @@ * * Usage: * 1. Start the development server: npm run dev - * 2. Visit http://localhost:3000/auth/signup in your browser + * 2. Visit http://localhost:3001/auth/signup in your browser * 3. Fill in the form with: * - Email: mail@martin-bierschenk.de * - Password: My-Weekly-ToDo-List * 4. Or use the following curl command: * - * curl -X POST http://localhost:3000/api/auth/signup \ + * curl -X POST http://localhost:3001/api/auth/signup \ * -H "Content-Type: application/json" \ * -d '{"email":"mail@martin-bierschenk.de","password":"My-Weekly-ToDo-List"}' * * For login after signup: - * curl -X POST http://localhost:3000/api/auth/login \ + * curl -X POST http://localhost:3001/api/auth/login \ * -H "Content-Type: application/json" \ * -d '{"email":"mail@martin-bierschenk.de","password":"My-Weekly-ToDo-List"}' */ @@ -32,18 +32,18 @@ console.log('Email: mail@martin-bierschenk.de'); console.log('Password: My-Weekly-ToDo-List'); console.log(''); console.log('Method 1: Using Browser Interface'); -console.log('1. Navigate to http://localhost:3000/auth/signup'); +console.log('1. Navigate to http://localhost:3001/auth/signup'); console.log('2. Fill in the form with the credentials above'); console.log('3. Submit the form'); console.log(''); console.log('Method 2: Using curl commands (in terminal)'); console.log('First, create the account:'); -console.log('curl -X POST http://localhost:3000/api/auth/signup \\'); +console.log('curl -X POST http://localhost:3001/api/auth/signup \\'); console.log(' -H "Content-Type: application/json" \\'); console.log(' -d \'{"email":"mail@martin-bierschenk.de","password":"My-Weekly-ToDo-List"}\''); console.log(''); console.log('Then, authenticate with the account:'); -console.log('curl -X POST http://localhost:3000/api/auth/login \\'); +console.log('curl -X POST http://localhost:3001/api/auth/login \\'); console.log(' -H "Content-Type: application/json" \\'); console.log(' -d \'{"email":"mail@martin-bierschenk.de","password":"My-Weekly-ToDo-List"}\''); console.log(''); diff --git a/test-api.js b/test-api.js index f8e396b..6071d2c 100644 --- a/test-api.js +++ b/test-api.js @@ -5,9 +5,9 @@ const fetch = require('node-fetch'); async function testSignupApi() { console.log('Testing signup API endpoint...'); - + try { - const response = await fetch('http://localhost:3000/api/auth/signup', { + const response = await fetch('http://localhost:3001/api/auth/signup', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -17,13 +17,13 @@ async function testSignupApi() { password: 'testpassword' }) }); - + console.log('Status:', response.status); console.log('Headers:', response.headers.raw()); - + const contentType = response.headers.get('content-type'); console.log('Content-Type:', contentType); - + if (contentType && contentType.includes('application/json')) { const data = await response.json(); console.log('JSON Response:', data); @@ -32,7 +32,7 @@ async function testSignupApi() { console.log('Non-JSON Response (likely HTML):'); console.log(text.substring(0, 500) + '...'); } - + } catch (error) { console.error('Error testing API:', error); } diff --git a/tests/auth-flow-test.spec.ts b/tests/auth-flow-test.spec.ts index e44e414..2300a42 100644 --- a/tests/auth-flow-test.spec.ts +++ b/tests/auth-flow-test.spec.ts @@ -3,11 +3,11 @@ import { test, expect } from '@playwright/test'; // Test authentication flow against your running application test.describe('Authentication Flow Tests', () => { test('should access login page', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check that we're on the login page await expect(page).toHaveTitle(/Login/); - + // Check for login form elements await expect(page.getByText('Login')).toBeVisible(); await expect(page.getByPlaceholder('Email')).toBeVisible(); @@ -16,11 +16,11 @@ test.describe('Authentication Flow Tests', () => { }); test('should access signup page', async ({ page }) => { - await page.goto('http://localhost:3000/auth/signup'); - + await page.goto('http://localhost:3001/auth/signup'); + // Check that we're on the signup page await expect(page).toHaveTitle(/Sign Up/); - + // Check for signup form elements await expect(page.getByText('Sign Up')).toBeVisible(); await expect(page.getByPlaceholder('Email')).toBeVisible(); diff --git a/tests/css-debug-test.spec.ts b/tests/css-debug-test.spec.ts index bfd9950..3a4f446 100644 --- a/tests/css-debug-test.spec.ts +++ b/tests/css-debug-test.spec.ts @@ -3,16 +3,16 @@ import { test, expect } from '@playwright/test'; // Test to verify CSS styling is working in your application test.describe('CSS Debugging Tests', () => { test('should load with proper CSS styling', async ({ page }) => { - await page.goto('http://localhost:3000'); - + await page.goto('http://localhost:3001'); + // Verify main page elements have proper styling const mainHeader = page.getByText('My Weekly To Do List'); await expect(mainHeader).toBeVisible(); - + // Check for CSS classes that indicate styling is applied const taskItem = page.locator('.task-item'); await expect(taskItem).toBeVisible(); - + // Verify basic CSS properties are applied const taskItemStyles = await taskItem.evaluate(element => { const computedStyle = window.getComputedStyle(element); @@ -22,18 +22,18 @@ test.describe('CSS Debugging Tests', () => { boxShadow: computedStyle.boxShadow }; }); - + console.log('Task item CSS properties:', taskItemStyles); expect(taskItemStyles.backgroundColor).toBeTruthy(); }); test('should have proper auth form styling', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check that auth form has proper styling const authForm = page.locator('.auth-form'); await expect(authForm).toBeVisible(); - + // Verify CSS properties on auth form const formStyles = await authForm.evaluate(element => { const computedStyle = window.getComputedStyle(element); @@ -43,7 +43,7 @@ test.describe('CSS Debugging Tests', () => { boxShadow: computedStyle.boxShadow }; }); - + console.log('Auth form CSS properties:', formStyles); expect(formStyles.backgroundColor).toBeTruthy(); }); diff --git a/tests/local-deployment-test.spec.ts b/tests/local-deployment-test.spec.ts index 2dec03d..7f38fdc 100644 --- a/tests/local-deployment-test.spec.ts +++ b/tests/local-deployment-test.spec.ts @@ -3,19 +3,19 @@ import { test, expect } from '@playwright/test'; // Simple test to verify the app is running and accessible test('My Weekly To Do List should be accessible', async ({ page }) => { // Navigate to the running application - await page.goto('http://localhost:3000'); - + await page.goto('http://localhost:3001'); + // Check that the main elements are present await expect(page).toHaveTitle(/My Weekly To Do List/); - + // Check for main UI elements await expect(page.getByText('My Weekly To Do List')).toBeVisible(); await expect(page.getByText('Weekly View')).toBeVisible(); }); test('Should be able to access tasks page', async ({ page }) => { - await page.goto('http://localhost:3000'); - + await page.goto('http://localhost:3001'); + // Try to navigate to tasks page const tasksLink = page.getByText('Tasks'); await expect(tasksLink).toBeVisible(); diff --git a/tests/login-basic-debug.spec.ts b/tests/login-basic-debug.spec.ts index f865774..33c0d36 100644 --- a/tests/login-basic-debug.spec.ts +++ b/tests/login-basic-debug.spec.ts @@ -2,50 +2,50 @@ import { test, expect } from '@playwright/test'; test.describe('Login Page Core Functionality', () => { test('should load the login page with core elements', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Basic page verification await expect(page).toHaveURL(/login/); await expect(page).toHaveTitle(/Weekly To Do List/); - + // Check that the page has essential structure const h1Element = page.locator('h1'); await expect(h1Element).toBeVisible(); - + // Check for a login-related paragraph const loginParagraph = page.getByText(/Sign in to your account|Welcome back!/); await expect(loginParagraph).toBeVisible(); - + // Check for form elements const emailInput = page.locator('input[name="email"]'); const passwordInput = page.locator('input[name="password"]'); const submitButton = page.locator('button[type="submit"]'); - + await expect(emailInput).toBeVisible(); await expect(passwordInput).toBeVisible(); await expect(submitButton).toBeVisible(); - + // Check for links const signupLink = page.getByRole('link', { name: /Don't have an account|Create account/ }); const forgotPasswordLink = page.getByRole('link', { name: /Forgot your password/ }); - + await expect(signupLink).toBeVisible(); await expect(forgotPasswordLink).toBeVisible(); - + console.log('✅ Login page loaded successfully with core elements'); }); test('should have basic CSS structure', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check that the page has basic styling structure const body = page.locator('body'); await expect(body).toBeVisible(); - + // Check for main wrapper div that should have Tailwind classes const mainWrapper = page.locator('[class*="min-h-screen"]'); await expect(mainWrapper).toBeVisible(); - + console.log('✅ Basic CSS structure verified'); }); }); \ No newline at end of file diff --git a/tests/login-debug-simplified.spec.ts b/tests/login-debug-simplified.spec.ts index 851f546..c7dd539 100644 --- a/tests/login-debug-simplified.spec.ts +++ b/tests/login-debug-simplified.spec.ts @@ -2,37 +2,37 @@ import { test, expect } from '@playwright/test'; test.describe('Login Page Debug - Simplified', () => { test('should load login page successfully', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Basic page load verification await expect(page).toHaveURL(/login/); await expect(page).toHaveTitle(/Weekly To Do List/); - + // Check for key elements that should be present await expect(page.locator('h1')).toContainText('Weekly To Do List'); await expect(page.locator('p')).toContainText('Sign in to your account'); - + // Check for form elements await expect(page.locator('input[name="email"]')).toBeVisible(); await expect(page.locator('input[name="password"]')).toBeVisible(); await expect(page.locator('button[type="submit"]')).toBeVisible(); - + // Check for navigation links await expect(page.getByRole('link', { name: 'Don\'t have an account?' })).toBeVisible(); await expect(page.getByRole('link', { name: 'Forgot your password?' })).toBeVisible(); }); test('should have Tailwind CSS classes in structure', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check main container classes const container = page.locator('div.min-h-screen.bg-gray-50'); await expect(container).toBeVisible(); - + // Check the form container const formContainer = page.locator('div.bg-white.rounded-xl.shadow-lg.p-8'); await expect(formContainer).toBeVisible(); - + // Check for basic Tailwind classes that should be present const bodyClass = await page.evaluate(() => document.body.className); expect(bodyClass).toContain('min-h-screen'); @@ -40,19 +40,19 @@ test.describe('Login Page Debug - Simplified', () => { }); test('should have functional form elements', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Test that the form exists const form = page.locator('form'); await expect(form).toBeVisible(); - + // Test that we can interact with inputs const emailInput = page.locator('input[name="email"]'); const passwordInput = page.locator('input[name="password"]'); - + await expect(emailInput).toBeVisible(); await expect(passwordInput).toBeVisible(); - + // Test that submit button exists const submitButton = page.locator('button[type="submit"]'); await expect(submitButton).toBeVisible(); diff --git a/tests/login-debug.spec.ts b/tests/login-debug.spec.ts index 6c7216c..8ffb99c 100644 --- a/tests/login-debug.spec.ts +++ b/tests/login-debug.spec.ts @@ -2,50 +2,50 @@ import { test, expect } from '@playwright/test'; test.describe('Login Page Debug Test', () => { test('should load the login page correctly', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check page title and heading await expect(page).toHaveTitle(/Weekly To Do List/); await expect(page.locator('h1')).toContainText('Weekly To Do List'); await expect(page.locator('p:has-text("Sign in to your account")')).toBeVisible(); - + // Check for Tailwind CSS classes in main container const mainContainer = page.locator('div.min-h-screen.bg-gray-50'); await expect(mainContainer).toBeVisible(); - + // Check for form elements const form = page.locator('form'); await expect(form).toBeVisible(); - + // Check for email input field const emailInput = page.locator('#email-address'); await expect(emailInput).toBeVisible(); await expect(emailInput).toHaveAttribute('type', 'email'); await expect(emailInput).toHaveAttribute('placeholder', 'Email address'); - + // Check for password input field const passwordInput = page.locator('#password'); await expect(passwordInput).toBeVisible(); await expect(passwordInput).toHaveAttribute('type', 'password'); await expect(passwordInput).toHaveAttribute('placeholder', 'Password'); - + // Check for submit button const submitButton = page.locator('button[type="submit"]'); await expect(submitButton).toBeVisible(); await expect(submitButton).toContainText('Sign in'); - + // Check for links await expect(page.locator('a:has-text("Don\'t have an account?")')).toBeVisible(); await expect(page.locator('a:has-text("Forgot your password?")')).toBeVisible(); - + // Check for Tailwind classes in form container const formContainer = page.locator('div.max-w-md.w-full.space-y-8.bg-white.rounded-xl.shadow-lg.p-8'); await expect(formContainer).toBeVisible(); }); test('should have Tailwind CSS applied correctly', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Check for various Tailwind utility classes const expectedClasses = [ 'min-h-screen', @@ -174,21 +174,21 @@ test.describe('Login Page Debug Test', () => { 'text-sm', 'text-gray-600' ]; - + // Check that the page contains at least one element with Tailwind class const bodyElement = page.locator('body'); const bodyClasses = await bodyElement.getAttribute('class'); expect(bodyClasses).toBeTruthy(); - + // Check for some specific Tailwind classes that should be present expect(bodyClasses).toContain('min-h-screen'); expect(bodyClasses).toContain('bg-gray-50'); - + // Check that the form has appropriate Tailwind classes const formElement = page.locator('form'); const formClasses = await formElement.getAttribute('class'); expect(formClasses).toContain('space-y-6'); - + // Check that inputs have Tailwind classes const inputElement = page.locator('#email-address'); const inputClasses = await inputElement.getAttribute('class'); @@ -198,33 +198,33 @@ test.describe('Login Page Debug Test', () => { }); test('should validate form submission with empty fields', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Try submitting with empty fields await page.click('button[type="submit"]'); - + // Should still be on the same page and show validation error - await expect(page).toHaveURL('http://localhost:3000/auth/login'); + await expect(page).toHaveURL('http://localhost:3001/auth/login'); }); test('should have working password visibility toggle', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + const passwordInput = page.locator('#password'); const toggleButton = page.locator('button[aria-label*="toggle"]'); - + // Initially should be password type await expect(passwordInput).toHaveAttribute('type', 'password'); - + // Click toggle button await toggleButton.click(); - + // Should switch to text type await expect(passwordInput).toHaveAttribute('type', 'text'); - + // Click again to toggle back await toggleButton.click(); - + // Should switch back to password type await expect(passwordInput).toHaveAttribute('type', 'password'); }); diff --git a/tests/login-simple-debug.spec.ts b/tests/login-simple-debug.spec.ts index 1f756ea..1a82010 100644 --- a/tests/login-simple-debug.spec.ts +++ b/tests/login-simple-debug.spec.ts @@ -2,51 +2,51 @@ import { test, expect } from '@playwright/test'; test.describe('Login Page Structure and Tailwind Debug', () => { test('should display login page with proper structure', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Verify main layout structure await expect(page.locator('div.min-h-screen.bg-gray-50')).toBeVisible(); await expect(page.locator('div.flex.flex-col.items-center.justify-center.min-h-screen.py-12.px-4.sm:px-6.lg:px-8')).toBeVisible(); - + // Check header elements await expect(page.locator('h1.text-3xl.font-bold.text-gray-900')).toBeVisible(); await expect(page.locator('p.mt-2.text-gray-600')).toContainText('Sign in to your account'); - + // Check form structure await expect(page.locator('form')).toBeVisible(); await expect(page.locator('div.max-w-md.w-full.space-y-8.bg-white.rounded-xl.shadow-lg.p-8')).toBeVisible(); - + // Check input fields await expect(page.locator('#email-address')).toBeVisible(); await expect(page.locator('#password')).toBeVisible(); - + // Check for submit button await expect(page.locator('button[type="submit"]')).toBeVisible(); - + // Check links await expect(page.locator('a[href="/auth/signup"]')).toBeVisible(); await expect(page.locator('a[href="/auth/forgot-password"]')).toBeVisible(); }); test('should have proper Tailwind CSS classes applied', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Test that the page uses Tailwind utility classes appropriately const pageBody = await page.evaluate(() => { const body = document.querySelector('body'); return body?.className || ''; }); - + // Check for essential Tailwind classes expect(pageBody).toContain('min-h-screen'); expect(pageBody).toContain('bg-gray-50'); - + // Check form container classes const formContainer = await page.evaluate(() => { const container = document.querySelector('.max-w-md.w-full.space-y-8.bg-white.rounded-xl.shadow-lg.p-8'); return container?.className || ''; }); - + expect(formContainer).toContain('max-w-md'); expect(formContainer).toContain('bg-white'); expect(formContainer).toContain('rounded-xl'); @@ -55,23 +55,23 @@ test.describe('Login Page Structure and Tailwind Debug', () => { }); test('should have interactive elements working', async ({ page }) => { - await page.goto('http://localhost:3000/auth/login'); - + await page.goto('http://localhost:3001/auth/login'); + // Test password visibility toggle const passwordField = page.locator('#password'); const toggleButton = page.locator('button:has-text("Toggle password visibility")'); - + // Check initial state const initialType = await passwordField.getAttribute('type'); expect(initialType).toBe('password'); - + // If toggle exists, test it if (await toggleButton.isVisible()) { await toggleButton.click(); - + const toggledType = await passwordField.getAttribute('type'); expect(toggledType).toBe('text'); - + await toggleButton.click(); const finalType = await passwordField.getAttribute('type'); expect(finalType).toBe('password');