← back to Handbag Auth Nextjs

playwright-test-luxury.js

57 lines

const playwright = require('playwright');

(async () => {
  const browser = await playwright.chromium.launch();

  // Desktop view
  const desktopContext = await browser.newContext({
    viewport: { width: 1920, height: 1080 },
  });
  const desktopPage = await desktopContext.newPage();

  console.log('🖥️  Testing DESKTOP view at http://45.61.58.125:7991');
  await desktopPage.goto('http://45.61.58.125:7991', { waitUntil: 'networkidle', timeout: 30000 });
  await desktopPage.screenshot({ path: '/tmp/luxvault-desktop.png', fullPage: true });
  console.log('✅ Desktop screenshot: /tmp/luxvault-desktop.png');

  // Mobile view
  const mobileContext = await browser.newContext({
    viewport: { width: 375, height: 812 },
    userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15'
  });
  const mobilePage = await mobileContext.newPage();

  console.log('\n📱 Testing MOBILE view');
  await mobilePage.goto('http://45.61.58.125:7991', { waitUntil: 'networkidle', timeout: 30000 });
  await mobilePage.screenshot({ path: '/tmp/luxvault-mobile.png', fullPage: true });
  console.log('✅ Mobile screenshot: /tmp/luxvault-mobile.png');

  // Check elements
  const heroTitle = await desktopPage.textContent('h1');
  const hasNav = await desktopPage.$('nav');
  const ctaButtons = await desktopPage.$$('button');
  const cards = await desktopPage.$$('[class*="group relative bg-gradient"]');

  console.log('\n🎨 Design Check:');
  console.log(`- Hero Title: "${heroTitle?.trim().substring(0, 50)}..."`);
  console.log(`- Navigation: ${hasNav ? '✅' : '❌'}`);
  console.log(`- CTA Buttons: ${ctaButtons.length}`);
  console.log(`- Featured Cards: ${cards.length}`);

  // Check if it's the new design
  const isLuxVault = heroTitle?.includes('Luxury History');
  const isDark = await desktopPage.evaluate(() => {
    const body = document.querySelector('body');
    return window.getComputedStyle(body).backgroundColor;
  });

  console.log('\n💎 New Luxury Platform:');
  console.log(`- LuxVault Branding: ${isLuxVault ? '✅ YES!' : '❌ No'}`);
  console.log(`- Dark Theme: ${isDark} ${isDark.includes('0, 0, 0') ? '✅' : '❌'}`);
  console.log(`- Professional Design: ${isLuxVault ? '✅ COMPLETE' : '❌ Needs work'}`);

  await browser.close();

  console.log('\n🚀 SITE LIVE: http://45.61.58.125:7991');
})();