|
1 | | -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 1 | +## Percy Build Report Generator |
2 | 2 |
|
3 | | -## Getting Started |
| 3 | +This tool fetches snapshots from a specific **Percy** build via the BrowserStack/Percy API, calculates visual and AI diff percentages, and provides a downloadable CSV report. |
4 | 4 |
|
5 | | -First, run the development server: |
| 5 | +--- |
6 | 6 |
|
7 | | -```bash |
8 | | -npm run dev |
9 | | -# or |
10 | | -yarn dev |
11 | | -# or |
12 | | -pnpm dev |
13 | | -# or |
14 | | -bun dev |
15 | | -``` |
| 7 | +### 🚀 Getting Started |
16 | 8 |
|
17 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 9 | +1. **Clone the repository** and install dependencies: |
| 10 | + ```bash |
| 11 | + npm install |
| 12 | + ``` |
| 13 | +2. **Get your Token:** |
| 14 | + * Log into Percy.io. |
| 15 | + * Go to **Project Settings**. |
| 16 | + * Copy the **Read-only Token**. |
| 17 | +3. **Run the App:** |
| 18 | + ```bash |
| 19 | + npm run dev |
| 20 | + ``` |
18 | 21 |
|
19 | | -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 22 | +--- |
20 | 23 |
|
21 | | -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 24 | +### 🛠 How to Use |
22 | 25 |
|
23 | | -## Learn More |
| 26 | +1. **Enter Token:** Paste your Percy Read-only token into the first input field. |
| 27 | +2. **Enter Build URL:** Paste the full URL of the build you want to analyze (e.g., `https://percy.io/org/project/builds/1234567`). |
| 28 | +3. **Generate Report:** Click **"Get Report"**. The app will: |
| 29 | + * Identify the project slug and organization. |
| 30 | + * Fetch all snapshots (handling pagination automatically). |
| 31 | + * Calculate diff ratios as percentages. |
| 32 | +4. **Export:** Use the **"Download CSV"** button to save the results for stakeholder reporting. |
24 | 33 |
|
25 | | -To learn more about Next.js, take a look at the following resources: |
| 34 | +--- |
26 | 35 |
|
27 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 36 | +### 📊 Data Points Captured |
29 | 37 |
|
30 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 38 | +| Column | Description | |
| 39 | +| :--- | :--- | |
| 40 | +| **Snapshot Name** | The name defined in your test suite. | |
| 41 | +| **Visual Diff %** | The percentage of pixels changed across all viewports. | |
| 42 | +| **Percy URL** | A direct deep-link to the `/changed/` view for that snapshot. | |
31 | 43 |
|
32 | | -## Deploy on Vercel |
| 44 | +--- |
33 | 45 |
|
34 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 46 | +### 📁 Tech Stack |
35 | 47 |
|
36 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| 48 | +* **Framework:** [Next.js](https://nextjs.org/) (App Router) |
| 49 | +* **Styling:** [Tailwind CSS](https://tailwindcss.com/) + [DaisyUI](https://daisyui.com/) |
| 50 | +* **Notifications:** [React-Toastify](https://fkhadra.github.io/react-toastify/) |
| 51 | +* **API:** [Percy JSON:API v1](https://www.browserstack.com/docs/percy/api-reference) |
0 commit comments