Mail Server Factory Website Testing Suite
This comprehensive testing suite ensures 100% localization coverage and proper functionality of the Mail Server Factory website across all supported languages.
π Quick Start
Browser-Based Testing (Development)
Run tests directly in your browser console:
// Run all basic tests
window.websiteTester.runAllTests()
// Run comprehensive localization tests (tests all 29 languages)
window.websiteTester.testLocalization()
// Test language switching functionality
window.websiteTester.testLanguageSwitching()
// Test current language translations
window.websiteTester.testTranslations()
// Test visual elements
window.websiteTester.testVisualElements()
Automated Testing (CI/CD)
Run comprehensive tests programmatically:
# Install dependencies
npm install
# Run all tests against local development server
npm run test:local
# Run tests against any URL
node comprehensive-test-runner.js https://your-website.com
# Run browser-based tests (opens test page)
npm run test:browser
π Test Coverage
β Functionality Tests
- Language selector presence and functionality
- Theme toggle functionality
- Page element structure validation
- Performance metrics
- Accessibility compliance
- Visual element verification
π Localization Tests
- 29 Supported Languages: en, ru, be, zh, hi, fa, ar, ko, ja, sr, fr, de, es, pt, no, da, sv, is, bg, ro, hu, it, el, he, ka, kk, uz, tg, tr
- Translation completeness verification
- English word detection in non-English locales
- RTL language support (Arabic, Persian, Hebrew)
- Language switching functionality
π Quality Assurance
- 100% Translation Coverage: No English words visible in any non-English locale
- Zero Broken Elements: All required page elements present
- Proper RTL Support: Correct text direction for RTL languages
- Visual Consistency: All styling and layout elements working
π οΈ Test Structure
Browser Tests (test-website.js)
runAllTests(): Runs all basic functionality teststestLocalization(): Comprehensive localization testing for all languagestestLanguageSwitching(): Tests language switching mechanicstestTranslations(): Validates translations for current languagetestVisualElements(): Checks visual layout and styling
Automated Tests (comprehensive-test-runner.js)
- Headless browser testing with Puppeteer
- Comprehensive cross-language validation
- Detailed reporting and JSON output
- CI/CD integration ready
π Test Results
Success Criteria
- β All tests pass with 0 failures
- β 100% translation coverage - no English words in non-English locales
- β All page elements present and functional
- β Proper RTL support for Arabic, Persian, and Hebrew
- β Language switching works for all supported languages
Sample Output
π Starting Comprehensive Mail Server Factory Website Tests...
π Testing URL: http://localhost:4000
π Languages to test: 29
π§ Running Basic Functionality Tests...
β
[14:30:15] Page loaded successfully
β
[14:30:15] Language selector found
β
[14:30:15] Hero section found
π Running Comprehensive Localization Tests...
π Testing language: EN
β
[14:30:16] [EN] Language set correctly
β
[14:30:16] [EN] hero_title translated correctly
β
[14:30:16] [EN] features_title translated correctly
...
π FINAL RESULT: ALL TESTS PASSED! π
π§ Configuration
Supported Languages
The test suite validates all languages defined in _data/languages.yml:
en: English
ru: Π ΡΡΡΠΊΠΈΠΉ
be: ΠΠ΅Π»Π°ΡΡΡΠΊΠ°Ρ
zh: δΈζ
# ... and 25 more languages
Translation Files
Tests validate translations in _data/translations.yml with keys like:
hero_title: Main slogan with HTML spanfeatures_title: Section headersenterprise_title: Enterprise featurescta_title: Call-to-action text
π¨ Troubleshooting
Common Issues
Tests failing due to missing translations:
- Check
_data/translations.ymlfor missing language sections - Ensure all
data-i18nkeys have corresponding translations
Language switching not working:
- Verify
language-selector.jsis loaded - Check browser console for JavaScript errors
RTL languages not displaying correctly:
- Ensure
dir="rtl"is set onhtmlelement for RTL languages - Check CSS for RTL-specific styling
Debug Mode
Enable verbose logging:
// In browser console
window.websiteTester.log = function(msg, status) {
console.log(`[${status.toUpperCase()}] ${msg}`);
};
π CI/CD Integration
Add to your CI pipeline:
# GitHub Actions example
- name: Run Website Tests
run: |
npm install
npm run test:local
- name: Upload Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-report.json
π― Quality Gates
Must Pass Criteria
- Zero test failures in any environment
- 100% translation coverage for all supported languages
- All page elements render correctly in all languages
- No English text visible in non-English locales
- Proper RTL support for Arabic, Persian, and Hebrew
Performance Benchmarks
- Page load time: < 3 seconds
- Language switch time: < 1 second
- Memory usage: < 50MB
- DOM elements: < 1000
π Support
For test failures or questions:
- Check browser console for detailed error messages
- Review
test-report.jsonfor comprehensive results - Ensure all translations are present in
_data/translations.yml - Verify website is running on
http://localhost:4000for local testing
Note: These tests are designed to be run by AI QA systems and ensure complete localization coverage across all supported languages with zero English text leakage.</content> </xai:function_callβ>### Uzbek (uz)