跳到正文
cccskills
免费在 GitHub 公开

e2e

End-to-end tests of a game with Playwright (apps/*/e2e/*.e2e.ts) on a WebGL canvas, and taking screenshots of the running game. Load before writing or debugging an e2e test, or to look at the game in a browser.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript星标 35(GitHub 35 + cccskills 0)
集成工具Playwright

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md2.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

e2e on a canvas

apps/game/e2e/playwright.config.ts: Chromium, webServer = vp preview (port 8081) on the build. So: vp -C apps/game build && vp -C apps/game run e2e (the ready script does both). Results and traces: .local/test-results/ (gitignored). Chromium once per machine: vp -C apps/game exec playwright install chromium (CI: --with-deps).

No false green

A canvas has no DOM to query: "the canvas is visible" passes on a black screen. Assert on pixels, and prove the test can fail:

  • Compare page.screenshot({ clip }) buffers. game.e2e.ts: the center square differs from a background-only corner (the hero is drawn), then after holding ArrowRight it equals it (the hero left). Wait with expect.poll, never a fixed delay before the first assertion.
  • Collect pageerror and console errors for the whole test; assert [] at the end.
  • After writing a test, break the game on purpose (e.g. speed 0), rebuild, see it fail, revert.

Traps

SymptomCauseFix
Lint no-conditional-in-test on an if in a page.on handlerany condition inside test()a module-level helper (collectErrors(page))
require-await on expect.poll(async () => helper())the arrow only returns a promiseexpect.poll(() => helper())
The test sees the old gamee2e runs on dist/, not the dev servervp -C apps/game build first
Port 8081 is already in usea vp preview left running (locally reuseExistingServer)stop it by PID, skill vp ("Dev server under WSL")
"BEWARE: your OS is not officially supported by Playwright"WSL distro newer than Playwright's listharmless: the ubuntu24.04 build runs

Just looking at the game

Take a screenshot to see a visual change: a one-off test in e2e/ that calls page.screenshot({ path: "../../.local/screenshots/x.png" }), run it, read the PNG, delete the test.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

add-game

免费

Add a second game to the monorepo (apps/<game>) from the seed game, wired to the gate. Load when asked to create a new game / app / prototype in this repo.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

game

免费

How a game of this seed is organized (apps/<game>/src) and how to add gameplay with PixiJS v8 without breaking the strict gate. Load before editing apps/*/src or apps/*/tests.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

pixijs

免费

Use this skill first for ANY PixiJS v8 task; it routes to the right specialized skill for the job. Covers the full PixiJS surface: Application setup, the scene graph (Container, Sprite, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite), rendering (WebGL/WebGPU/Canvas, render loop, custom shaders, filters, blend modes), assets, events, color, math, ticker, accessibility, performance, environments, migration from v7, and project scaffolding. Triggers on: pixi, pixi.js, pixijs, PixiJS, v8, Application, app.init, Sprite, Container, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite, Assets, Ticker, renderer, WebGL, WebGPU, scene graph, filter, shader, blend mode, texture, BitmapText, create-pixi, how do I draw, how do I render, how do I animate in pixi.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

Use this skill when adding screen reader and keyboard navigation to PixiJS v8 apps. Covers AccessibilitySystem options (enabledByDefault, debug, activateOnTab, deactivateOnMouseMove), per-container accessibility properties, shadow DOM overlay, mobile touch-hook activation. Triggers on: accessibility, a11y, screen reader, ARIA, keyboard navigation, tab order, AccessibilitySystem, accessibleTitle, accessibleHint, tabIndex, accessibleChildren.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

Use this skill when creating and configuring a PixiJS v8 Application. Covers new Application() + async app.init() options (width, height, background, antialias, resolution, autoDensity, preference, resizeTo, autoStart, sharedTicker, canvas, useBackBuffer, powerPreference, eventFeatures, accessibilityOptions, gcActive, bezierSmoothness, webgl/webgpu/canvasOptions per-renderer overrides), app.stage/renderer/canvas/screen/domContainerRoot access, ResizePlugin, TickerPlugin, CullerPlugin (cullable, cullArea), custom ApplicationPlugin via ExtensionType.Application, start/stop lifecycle, and app.destroy() with releaseGlobalResources. Triggers on: Application, app.init, app.stage, app.renderer, app.canvas, app.screen, app.domContainerRoot, ApplicationOptions, ApplicationPlugin, ExtensionType.Application, resizeTo, sharedTicker, skipExtensionImports, preferWebGLVersion, preserveDrawingBuffer, cullable, CullerPlugin, app.start, app.stop, app.destroy, releaseGlobalResources.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

Use this skill when loading and managing resources in PixiJS v8. Covers Assets.init, Assets.load/add/unload, bundles, manifests, background loading, onProgress, caching, spritesheets, video textures, web fonts, bitmap fonts, animated GIFs, compressed textures, SVG as texture or Graphics, resolution detection, per-asset data options, and forcing a specific loader with the parser field (for extension-less URLs). Triggers on: Assets, Assets.load, Assets.init, loadBundle, manifest, backgroundLoad, Spritesheet, Cache, LoadOptions, unload, parser, loadParser, loadWebFont, loadBitmapFont, loadVideoTextures, GifSource, VideoSourceOptions.

中文简介正在准备中。当前显示原文说明。

ltruchot/seed-pixi-typescript352026年9月24日 更新

查看 ltruchot 的全部技能

报告此技能的问题