# Testing Guide - Emporio Sport Implementation

## 🧪 Complete Testing Procedures

This guide walks you through testing all implemented features.

---

## 1. **Visual & Branding Tests** 🎨

### Test Color Theme
1. Open homepage in browser
2. **Expected:** 
   - Header: White background
   - Primary accents: Orange (#F07E2D)
   - Footer: Dark background (#1a1a1a)
   - Footer text: White
3. **Verify:** Visit multiple pages, check consistency

### Test Logo
1. Check header left side
2. **Expected:** Emporio Sport logo visible
3. **Expected:** Logo is from `/sport-pics/logo-1.png`
4. **Test:** Click logo, should go to homepage

### Test Brand Name
1. Look at page title (tab)
2. **Expected:** Shows "Emporio Sport" in title
3. **Check:** Right-click → View Page Source
4. **Look for:** `<title>...Emporio Sport...</title>`

---

## 2. **URL Rewriting Tests** 🔗

### Test 1: Homepage without extension
```
Type in address bar:
http://localhost/emporio-sport/

Expected: 
✓ Page loads normally
✓ Address bar shows: http://localhost/emporio-sport/
```

### Test 2: Shop page without .php
```
Type in address bar:
http://localhost/emporio-sport/shop

Expected:
✓ Shop page loads
✓ Address bar shows: http://localhost/emporio-sport/shop
(NOT /shop.php)
```

### Test 3: Contact page without .php
```
Type in address bar:
http://localhost/emporio-sport/contact

Expected:
✓ Contact page loads
✓ Address bar shows: http://localhost/emporio-sport/contact
(NOT /contact.php)
```

### Test 4: About page without .php
```
Type in address bar:
http://localhost/emporio-sport/about

Expected:
✓ About page loads
✓ Address bar shows: http://localhost/emporio-sport/about
(NOT /about.php)
```

### Test 5: Backward compatibility
```
Type in address bar (with .php):
http://localhost/emporio-sport/shop.php

Expected:
✓ Redirects to http://localhost/emporio-sport/shop
✓ Page loads normally
```

---

## 3. **Currency Change Tests** 💱

### Test 1: Currency dropdown visible
1. Open homepage
2. Look at top right section (promo strip)
3. **Expected:** Currency dropdown visible
4. **Default:** Should show "EUR"

### Test 2: Change currency to USD
1. Click currency dropdown
2. Select "USD"
3. **Expected:** Page reloads automatically
4. **Verify:** Dropdown now shows "USD" selected

### Test 3: Change currency to GBP
1. Click currency dropdown
2. Select "GBP"
3. **Expected:** Page reloads automatically
4. **Verify:** Dropdown now shows "GBP" selected

### Test 4: Currency persists
1. Change currency to "CAD"
2. Click on a different page (Shop, About, etc.)
3. **Expected:** Currency still shows "CAD"
4. **Verify:** Selection persists across pages

### Test 5: Browser console check
1. Press F12 to open Developer Tools
2. Click on "Console" tab
3. Change currency
4. **Expected:** Message shows "Currency changed to: usd, Exchange Rate: 1.1"
5. **No errors:** Should see no red error messages

---

## 4. **Language Change Tests** 🌍

### Test 1: Language dropdown visible
1. Open homepage
2. Look at top right section (promo strip)
3. **Expected:** Language dropdown visible
4. **Default:** Should show "ITA" (Italian)

### Test 2: Change language to English
1. Click language dropdown
2. Select "ENG"
3. **Expected:** Page reloads automatically
4. **Verify:** Dropdown now shows "ENG" selected

### Test 3: Change language to Spanish
1. Click language dropdown
2. Select "ESP"
3. **Expected:** Page reloads automatically
4. **Verify:** Dropdown now shows "ESP" selected

### Test 4: Change language to German
1. Click language dropdown
2. Select "GER"
3. **Expected:** Page reloads automatically
4. **Verify:** Dropdown now shows "GER" selected

### Test 5: Language persists
1. Change language to "ENG"
2. Click on a different page (Shop, About, etc.)
3. **Expected:** Language still shows "ENG"
4. **Verify:** Selection persists across pages

### Test 6: Browser console check
1. Press F12 to open Developer Tools
2. Click on "Console" tab
3. Change language
4. **Expected:** Message shows "Language changed to: English"
5. **No errors:** Should see no red error messages

---

## 5. **Meta Tags Tests** 📝

### Test 1: Check page title
```
Steps:
1. Open any page (e.g., homepage)
2. Check browser tab title
3. Look for: Page title | Emporio Sport

Example:
✓ "Home | Emporio Sport"
✓ "Shop - Prodotti Sportivi | Emporio Sport"
✓ "Chi Siamo | Emporio Sport"
```

### Test 2: Check meta description
```
Steps:
1. Right-click page → View Page Source
2. Search for: <meta name="description"
3. Should contain meaningful description
4. Should mention Emporio Sport

Example:
✓ <meta name="description" content="Abbigliamento sportivo...">
```

### Test 3: Check Open Graph tags
```
Steps:
1. Right-click page → View Page Source
2. Search for: <meta property="og:
3. Should have: og:title, og:description, og:image, og:url

Expected:
✓ <meta property="og:title" content="...">
✓ <meta property="og:description" content="...">
✓ <meta property="og:image" content="...">
✓ <meta property="og:url" content="...">
```

### Test 4: Check Twitter Card tags
```
Steps:
1. Right-click page → View Page Source
2. Search for: <meta name="twitter:
3. Should have: twitter:card, twitter:title, twitter:image

Expected:
✓ <meta name="twitter:card" content="summary_large_image">
✓ <meta name="twitter:title" content="...">
✓ <meta name="twitter:image" content="...">
```

### Test 5: Test different page types
- [ ] Homepage
- [ ] Shop page
- [ ] About page
- [ ] Contact page
- [ ] Blog page
- [ ] Individual blog post

---

## 6. **Image Tests** 🖼️

### Test 1: Logo displays
1. Open homepage
2. **Expected:** Emporio Sport logo visible in header
3. **Check:** Right-click logo → Inspect
4. **Look for:** `/sport-pics/logo-1.png` in src attribute

### Test 2: Product images
1. Go to Shop page
2. **Expected:** Product images load correctly
3. **Check:** Browser console (F12) for any broken image errors
4. **Expected:** No 404 errors for images

### Test 3: Image paths correct
1. Right-click any image → Inspect
2. **Look for:** `/sport-pics/` in the src path
3. **Example:** `<img src="/sport-pics/product-name.jpg">`
4. **Verify:** All images from sport-pics folder

---

## 7. **Database Connection Tests** 💾

### Test 1: Local Database (XAMPP)
```
Environment: localhost
Expected:
✓ Database connects successfully
✓ No connection errors on page load
✓ Login/Signup functionality works
✓ User data saved correctly

Check:
1. Try to login
2. Try to signup
3. Check user data persists
```

### Test 2: Production Database (cPanel)
```
Environment: emporio-sport.it
Expected:
✓ Database connects successfully
✓ No connection errors
✓ Login/Signup functionality works
✓ User data saved correctly

Check:
1. Upload to cPanel
2. Try to login
3. Try to signup
4. Verify same functionality as localhost
```

### Test 3: Verify correct database being used
```
XAMPP should use:
✓ Host: localhost
✓ User: root
✓ Database: login-table

cPanel should use:
✓ Host: maham.usadomainhosting.com
✓ User: mahamusa_user
✓ Database: mahamusa_db

Verify by:
1. Checking db_config.php logic
2. Running verify_implementation.php
3. Checking no connection errors
```

---

## 8. **Mobile Responsiveness Tests** 📱

### Test 1: Header on mobile
```
Steps:
1. Open homepage on mobile (or use DevTools)
2. Set width to 375px (iPhone)
3. Expected:
   ✓ Menu adapts to mobile layout
   ✓ Currency/Language dropdowns visible
   ✓ Logo visible
   ✓ No horizontal scroll
```

### Test 2: Footer on mobile
```
Steps:
1. Scroll to bottom on mobile
2. Expected:
   ✓ Footer columns stack vertically
   ✓ Dark background visible
   ✓ Text readable
   ✓ Links clickable
```

### Test 3: Color theme on mobile
```
Steps:
1. Open on mobile device or browser zoom
2. Expected:
   ✓ Orange accent color visible
   ✓ Dark footer displays correctly
   ✓ All colors match desktop
```

---

## 9. **Browser Compatibility Tests** 🌐

Test on these browsers:
- [ ] Chrome (latest)
- [ ] Firefox (latest)
- [ ] Safari (latest)
- [ ] Edge (latest)

Expected behavior:
- [ ] Color theme displays correctly
- [ ] URL rewriting works
- [ ] Currency/Language selectors work
- [ ] No console errors
- [ ] Meta tags present

---

## 10. **Performance Tests** ⚡

### Test 1: Page load time
```
Before: Note baseline time
After: Should be similar or faster
Tool: Chrome DevTools → Network tab
```

### Test 2: No console errors
```
Steps:
1. Open any page
2. Press F12
3. Click Console tab
4. Expected:
   ✓ No red error messages
   ✓ Only warnings are okay
```

### Test 3: Images load efficiently
```
Steps:
1. Open DevTools → Network tab
2. Load a page with images
3. Expected:
   ✓ Images load from cache
   ✓ No 404 errors
   ✓ Responsive sizes served
```

---

## 11. **Verification Tool Test** ✅

### Run automatic verification
```
Steps:
1. Open in browser:
   http://localhost/emporio-sport/verify_implementation.php

2. Expected:
   ✓ 15+ checks passed
   ✓ 0 errors (or minimal warnings)
   ✓ Green status at top
   ✓ All sections checked

3. If errors appear:
   - Read error message
   - Check documentation
   - Fix issue
   - Run verification again
```

---

## 12. **Full User Flow Test** 👤

### Complete user journey
```
Steps:
1. Open homepage
   ✓ Verify branding and colors

2. Change language
   ✓ Page reloads
   ✓ Selection persists

3. Change currency
   ✓ Page reloads
   ✓ Selection persists

4. Browse shop (without .php in URL)
   ✓ URL shows /shop not /shop.php
   ✓ Products display

5. View a product
   ✓ Meta tags correct
   ✓ Product image from sport-pics loads

6. Go to contact
   ✓ URL shows /contact not /contact.php
   ✓ Contact form displays

7. Check different pages
   ✓ Language selection persists
   ✓ Currency selection persists
   ✓ Colors consistent
```

---

## 📋 Test Results Tracking

Use this template to track your testing:

```
Test Name: _______________________________
Date: _______________________________
Tester: _______________________________

Results:
[ ] PASS
[ ] FAIL
[ ] PARTIAL

Issues Found:
_______________________________
_______________________________

Notes:
_______________________________
_______________________________
```

---

## 🐛 Issue Reporting

If you find issues:

1. **Document the issue:**
   - What were you testing?
   - What did you expect?
   - What actually happened?

2. **Check browser console:**
   - Press F12
   - Look at Console tab
   - Copy any error messages

3. **Check file permissions:**
   - Verify files are readable
   - Check .htaccess is accessible

4. **Run verification tool:**
   - Visit verify_implementation.php
   - Check for errors

5. **Reference documentation:**
   - IMPLEMENTATION_GUIDE.md
   - CHANGES_SUMMARY.md
   - QUICK_START.md

---

## ✅ Testing Checklist

Before going live:

- [ ] Color theme matches emporio-sport.it
- [ ] All URLs work without .php extension
- [ ] Currency dropdown works on all pages
- [ ] Language dropdown works on all pages
- [ ] Meta titles are correct (check page source)
- [ ] Logo displays correctly
- [ ] Footer is dark with white text
- [ ] Images load from sport-pics folder
- [ ] Works on localhost
- [ ] Works on cPanel
- [ ] Mobile responsive
- [ ] No console errors
- [ ] Verification tool shows all green
- [ ] User can login/signup
- [ ] Database works on both environments

---

## 🎉 Ready to Deploy!

Once all tests pass:
1. ✅ Push to cPanel
2. ✅ Run verification on live server
3. ✅ Monitor for any issues
4. ✅ Keep backups

**Good luck! 🚀**
