diff --git a/.env.test.example b/.env.test.example new file mode 100644 index 00000000..15e66b8f --- /dev/null +++ b/.env.test.example @@ -0,0 +1,16 @@ +# Test Environment Variables +# Copy this file to .env.test and fill in your values + +# WordPress API Configuration +WORDPRESS_API_URL=https://wp.keploy.io/graphql +NEXT_PUBLIC_WORDPRESS_API_URL=https://wp.keploy.io/graphql + +# Test Configuration +# Base URL for the application under test +BASE_URL=http://localhost:3000/blog + +# Timeouts (milliseconds) +TEST_TIMEOUT=30000 +TEST_EXPECT_TIMEOUT=10000 +TEST_ACTION_TIMEOUT=15000 +TEST_NAVIGATION_TIMEOUT=30000 diff --git a/.github/scripts/lighthouse-report.js b/.github/scripts/lighthouse-report.js deleted file mode 100644 index 037110ae..00000000 --- a/.github/scripts/lighthouse-report.js +++ /dev/null @@ -1,70 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -const dir = '.lighthouseci'; -const files = fs.readdirSync(dir).filter(file => file.endsWith('.report.json')); - -if (files.length < 2) { - console.error('❌ Not enough Lighthouse reports found.'); - process.exit(1); -} - -let mainReport = ''; -let prReport = ''; - -for (const file of files) { - const json = JSON.parse(fs.readFileSync(path.join(dir, file), 'utf8')); - const url = json.finalUrl; - - if (url.includes('3000')) mainReport = json; - else if (url.includes('3001')) prReport = json; -} - -function extract(report) { - return { - performance: report.categories.performance.score * 100, - accessibility: report.categories.accessibility.score * 100, - bestPractices: report.categories['best-practices'].score * 100, - seo: report.categories.seo.score * 100, - }; -} - -const main = extract(mainReport); -const pr = extract(prReport); - -const md = ` -**🔍 Lighthouse Scores** - -
| Metric | -⚡ PR Branch | -📦 Main Branch | -
|---|---|---|
| Performance | -${pr.performance} | -${main.performance} | -
| Accessibility | -${pr.accessibility} | -${main.accessibility} | -
| Best Practices | -${pr.bestPractices} | -${main.bestPractices} | -
| SEO | -${pr.seo} | -${main.seo} | -
- Generate test cases and data mocks with one click. Reduce unit test development time by 90%. -
- - - Sign up - + {!imgError ? ( + ++ Generate test cases and data mocks with one click. Reduce unit test development time by 90%. +
+ + Sign up + +