ScreenshotNeo

BlogHow-to

How to Use Happo for Hindi and Other Indic-Language Website Testing

Use Happo visual regression tests to review Hindi and other Indic-language layouts across browsers, and learn what screenshots can—and cannot—prove.

By the ScreenshotNeo team4 October 202611 min read

Short answer: Use Happo with Playwright, Cypress, or Storybook to capture representative Hindi and other Indic-language interface states, compare them with a baseline, and review the diffs across the browsers and viewports in your run. Make sure your page’s intended fonts and other assets have loaded before capture. Happo documents general screenshot testing and font-aware capture behavior; its reviewed documentation does not promise Hindi-specific coverage, correct shaping, or complete glyph support. Check the actual rendered text in the combinations your users rely on.

This guide shows how to plan Indic-language visual checks, prepare a page for reliable captures, add those checks to a Happo workflow, interpret failures, and distinguish screenshot evidence from functional and accessibility checks.

1. What Happo can and cannot establish

Happo adds screenshot-based visual regression testing to workflows using Playwright, Cypress, or Storybook. You capture UI states, compare the resulting images with a baseline, and review visual differences. Its integration pages describe browser and responsive viewport coverage, CI workflows, and measures to reduce screenshot instability, including waiting for fonts and assets and silencing animations. Happo Playwright overview, Happo Cypress overview, Happo Storybook overview.

That makes Happo useful for catching visible changes such as unexpected line wrapping, clipping, alignment shifts, spacing changes, and fallback-font substitutions. But a visual diff is not a linguistic correctness check. The reviewed Happo material makes no explicit claim of a Hindi or Indic-language mode, a supported-script list, guaranteed shaping behavior, or glyph coverage. A passing comparison only means the captured result is sufficiently similar to its baseline under that run’s settings.

Check What it helps answer What it does not prove by itself
Functional assertion Did an interaction, route, or application state behave as expected? That text looks correctly shaped or laid out.
Happo visual diff Did the rendered appearance change from the approved baseline? That the text is linguistically correct or every glyph is supported.
Accessibility regression check Did accessibility violations change in the tested UI? That Indic typography or shaping is visually correct.
Human review with target content Does the actual script render and read correctly for the intended use? That untested browsers, devices, fonts, or content behave the same way.

2. Choose the integration and test cases

Use the integration that matches the thing you need to exercise:

  • Storybook: A good fit for isolated components and their states, such as a Hindi button label, a validation message, an open menu, or a long heading. Happo describes capturing stories across browsers and viewport sizes and reviewing results in CI.
  • Playwright: A good fit for routed pages and flows where the page must load real application data or reach a particular state before capture. Happo documents Playwright visual testing across browsers and viewport sizes.
  • Cypress: A good fit when the existing Cypress suite already drives the relevant page flows. Happo describes capturing key states and reviewing diffs through CI.

Keep the test set representative. Include short and long strings, mixed Latin and target-script content where the product uses it, and text likely to wrap or truncate. Cover navigation, buttons, form labels, validation and error messages, tables, headings, dialogs, and responsive layouts when they exist in your product. This is test-design guidance, not a prescribed Happo corpus.

Prioritize content that can expose different failure modes: conjuncts and diacritics, punctuation, numerals, Latin-script product names mixed with Indic text, long unbroken tokens, and strings near a container’s width limit. Use the actual approved translations where possible. A synthetic string can exercise layout, but it cannot establish that production copy is correct.

3. Prepare the page before capture

  1. Load the page and reach a stable state. Navigate to the route or render the story, populate the target-language content, and wait for asynchronous application work that affects the visible state.
  2. Check the intended font is available and applied. Confirm the font request succeeds and the relevant text actually uses the expected family and weight. A declared CSS font stack alone does not show that the webfont loaded.
  3. Wait for fonts and assets before capture. Happo says its documented Playwright and Cypress workflows wait for fonts and assets. Inspect your own page as well, especially if fonts are loaded dynamically or content changes after hydration.
  4. Remove time-dependent visual noise. Prefer stable data and states. Happo documents suppressing animations in its integrations; also avoid clocks, rotating content, and random values in the target region where possible.
  5. Capture at useful viewport sizes. Test the widths where the interface changes layout, including narrow mobile widths and a wider desktop size. A single desktop capture can miss wrapping, overflow, and clipped controls on small screens.
  6. Review every changed region. Compare the baseline and new capture at readable zoom. Confirm whether a diff is a desired copy or design change, a rendering problem, or harmless rasterization noise.

Do not accept a baseline until the font and content are representative. Otherwise, a fallback-font screenshot may become the approved image and conceal the later arrival of the intended font as a regression.

4. A runnable Playwright preflight for fonts and text

The following standalone Playwright script checks that the page’s document fonts have settled, records the computed font for a target element, verifies that the element contains nonempty text, and saves a screenshot. It is a local preflight, not Happo integration code. Use your Happo Playwright integration to capture and compare the same state in your configured run; follow Happo’s current setup instructions for the integration itself.

// indic-preflight.mjs
import { chromium } from 'playwright';

const url = process.argv[2] ?? 'http://localhost:3000/hi';
const selector = process.argv[3] ?? 'main';

const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage({ viewport: { width: 390, height: 844 } });
  await page.goto(url, { waitUntil: 'networkidle' });
  await page.evaluate(() => document.fonts.ready);

  const target = page.locator(selector).first();
  await target.waitFor({ state: 'visible' });
  const details = await target.evaluate((element) => ({
    text: element.textContent?.trim() ?? '',
    fontFamily: getComputedStyle(element).fontFamily,
    fontSize: getComputedStyle(element).fontSize,
    lineHeight: getComputedStyle(element).lineHeight,
    bounds: (() => {
      const rect = element.getBoundingClientRect();
      return { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
    })(),
  }));

  if (!details.text) throw new Error(`No text found in ${selector}`);
  console.log(JSON.stringify(details, null, 2));
  await page.screenshot({ path: 'indic-preflight.png', fullPage: true });
} finally {
  await browser.close();
}

Run it with your local app URL and a selector that targets the text block you want to inspect:

npm install --save-dev playwright
npx playwright install chromium
node indic-preflight.mjs http://localhost:3000/hi 'main h1'

document.fonts.ready waits for the document’s font loading set to finish, but it does not certify that a particular font file loaded successfully or that every character has a glyph. Check browser network errors and inspect the screenshot. Also test the element’s real content: measuring an element’s bounds will not reveal every shaping or reading-order defect.

5. Run and review Happo visual checks

  1. Install the integration for your existing test environment. Choose Happo’s documented Playwright, Cypress, or Storybook setup. The exact packages and configuration depend on the chosen integration and project versions; use the linked official setup material rather than copying configuration for a different version.
  2. Capture stable, named states. Give important stories or test states clear identifiers that distinguish language, viewport, and interaction state. Keep names consistent so reviewers can find the right baseline.
  3. Configure the relevant browser and viewport targets. Happo’s integration pages list Chrome, Firefox, Safari, Edge, and iOS Safari, and describe responsive viewport captures. Select the targets relevant to your users and your available integration configuration; do not assume every possible operating-system and font combination is covered by one run.
  4. Run visual checks in CI. Happo describes CI integration and review links for screenshot comparisons. Make the visual result available to pull-request reviewers alongside functional test results.
  5. Review diffs before updating baselines. Inspect line breaks, clipping, glyph appearance, baselines, spacing, and neighboring controls. Update a baseline only after confirming that the new output is intended.
  6. Add accessibility checks where useful. Happo describes accessibility regression checks that can run with visual tests or as a standalone suite. Review those results separately; they complement visual inspection but do not verify glyph shaping.

For implementation details, use the official Playwright, Cypress, and Storybook integration pages. Happo’s accessibility overview describes the complementary accessibility workflow.

6. Build a meaningful Indic-language coverage matrix

A useful matrix varies the factors that can change rendering. Start with the combinations that matter to the product rather than multiplying every possible factor into every test.

Dimension Include Look for
Content Short and long real strings; mixed-script labels; text near wrapping limits Unexpected breaks, clipping, truncation, reordered or missing marks
Component state Default, hover or focus where relevant, validation error, expanded, disabled Text overlapping icons, borders, buttons, or neighboring controls
Viewport At least the important narrow and wide layouts Overflow, changed line count, squeezed controls, broken responsive rules
Browser Browsers and mobile targets used by the audience Browser-specific font fallback or differences in line metrics
Font and weight Production font files and weights used by the page Failed font loads, synthetic weight, inconsistent line height
Page state Loaded content and deterministic data Hydration shifts, late-loading content, stale or incomplete text

Happo documents cross-browser and responsive capture options, but that does not mean a run covers every operating system, installed font, device configuration, or script-rendering combination. If a platform-specific issue matters, test that real platform separately and record the limitation in the test plan.

7. Common problems and fixes

Symptom Likely cause What to do
Indic characters appear as boxes or missing glyphs The selected font lacks glyph coverage, the font failed to load, or the browser used a fallback. Inspect font requests and computed styles; verify the exact font files and weights include the required characters; capture again after fonts load.
Text looks different in CI than on a developer machine Different browser/platform rendering, font availability, font loading timing, or viewport. Compare the configured browser and viewport; make font assets available in the test environment; use the same stable capture path and investigate platform-specific behavior.
Visual diffs change between identical runs Animations, asynchronous assets, changing data, late fonts, or other nondeterministic content. Wait for relevant assets and fonts, suppress animation as supported by the workflow, and stabilize the page state and data.
Only long Hindi labels fail Fixed dimensions, insufficient wrapping, overflow rules, or a layout designed around shorter strings. Test the longest production strings; review min-width, overflow, line-height, and responsive rules; capture the narrow viewport where the issue appears.
A baseline changes after a font update The font metrics or glyph rendering changed, intentionally or otherwise. Review the actual before-and-after output at readable zoom; approve only if the updated rendering is expected and acceptable.
The screenshot is blank or captures the wrong state The route or story did not reach the expected state before capture, or content is populated asynchronously. Wait for a specific visible element or state in the test, assert that expected text is present, and then capture.
Diffs are noisy around edges Antialiasing, compression, or small rasterization changes. Use Happo’s documented color-delta tolerance carefully; do not use tolerance to hide missing marks, changed wrapping, or real clipping.
Visual checks pass but users report incorrect text The baseline may already contain the defect, or the check may not cover the affected content or platform. Verify production copy and target-platform rendering with human review; add the failing real content and relevant browser or viewport to coverage.

8. Performance, reliability, and cost considerations

Each additional state, viewport, and browser increases the amount of visual coverage to render and review. Begin with high-impact flows and representative text cases, then expand when defects or product risk justify it. Happo’s integration pages describe parallel browser runs and CI workflows, but the reviewed material does not provide a universal runtime or price estimate for a particular suite. Measure your own pipeline rather than assuming a fixed cost or duration.

Reliability depends on repeatable inputs: stable content, settled fonts and assets, controlled animation, and consistent viewports. Happo documents measures intended to reduce flakiness, including waiting for assets and fonts, silencing animations, and configuring color-delta tolerance. These reduce noise; they do not eliminate the need to inspect meaningful diffs. Keep a distinction between a true layout or glyph defect and harmless pixel-level rendering variation.

For cost control, prioritize states that cover distinct risks instead of duplicating near-identical captures. Avoid accepting a baseline simply to clear a CI failure. The available dossier does not establish Happo plan pricing, so consult its current pricing information for budget decisions.

9. Or skip the browser setup

If you need a rendered page screenshot without wiring up a browser test, ScreenshotNeo is a website screenshot API and MCP server for developers. A single request captures a URL as an image or PDF. It can be useful for checking how a publicly reachable Hindi page rendered at a particular point in time; visual snapshots from an API do not replace Happo’s baseline comparisons in your CI workflow.

Install the Python dependency with pip install requests, then run:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Equivalent cURL request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Equivalent Node.js request:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer())));

See the ScreenshotNeo documentation for API options and setup. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

10. FAQ

Does Happo have a Hindi testing mode?

The reviewed official materials describe general screenshot and accessibility regression workflows, not a dedicated Hindi mode.

Does a passing Happo diff prove Hindi text is correct?

No. It shows similarity to the approved baseline under the configured capture. The baseline itself can contain a defect, and linguistic correctness needs appropriate content review.

Should I use Happo or functional assertions?

Use both when appearance and behavior matter. Assertions check expected state and behavior; visual comparisons expose rendered changes that assertions may not detect.

Can accessibility checks verify Indic glyph rendering?

No. Accessibility regression results complement screenshot review, but they are not a guarantee of correct shaping or glyph coverage.

Which browsers should I include?

Choose browsers and viewport sizes based on your users and support commitments. Happo lists Chrome, Firefox, Safari, Edge, and iOS Safari on its integration pages, but a selected run is not proof of every platform and font combination.