Testing

Ensure your theme works correctly before deployment.

Pre-Deployment Checklist

1. Visual Testing

2. Functionality Testing

3. Responsive Design

4. Performance

5. Accessibility

Browser Testing

Test in major browsers:

  • Chrome (latest)

  • Firefox (latest)

  • Safari (if applicable)

  • Edge (latest)

Device Testing

Test on various devices:

  • Desktop (1920x1080, 1366x768)

  • Tablet (768x1024)

  • Mobile (375x667, 414x896)

Testing Tools

Browser DevTools

  • Responsive design mode - Test different screen sizes

  • Console - Check for JavaScript errors

  • Network tab - Monitor loading times

  • Lighthouse - Performance and accessibility audit

Online Tools

Debug Mode

Enable Symfony debug toolbar (development environment):

This shows:

  • Which templates are being rendered

  • Database queries

  • Performance metrics

  • Request/response information

Common Issues and Solutions

Templates Not Loading

Symptoms:

  • Page displays incorrectly

  • Template not found errors

  • Default theme showing instead of your theme

Solutions:

  1. Check file paths and naming

  2. Clear Symfony cache: docker exec pteroca_web_dev php bin/console cache:clear

  3. Verify template.json is valid JSON

  4. Ensure theme is activated in Settings → Appearance

  5. Check file permissions

Styles Not Applying

Symptoms:

  • CSS changes not visible

  • Default styles appearing

  • Broken layout

Solutions:

  1. Check CSS file paths in templates

  2. Verify files are in correct public directory (public/assets/theme/my-theme/)

  3. Clear browser cache (Ctrl+Shift+R)

  4. Check for CSS syntax errors

  5. Verify CSS is included in template using {% block head_stylesheets %}

  6. Check browser console for 404 errors

JavaScript Errors

Symptoms:

  • Features not working

  • Console errors

  • Page not interactive

Solutions:

  1. Open browser console (F12)

  2. Check for syntax errors

  3. Verify script paths are correct

  4. Ensure jQuery/Bootstrap is loaded (if using)

  5. Check for conflicting scripts

  6. Verify {% block body_javascript %} is used correctly

Responsive Issues

Symptoms:

  • Layout broken on mobile

  • Text too small or too large

  • Elements overlapping

  • Horizontal scrolling

Solutions:

  1. Use browser responsive design mode to test

  2. Test on actual devices when possible

  3. Check media query breakpoints

  4. Verify Bootstrap classes are correct

  5. Test with different orientations (portrait/landscape)

  6. Check viewport meta tag is present

Performance Issues

Symptoms:

  • Slow page load times

  • Laggy interactions

  • High resource usage

Solutions:

  1. Minify CSS and JavaScript files

  2. Optimize and compress images

  3. Use browser caching

  4. Remove unused CSS/JS

  5. Use Lighthouse audit to identify bottlenecks

  6. Consider lazy loading for images

Testing Workflow

1. Development Testing

During development:

  1. Use APP_ENV=dev for detailed error messages

  2. Test changes immediately in browser

  3. Check console for errors after each change

  4. Use Symfony debug toolbar

2. Pre-Production Testing

Before going live:

  1. Switch to APP_ENV=prod to test production mode

  2. Clear all caches

  3. Test all pages systematically

  4. Check multiple browsers and devices

  5. Run Lighthouse audit

  6. Verify no console errors

3. User Acceptance Testing

Final validation:

  1. Have real users test the theme

  2. Gather feedback on usability

  3. Check for edge cases

  4. Verify all workflows work

  5. Test with real data

Automated Testing

HTML Validation

CSS Validation

JavaScript Linting

Debugging Tips

1. Template Not Found

Verify theme is active via Admin Panel (Settings → Appearance → Current theme).

2. Asset Not Loading

3. JavaScript Not Working

4. CSS Not Applying

Quality Assurance

Before Release

  1. Code Review - Review all template and asset changes

  2. Security Check - Ensure no XSS vulnerabilities

  3. Performance Test - Verify acceptable load times

  4. Browser Test - Check all target browsers

  5. Mobile Test - Verify mobile experience

  6. Documentation - Update theme documentation

  7. Backup - Backup current theme before replacing

After Release

  1. Monitor errors - Check logs for issues

  2. Gather feedback - Collect user feedback

  3. Fix bugs - Address reported issues promptly

  4. Update docs - Document any issues and solutions

External Resources

Last updated