oh-graphic-pixel-tests-generator_skill

This skill helps you generate pixel-level OpenHarmony graphic test code with a complete framework, templates, and API references.
  • Python

0

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill openharmonyinsight/openharmony-skills --skill oh-graphic-pixel-tests-generator

  • SKILL.md48.0 KB

Overview

This skill generates complete OpenHarmony pixel-level graphic test code and templates for AI assistants to produce RSGraphicTest cases. It provides a full framework reference, API summary, test macros, lifecycle flow, and ready-to-use code templates. The output focuses on creating reproducible tests that run in the Rosen rendering environment and save verification screenshots.

How this skill works

The generator inspects test intent and emits a test class that follows the RSGraphicTest lifecycle: SetUpTestCase, SetUp, test body (node creation, drawing, transaction flush), TearDown, and TearDownTestCase. It produces macro-wrapped test declarations, surface/node registration calls, recording/drawing code, and automatic screenshot save paths. It also outputs configuration flags and recommended command-line parameters to filter and run tests in AUTOMATIC, MANUAL, DYNAMIC, or multi-grid modes.

When to use it

  • When you need pixel-accurate verification of OpenHarmony rendering results.
  • When converting a visual requirement or design spec into an automated graphic test case.
  • When building a library of repeatable drawing tests or templates for teams.
  • When validating GPU/backend rendering changes across versions.
  • When you require automatic screenshot capture and organized image outputs for CI.

Best practices

  • Always call RegisterNode() for every created node to keep references and avoid premature release.
  • FlushImplicitTransaction() after node updates, drawing completion, or animation start to ensure the server receives commands.
  • Use GRID (GRAPHIC_TESTS) mode for batching many small visual tests into a single virtual screen layout.
  • Set appropriate wait times (testCaseWaitTime, normalWaitTime, surfaceCaptureWaitTime) to allow the render pipeline to finish before capture.
  • Group related assertions by saving screenshots to predictable paths: /data/local/graphic_test/<category>/<TestCase>_<TestName>.png.

Example use cases

  • Generate an AUTOMATIC drawing test that creates an RSCanvasNode, records drawing commands, flushes the transaction, and saves a screenshot for CI regression checks.
  • Create a MANUAL test template that exposes a controlled capture point for interactive debugging or visual approval.
  • Produce a DYNAMIC test scaffold that records replayable drawing sequences for animation verification.
  • Batch 12 related thumbnail tests into a 4x3 GRID using GRAPHIC_TESTS, placing each Surface in the virtual grid and capturing the composite image.

FAQ

Always call RegisterNode(node) which stores a shared_ptr in the test runner and registers the node to the root so it remains alive until cleanup.

When should I call FlushImplicitTransaction()?

Call it after any node property change, after recording drawing commands, and when starting animations so the client sends IPC to the render service to trigger rendering and screenshot capture.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
oh-graphic-pixel-tests-generator skill by openharmonyinsight/openharmony-skills | VeilStrat