Abstract
Playwright Lighthouse is an open-source Digital Marketing & SEO project. :performing_arts:: Playwright Lighthouse Audit. Lighthouse is a tool developed by Google that analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices. It is built using JavaScript. The complete source code is publicly available on GitHub under the MIT License, making it a useful reference for students building a Digital Marketing & SEO mini project or final-year project.
1. Introduction
Lighthouse is a tool developed by Google that analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices.
Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.
The purpose of this package is to produce web audit report for several pages in connected mode and in an automated (programmatic) way.
2. Objective
:performing_arts:: Playwright Lighthouse Audit
This project demonstrates how JavaScript can be applied to a real-world Digital Marketing & SEO problem.
4. Technology Stack
5. System Requirements
General requirements for this technology stack — check the README for exact versions.
- Node.js (LTS) and npm
- A modern web browser
- VS Code or any code editor
- Git (to clone the repository)
6. Installation & Setup
git clone https://github.com/abhinaba-ghosh/playwright-lighthouse.git
cd playwright-lighthouse$ yarn add -D playwright-lighthouse playwright lighthouse
# or
$ npm install --save-dev playwright-lighthouse playwright lighthouseimport { chromium } from 'playwright';
import type { Browser } from 'playwright';
import { playAudit } from 'playwright-lighthouse';
import { test as base } from '@playwright/test';
import getPort from 'get-port';
export const lighthouseTest = base.extend<
{},
{ port: number; browser: Browser }
>({
port: [
async ({}, use) => {
// Assign a unique port for each playwright worker to support parallel tests
const port = await getPort();
await use(port);
},
{ scope: 'worker' },
],
browser: [
async ({ port }, use) => {
const browser = await chromium.launch({
args: [`--remote-debugging-port=${port}`],
});
await use(browser);
},
{ scope: 'worker' },
],
});
lighthouseTest.describe('Lighthouse', () => {
lighthouseTest('should pass lighthouse tests', async ({ page, port }) => {
await page.goto('http://example.com');
await page.waitForSelector('#some-element');
await playAudit({
page,
port,
});
});
});npm install playwright-lighthouseFull setup instructions are in the project README.
7. Future Enhancements
Suggested extensions you can add to make this your own project.
- Export reports to Google Sheets or PDF
- Schedule weekly automated reports
- Add competitor comparison
8. Viva / Review Questions
Common questions examiners ask for projects in this domain.
- Which marketing or SEO problem does this tool solve?
- Which data sources or APIs does it use (Search Console, Analytics, social platforms)?
- Which metrics or KPIs does it report and how are they calculated?
- How could the output help a business make decisions?
- How would you schedule it to run automatically?
9. Source Code & License
This project is developed by abhinaba-ghosh and published on GitHub under the MIT License. Please follow the license terms and credit the original author when you use or modify this code.
Want to build this as your internship project?
Work on a Digital Marketing & SEO project like this with mentor guidance, weekly reviews and an internship certificate from Training Trains, Erode — online or offline.
Apply for Digital Marketing & SEO Internship