end to end app store screenshot creation using AI
TypeScript agentic-aiappleappstoreautomateclaudecursordesigngenerateiosios-appmarketingscreenshotskillsskills-shswiftswiftuiui
test: add Tester Army editor flows and fix undo and selection regressions
Parth Jadhavfeb5a7e35534
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlnew file mode 100644index 0000000..52a483c--- /dev/null+++ b/.github/workflows/e2e.yml@@ -0,0 +1,34 @@+name: Editor verification+on:+ pull_request:+ push:+ branches: [main]+permissions:+ contents: read+jobs:+ chrome:+ runs-on: ubuntu-latest+ defaults:+ run:+ working-directory: skills/app-store-screenshots/template+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: 24+ - uses: oven-sh/setup-bun@v2+ with:+ bun-version: 1.3.9+ - run: bun install --frozen-lockfile+ - run: npx playwright install chrome --with-deps+ - run: bun run typecheck+ - run: bun run build+ - run: bun run test:e2e+ - run: SCREENSHOTS_E2E_PRODUCTION=1 bun run test:e2e+ - uses: actions/upload-artifact@v4+ if: always()+ with:+ name: editor-e2e+ path: skills/app-store-screenshots/template/.e2e/+ include-hidden-files: true+ retention-days: 7diff --git a/.gitignore b/.gitignoreindex cabe2fa..977d43a 100644--- a/.gitignore+++ b/.gitignore@@ -56,3 +56,6 @@ skills/app-store-screenshots/template/public/screenshots/uploaded/*.tmp*.temp.cache/++# Tester Army reports and recordings+.e2e/diff --git a/BUG_BASH.md b/BUG_BASH.mdindex 0acff5e..9a9a9f9 100644--- a/BUG_BASH.md+++ b/BUG_BASH.md@@ -37,3 +37,11 @@ Covered the editor UI, canvas interactions, persistence, uploads, exports, local## Scope limitsThis is a broad regression pass, not proof that every possible failure is eliminated. Browser coverage is Google Chrome; touch checks use Chrome emulation. The local API still assumes one server process. CLI callers that omit `If-Match` retain unconditional replacement behavior. Font API validation checks container structure; full font decoding is additionally checked by the editor's browser.++## Tester Army follow-up — 2026-10-03++The canonical editor template now ships Tester Army configuration, 23 direct browser/API tests, three wrappers for the existing 56 regression groups, and Chrome CI in each scaffold. Final dev and production runs each passed all 26 selected tests with no skips or retries.++Fixed three additional issues: Undo after a rapid screen add could erase the preceding copy edit, reordering the initially selected screen could silently change the inspector selection, and cold dev page compilation after API-only traffic crashed on the Tailwind config's CommonJS `require`. Updated Next 16.3.6 to the 16.3.8 security release and validated build/type compatibility. The config failure was independently reported by Luna, reproduced in an isolated server, and repaired with a static ESM import; its root API harness then passed all nine groups.++See [the current flow matrix and evidence](skills/app-store-screenshots/template/docs/testing/e2e.md) for exact commands, counts, retained red/green reports and verification limits.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 733918f..1bcc447 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -39,17 +39,20 @@ Usually not a fit:## Testing Changes-The editor regression harness is `scripts/bug-bash.cjs`. Run it against a **disposable copy** of the template with its dev server running. It uses Google Chrome, mocks project state for browser checks, and checks the real project API rejects malformed writes. It covers editor keyboard controls, history, delayed saves/uploads, export sizes/locales, missing assets, connected crops, and feature graphics.+The canonical product is `skills/app-store-screenshots/template`, which ships the editor and its verification suite. Start with:```bash-PLAYWRIGHT_MODULE=/absolute/path/to/playwright node scripts/bug-bash.cjs http://localhost:3098-PLAYWRIGHT_MODULE=/absolute/path/to/playwright node scripts/ui-bug-bash.cjs http://localhost:3098-node scripts/api-bug-bash.cjs http://localhost:3098+cd skills/app-store-screenshots/template+bun install --frozen-lockfile+bun run typecheck+bun run build+bun run test:e2e+SCREENSHOTS_E2E_PRODUCTION=1 bun run test:e2e```-Use an existing Playwright installation or install it outside the repo for this harness. Also run `tsc --noEmit` and the production build in the template. Use the manual checklist below for skill/scaffolding changes.+The Tester Army configuration launches a disposable template copy and uses installed Google Chrome. Every scaffold contains the same configuration, tests, legacy regression harnesses and CI workflow. Read [the flow matrix](skills/app-store-screenshots/template/docs/testing/e2e.md) for exact coverage and residual gaps.-The API harness checks validation, same-origin writes, concurrent save conflicts, bounded request bodies, and real PNG/JPEG/WOFF2 uploads. Run the harnesses sequentially: the API and export harnesses write the disposable server's project file. The browser harness also covers failed-save recovery, corrupt assets, stalled workers, and narrow screens. The UI harness exercises pointer drag/resize, rotation, layers, keyboard reordering, empty states, themes/fonts, touch controls, responsive layouts, and every device/layout combination. Set `BUG_BASH_FILTER` to run a single browser check by name. Repeat the API and upload/export checks against `next start` to catch production-only asset-serving failures.+The original `scripts/{bug-bash,ui-bug-bash,api-bug-bash}.cjs` commands remain compatibility entry points. Only run them against a disposable editor server; they write its project and upload assets. The API and export harnesses must run sequentially. Set `BUG_BASH_FILTER` for one browser check.### For README-only changesdiff --git a/scripts/api-bug-bash.cjs b/scripts/api-bug-bash.cjsindex 062276c..aecc066 100644--- a/scripts/api-bug-bash.cjs+++ b/scripts/api-bug-bash.cjs@@ -1,137 +1,2 @@-// Run only against a disposable template copy; this writes projects and assets.-// node scripts/api-bug-bash.cjs http://localhost:3098-const assert = require('node:assert/strict');-const sharp = require('../skills/app-store-screenshots/template/node_modules/sharp');-const fs = require('node:fs/promises');-const os = require('node:os');-const path = require('node:path');-const {execFileSync} = require('node:child_process');-const {randomBytes} = require('node:crypto');-const base = process.argv[2] || 'http://localhost:3098';-const projectURL = base + '/api/project';-const post = (route, data, headers = {}) => fetch(base + route, {- method: 'POST', headers: {'content-type': 'application/json', ...headers}, body: JSON.stringify(data),-});-let passed = 0;-async function check(name, run) { await run(); console.log('PASS', name); passed++; }-(async () => {- const initial = await fetch(projectURL);- assert.equal(initial.status, 200);- const {state: original} = await initial.json();- assert.ok(original, 'Start with a disposable template project');- try {- await check('invalid project shapes are rejected without replacing the file', async () => {- const slide = {id:'a', layout:'no-device', screenshot:'', label:{en:'Test'}, headline:{en:'Test'}};- const rect = {x:0,y:0,width:10,height:10};- const invalid = [null, [], {}, {...original,schemaVersion:999}, {...original,connectedCanvas:'false'},- {...original,slidesByDevice:{typo:[]}}, {...original,locales:['en','en']},- ...[{headline:{en:[]}}, {transforms:{caption:{...rect,width:-1}}}, {textElements:[null]},- {imageElements:[{id:'x',src:'a',transform:rect},{id:'x',src:'b',transform:rect}]}]- .map(patch => ({...original, slidesByDevice:{watchos:[{...slide,...patch}]}}))];- for (const state of invalid) assert.equal((await post('/api/project',state)).status,400);- assert.deepEqual((await (await fetch(projectURL)).json()).state, original);- });- await check('every write route requires exact JSON content type and same origin', async () => {- for (const route of ['/api/project','/api/upload','/api/upload-font']) {- for (const type of ['text/plain','application/json-invalid']) assert.equal((await post(route,{}, {'content-type':type})).status,415);- for (const origin of ['null','https://evil.example','http://localhost:9999']) assert.equal((await post(route,{}, {origin})).status,403);- assert.equal((await post(route,{}, {'sec-fetch-site':'cross-site'})).status,403);- }- for (const host of ['localhost','127.0.0.1']) {- const url = new URL(projectURL); url.hostname = host;- const response = await fetch(url, {method:'POST',headers:{'content-type':'application/json',origin:url.origin,'sec-fetch-site':'same-origin'},body:JSON.stringify(original)});- assert.equal(response.status,200,host);- }- });- await check('concurrent stale project writes conflict and preserve the winning state', async () => {- const revision = (await fetch(projectURL)).headers.get('etag');- assert.ok(revision);- const candidates = ['tab A','tab B'].map(appName=>({...original,appName}));- const responses = await Promise.all(candidates.map(data=>post('/api/project',data,{'if-match':revision})));- assert.deepEqual(responses.map(r=>r.status).sort(),[200,412]);- const winning = responses.findIndex(r=>r.status===200);- const current = await fetch(projectURL);- assert.deepEqual((await current.json()).state,candidates[winning]);- assert.equal(current.headers.get('etag'),responses[winning].headers.get('etag'));- assert.equal((await post('/api/project',original,{'if-match':revision})).status,412);- assert.equal((await post('/api/project',original,{'if-match':current.headers.get('etag')})).status,200);- });- await check('truncated, forged, malformed base64 and wrong-type uploads are rejected', async () => {- for (const data of [null, {}, {dataUrl:'data:image/png;base64,iVBORw0KGgo='}, {dataUrl:'data:image/jpeg;base64,/9j/'},- {dataUrl:'data:image/png;base64,iVBORw0K!Ggo='}, {dataUrl:'data:text/html;base64,SGk='}]) {- assert.equal((await post('/api/upload',data)).status,400);- }- for (const data of [null,{}, {data:'d09GMg=='},{data:'T1RUTw=='},{data:'AAEAAA=='},{data:'d09GRg=='}]) {- assert.equal((await post('/api/upload-font',data)).status,400);- }- });- await check('real PNG/JPEG uploads round-trip; identical concurrent uploads stay intact', async () => {- for (const format of ['png','jpeg']) {- // Always a new hash, so restarting next start cannot mask missing- // runtime asset serving by indexing files from a previous test run.- const bytes = await sharp({create:{width:24,height:30,channels:3,background:'#'+randomBytes(3).toString('hex')}})[format]().toBuffer();- const responses = await Promise.all(Array.from({length:4},()=>post('/api/upload',{dataUrl:`data:image/${format};base64,${bytes.toString('base64')}`})));- let path;- for (const response of responses) {- assert.equal(response.status,200); const result = await response.json();- if (path) assert.equal(result.path,path); path = result.path;- const saved = await fetch(base+path); assert.equal(saved.status,200);- assert.deepEqual(Buffer.from(await saved.arrayBuffer()),bytes);- }- assert.equal((await post('/api/upload',{dataUrl:`data:image/${format==='png'?'jpeg':'png'};base64,${bytes.toString('base64')}`})).status,400);- }- });- await check('oversized request bodies are rejected including chunked bodies', async () => {- const chunk = new Uint8Array(1024*1024).fill(32);- const response = await fetch(base+'/api/upload',{method:'POST',headers:{'content-type':'application/json'},duplex:'half',- body:new ReadableStream({start(controller){for(let i=0;i<13;i++)controller.enqueue(chunk);controller.close();}})});- assert.equal(response.status,413);- });- await check('valid WOFF2 uploads persist and truncated copies are rejected', async () => {- const html = await (await fetch(base)).text();- const fontPath = html.match(/\/_next\/static\/media\/[^"\s<>]+\.woff2/)?.[0];- assert.ok(fontPath,'Expected bundled Next font');- const bytes = Buffer.from(await (await fetch(base+fontPath)).arrayBuffer());- // WOFF2's header version is metadata, independent of the glyph stream.- randomBytes(4).copy(bytes,24);- const response = await post('/api/upload-font',{data:bytes.toString('base64')});- assert.equal(response.status,200); const {font}=await response.json();- assert.equal(font.format,'woff2');- assert.deepEqual(Buffer.from(await (await fetch(base+font.src)).arrayBuffer()),bytes);- assert.equal((await post('/api/upload-font',{data:bytes.subarray(0,64).toString('base64')})).status,400);- });- await check('runtime asset routes reject missing files and traversal paths', async () => {- for (const prefix of ['/screenshots/uploaded/','/fonts/imported/']) {- for (const name of ['not-a-hash.png','0000000000000000.woff2','..%2f..%2fapp-store-screenshots.json']) {- assert.ok([400,404].includes((await fetch(base+prefix+name)).status));- }- }- });- await check('documented migration handles null overlays and duplicate element IDs', async () => {- const skill = await fs.readFile(path.join(__dirname,'../skills/app-store-screenshots/SKILL.md'),'utf8');- const source = skill.match(/BACKUP_DIR="\$BACKUP_DIR" node <<'NODE'\n([\s\S]*?)\nNODE/)[1];- const temporary = await fs.mkdtemp(path.join(os.tmpdir(),'screenshot-migration-'));- const transform = {x:10,y:20,width:0,height:40};- try {- const old = {...original, schemaVersion:1, connectedCanvas:undefined, slidesByDevice:{watchos:[{- id:'legacy', layout:'hero', label:'Label', headline:'Old headline', screenshot:'/old.png',- textElements:[null,{id:'same',text:'Hello',transform},{id:'same',text:{en:'Copy',de:42},transform,fontSize:-3}],- imageElements:[null,{id:'same',src:'/a.png',transform},{id:'same',src:'/b.png',transform}],- }]}};- await fs.writeFile(path.join(temporary,'app-store-screenshots.json'),JSON.stringify(old));- execFileSync(process.execPath,['-e',source],{cwd:temporary,env:{...process.env,BACKUP_DIR:temporary}});- const migrated=JSON.parse(await fs.readFile(path.join(temporary,'app-store-screenshots.json'),'utf8'));- assert.equal(migrated.connectedCanvas,false);assert.equal(migrated.schemaVersion,2);- const slide=migrated.slidesByDevice.watchos[0];- assert.deepEqual(slide.headline,{en:'Old headline'});assert.equal(slide.screenshot,'/old.png');- assert.equal(slide.textElements.length,2);assert.equal(slide.imageElements.length,2);- assert.equal(new Set(slide.textElements.map(e=>e.id)).size,2);- assert.equal(new Set(slide.imageElements.map(e=>e.id)).size,2);- assert.equal((await post('/api/project',migrated)).status,200);- } finally { await fs.rm(temporary,{recursive:true,force:true}); }- });- console.log(`${passed} API regression groups passed.`);- } finally {- assert.equal((await post('/api/project',original)).status,200,'Could not restore disposable project');- }-})().catch(error=>{console.error(error);process.exitCode=1;});+// Compatibility entry point; the harness ships with every scaffold.+require("../skills/app-store-screenshots/template/tests/harness/api-bug-bash.cjs");diff --git a/scripts/bug-bash.cjs b/scripts/bug-bash.cjsindex 30fbf6b..668979a 100644--- a/scripts/bug-bash.cjs+++ b/scripts/bug-bash.cjs@@ -1,467 +1,2 @@-// Run against a disposable copy: this exercises uploads and /api/project.-// PLAYWRIGHT_MODULE=/path/to/playwright node scripts/bug-bash.cjs http://localhost:3098-const assert = require('node:assert/strict');-const fs = require('node:fs/promises');-const { chromium } = require(process.env.PLAYWRIGHT_MODULE || 'playwright');-const baseURL = process.argv[2] || 'http://localhost:3098';-const pause = ms => new Promise(resolve => setTimeout(resolve, ms));-const slide = (id, extra = {}) => ({ id, layout: 'no-device', label: {en: 'LABEL'}, headline: {en: id}, screenshot: '', ...extra });-const fixture = (extra = {}) => ({schemaVersion:2,appName:'Bug bash',themeId:'clean-light',connectedCanvas:true,locales:['en'],locale:'en',device:'watchos',orientation:'portrait',slidesByDevice:{watchos:[slide('first'),slide('second')],android:[slide('android')],iphone:[slide('iphone')]},...extra});-(async () => {- const browser = await chromium.launch({channel:'chrome', headless:true});- const errors = [];- async function open(state=fixture(), save) {- const page = await browser.newPage({viewport:{width:1600,height:1000}});- let latest=structuredClone(state);- page.on('pageerror', error=>errors.push(error.message));- await page.route('**/api/project',async route=>{- if(route.request().method()==='POST') {- const data=route.request().postDataJSON();- if(save) await save(data);- latest=data;- }- await route.fulfill({json:{ok:true,state:latest}});- });- await page.goto(baseURL);- await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- return {page, latest:()=>latest};- }- let passed=0;- async function check(name, run) {- if(process.env.BUG_BASH_FILTER && !name.includes(process.env.BUG_BASH_FILTER)) return;- await run(); passed++; console.log('PASS',name);- }- try {- await check('menu arrows do not navigate slides',async()=>{- const {page}=await open();- await page.getByRole('combobox',{name:'Theme',exact:true}).click();- await page.keyboard.press('ArrowDown');- assert.match(await page.locator('main').innerText(),/Screen 1/);- await page.keyboard.press('Escape'); await page.close();- });- await check('duplicate selects copy; undo and redo preserve edits',async()=>{- const {page}=await open();- await page.getByRole('button',{name:'Duplicate screen 1',exact:true}).click();- assert.match(await page.locator('main').innerText(),/Screen 2/);- await page.getByRole('button',{name:'Undo',exact:true}).click();- assert.equal(await page.getByRole('button',{name:/^Delete screen/}).count(),2);- await page.getByRole('button',{name:'Redo',exact:true}).click();- assert.equal(await page.getByRole('button',{name:/^Delete screen/}).count(),3);- await page.close();- });- await check('rapid edits on different decks have separate undo steps',async()=>{- const {page}=await open();- await page.locator('textarea').first().fill('watch changed');- await page.getByRole('tab',{name:'Android',exact:true}).click();- await page.locator('textarea').first().fill('android changed');- await page.getByRole('button',{name:'Undo',exact:true}).click();- assert.equal(await page.locator('textarea').first().inputValue(),'android');- await page.getByRole('button',{name:'Undo',exact:true}).click();- assert.equal(await page.locator('textarea').first().inputValue(),'first');- await page.close();- });- await check('editing does not reset a manually panned canvas',async()=>{- const {page}=await open();- const scroller=page.locator('main .overflow-auto');- await scroller.evaluate(el=>el.scrollTo({left:300,behavior:'instant'}));- const before=await scroller.evaluate(el=>el.scrollLeft);- assert.ok(before>0);- await page.locator('textarea').first().fill('edited while panned');- await pause(400);- assert.equal(await scroller.evaluate(el=>el.scrollLeft),before);- await page.close();- });- await check('slow autosaves never overlap or overwrite newer state',async()=>{- let active=0,maxActive=0; const completed=[];- const {page,latest}=await open(fixture(),async data=>{- maxActive=Math.max(maxActive,++active);- await pause(data.appName==='older'?1800:50);- completed.push(data.appName); active--;- });- await pause(800);- await page.getByRole('textbox',{name:'App name',exact:true}).fill('older');- await pause(800);- await page.getByRole('textbox',{name:'App name',exact:true}).fill('newer');- await pause(2600);- assert.equal(maxActive,1); assert.equal(latest().appName,'newer');- assert.equal(completed.at(-1),'newer'); await page.close();- });- await check('export locks immediately and through completion, PNG dimensions/locales are correct',async()=>{- const {page}=await open(fixture({locales:['en','de']}));- let downloadCount=0; page.on('download',()=>downloadCount++);- const downloaded=page.waitForEvent('download');- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- assert.equal(await page.locator('main').evaluate(el=>!!el.closest('[inert]')),true);- assert.equal(await page.getByRole('textbox',{name:'App name',exact:true}).isDisabled(),true);- const download=await downloaded; const file=await download.path();- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- const zip=await JSZip.loadAsync(await fs.readFile(file));- const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));- assert.equal(pngs.length,24);- for(const png of pngs) {- const bytes=await png.async('nodebuffer'); const [,w,h]=png.name.match(/\/(\d+)x(\d+)\//);- assert.equal(bytes.readUInt32BE(16),Number(w)); assert.equal(bytes.readUInt32BE(20),Number(h));- assert.equal(bytes[25],2,'stores need opaque 24-bit RGB PNGs, not RGBA');- }- await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- assert.equal(await page.locator('[inert]').count(),0); assert.equal(downloadCount,1); await page.close();- });- await check('missing referenced image blocks export and recovers controls',async()=>{- const {page}=await open(fixture({slidesByDevice:{watchos:[slide('broken',{layout:'hero',screenshot:'/missing-bugbash.png'})]}}));- let downloads=0;page.on('download',()=>downloads++);- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- await page.getByText('Export failed',{exact:true}).waitFor();- assert.match(await page.locator('body').innerText(),/Images could not be loaded/);- assert.equal(downloads,0); assert.equal(await page.locator('[inert]').count(),0); await page.close();- });- await check('latest upload wins; clear cancels pending replacement',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero'})]}}));- const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=10;c.height=10;const x=c.getContext('2d');x.fillStyle='red';x.fillRect(0,0,10,10);return c.toDataURL().split(',')[1]});- let count=0;- await page.route('**/api/upload',async route=>{const n=++count;await pause(n===1?1200:100);await route.fulfill({json:{ok:true,path:`/upload-${n}.png`}})});- const input=page.locator('input[type=file]').last();- await input.setInputFiles({name:'first.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- await pause(150);- await input.setInputFiles({name:'second.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- await pause(1800);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'/upload-2.png');- await input.setInputFiles({name:'third.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- await page.getByRole('button',{name:'Clear screenshot',exact:true}).click();- await pause(850);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'');await page.close();- });- await check('feature graphic background, contrast, and selection match inspector',async()=>{- const {page}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('banner one',{layout:'feature-graphic'}),slide('banner two',{layout:'feature-graphic'})]}}));- const inspector=page.locator('aside').last();- await inspector.getByRole('combobox').nth(1).click();- await page.getByRole('option',{name:'Custom color',exact:true}).click();- await page.getByRole('textbox',{name:'Custom background hex color',exact:true}).fill('#FFFFFF');- const caption=page.locator('main [contenteditable=plaintext-only]').first();- assert.equal(await caption.evaluate(el=>getComputedStyle(el).color),'rgb(23, 23, 23)');- assert.equal(await caption.evaluate(el=>getComputedStyle(el.parentElement.parentElement.parentElement).backgroundColor),'rgb(255, 255, 255)');- await page.locator('main [contenteditable=plaintext-only]').nth(1).focus();- assert.match(await page.locator('main').innerText(),/Screen 2/);- assert.equal(await page.locator('textarea').first().inputValue(),'banner two');- await page.close();- });- await check('connected overlays split across PNG crops; isolated mode clips them',async()=>{- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- for(const connectedCanvas of [true,false]) {- const {page}=await open(fixture({connectedCanvas}));- const src=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=10;c.height=10;const ctx=c.getContext('2d');ctx.fillStyle='#ff0000';ctx.fillRect(0,0,10,10);return c.toDataURL()});- await page.close();- const probe=await open(fixture({connectedCanvas,slidesByDevice:{watchos:[slide('left',{label:{},headline:{},imageElements:[{id:'cross',src,transform:{x:350,y:220,width:144,height:80,zIndex:10}}]}),slide('right',{label:{},headline:{}})]}}));- const download=probe.page.waitForEvent('download');- await probe.page.getByRole('button',{name:'Export bundle',exact:true}).click();- const file=await (await download).path();const zip=await JSZip.loadAsync(await fs.readFile(file));- const image=await zip.file('ios/watchos/422x514/en/02-no-device.png').async('base64');- const pixel=await probe.page.evaluate(async data=>{const img=new Image();img.src='data:image/png;base64,'+data;await img.decode();const c=document.createElement('canvas');c.width=422;c.height=514;const ctx=c.getContext('2d');ctx.drawImage(img,0,0);return Array.from(ctx.getImageData(25,250,1,1).data)},image);- assert.equal(pixel[0]===255&&pixel[1]===0&&pixel[2]===0,connectedCanvas);- await probe.page.close();- }- });- await check('every device exports real images at its advertised sizes',async()=>{- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- const devices=['iphone','ipad','tvos','watchos','carplay','mac','android','android-7','android-10','feature-graphic'];- for(const device of devices) {- const bootstrap=await open();- const src=await bootstrap.page.evaluate(()=>{const c=document.createElement('canvas');c.width=200;c.height=400;const x=c.getContext('2d');x.fillStyle='#ff00ff';x.fillRect(0,0,200,400);return c.toDataURL()});- await bootstrap.page.close();- const {page}=await open(fixture({device,appIcon:src,slidesByDevice:{[device]:[slide('device',{layout:device==='feature-graphic'?'feature-graphic':'hero',screenshot:src})]}}));- const downloaded=page.waitForEvent('download');- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- const file=await (await downloaded).path();const zip=await JSZip.loadAsync(await fs.readFile(file));- const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));- const expected={iphone:4,ipad:2,tvos:2,watchos:6,carplay:4,mac:4,android:1,'android-7':1,'android-10':1,'feature-graphic':1};- assert.equal(pngs.length,expected[device],device);- for(const png of pngs) {- const bytes=await png.async('nodebuffer');const [,w,h]=png.name.match(/\/(\d+)x(\d+)\//);- assert.equal(bytes.readUInt32BE(16),Number(w));assert.equal(bytes.readUInt32BE(20),Number(h));- }- const pixels=await page.evaluate(async data=>{const image=new Image();image.src='data:image/png;base64,'+data;await image.decode();const c=document.createElement('canvas');c.width=50;c.height=50;const x=c.getContext('2d');x.drawImage(image,0,0,50,50);const p=x.getImageData(0,0,50,50).data;let n=0;for(let i=0;i<p.length;i+=4)if(p[i]>230&&p[i+1]<30&&p[i+2]>230)n++;return n},await pngs[0].async('base64'));- assert.ok(pixels>5,`${device}: screenshot missing from rendered PNG`);- await page.close();- }- });- await check('malformed generated project does not crash or autosave over disk',async()=>{- let writes=0;- const {page}=await open(fixture({locales:'en'}),async()=>{writes++});- await page.getByText('save failed',{exact:false}).waitFor();- await pause(800); assert.equal(writes,0); await page.close();- });- await check('project API rejects invalid data without overwriting valid state',async()=>{- const context=await browser.newContext();const request=context.request;- const original=await request.get(baseURL+'/api/project'); const payload=await original.json();- assert.equal(original.status(),200);- for(const body of [null,[],{},fixture({device:'bad'}),fixture({slidesByDevice:{watchos:[null]}})]) {- const response=await request.post(baseURL+'/api/project',{data:JSON.stringify(body),headers:{'content-type':'application/json'}});- assert.equal(response.status(),400);- }- const after=await request.get(baseURL+'/api/project');assert.deepEqual((await after.json()).state,payload.state);- const saved=await request.post(baseURL+'/api/project',{data:payload.state});assert.equal(saved.status(),200);- const roundTrip=await request.get(baseURL+'/api/project');assert.deepEqual((await roundTrip.json()).state,payload.state);- await context.close();- });- await check('out-of-bounds elements export where the editor shows them',async()=>{- const {page}=await open(fixture({connectedCanvas:false,slidesByDevice:{watchos:[slide('a',{textElements:[{id:'t1',text:{en:'WIDE'},transform:{x:300,y:10,width:300,height:80,zIndex:6}}]})]}}));- const editorX=await page.locator('main .rnd-editable').last().evaluate(el=>new DOMMatrix(getComputedStyle(el).transform).m41);- const exportX=await page.locator('[aria-hidden] [contenteditable=false]').filter({hasText:'WIDE'}).last().evaluate(el=>parseFloat(el.closest('div[style*="z-index"]').style.left));- assert.equal(exportX,editorX); await page.close();- });- await check('clearing inline copy saves nothing and shows the fallback after blur',async()=>{- const {page,latest}=await open(fixture({locales:['en','de'],locale:'de',slidesByDevice:{watchos:[slide('a',{headline:{en:'English',de:'Deutsch'}})]}}));- const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);- await headline.click(); await page.keyboard.press('ControlOrMeta+A'); await page.keyboard.press('Backspace');- await page.locator('textarea').first().click(); await pause(900);- assert.equal(latest().slidesByDevice.watchos[0].headline.de,undefined);- assert.equal(await headline.textContent(),'English'); await page.close();- });- await check('overlay text can be cleared and retyped in a non-default locale',async()=>{- const {page,latest}=await open(fixture({locales:['en','de'],locale:'de',slidesByDevice:{watchos:[slide('a',{textElements:[{id:'t1',text:{en:'Hello'},transform:{x:10,y:10,width:300,height:80,zIndex:6}}]})]}}));- await page.locator('main [contenteditable=plaintext-only]').nth(2).focus();- const text=page.getByRole('textbox',{name:'Overlay text',exact:true});- assert.equal(await text.inputValue(),''); assert.equal(await text.getAttribute('placeholder'),'Hello');- await text.fill('Hallo'); await pause(900);- assert.deepEqual(latest().slidesByDevice.watchos[0].textElements[0].text,{en:'Hello',de:'Hallo'}); await page.close();- });- await check('RTL copy gets its own base direction',async()=>{- const {page}=await open(fixture({locales:['en','he'],locale:'he',slidesByDevice:{watchos:[slide('a',{headline:{en:'Hi',he:'שלום עולם!'}})]}}));- const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);- assert.equal(await headline.evaluate(el=>getComputedStyle(el).direction),'rtl');- assert.equal(await page.locator('main [contenteditable=plaintext-only]').first().evaluate(el=>getComputedStyle(el).direction),'ltr'); await page.close();- });- await check('generated feature-graphic decks normalise without an undo step',async()=>{- const {page,latest}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('one',{layout:'hero'}),slide('two',{layout:'hero'})]}}));- await pause(1000);- assert.equal(await page.getByRole('button',{name:'Undo',exact:true}).isEnabled(),false);- assert.deepEqual(latest().slidesByDevice['feature-graphic'].map(s=>s.layout),['feature-graphic','feature-graphic']); await page.close();- });- await check('feature graphic app icon can be picked and exports',async()=>{- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- const {page,latest}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('banner',{layout:'feature-graphic'})]}}));- const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=64;c.height=64;const x=c.getContext('2d');x.fillStyle='#00ff00';x.fillRect(0,0,64,64);return c.toDataURL().split(',')[1]});- await page.route('**/api/upload',route=>route.fulfill({json:{ok:true,path:'/bugbash-icon.png'}}));- await page.locator('aside').last().locator('input[type=file]').setInputFiles({name:'icon.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- await pause(900); assert.equal(latest().appIcon,'/bugbash-icon.png');- const downloaded=page.waitForEvent('download');- await page.route('**/bugbash-icon.png',route=>route.fulfill({body:Buffer.from(png,'base64'),contentType:'image/png'}));- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));- const image=await Object.values(zip.files).find(f=>f.name.endsWith('.png')).async('base64');- const green=await page.evaluate(async data=>{const img=new Image();img.src='data:image/png;base64,'+data;await img.decode();const c=document.createElement('canvas');c.width=img.width;c.height=img.height;const x=c.getContext('2d');x.drawImage(img,0,0);const p=x.getImageData(0,0,c.width,c.height).data;let n=0;for(let i=0;i<p.length;i+=4)if(p[i]<30&&p[i+1]>225&&p[i+2]<30)n++;return n},image);- assert.ok(green>1000,'icon missing from feature graphic export'); await page.close();- });- await check('reset all devices keeps project settings and locales',async()=>{- const {page,latest}=await open(fixture({appName:'Keep me',themeId:'dark-bold',locales:['en','de'],locale:'de',connectedCanvas:false}));- await page.getByRole('button',{name:/reset/i}).first().click();- await page.getByRole('button',{name:'Reset all devices',exact:true}).click(); await pause(900);- const state=latest();- assert.equal(state.appName,'Keep me'); assert.equal(state.themeId,'dark-bold'); assert.deepEqual(state.locales,['en','de']);- assert.equal(state.locale,'de'); assert.equal(state.connectedCanvas,false); assert.equal(state.device,'watchos');- assert.notEqual(state.slidesByDevice.watchos[0].id,'first'); await page.close();- });- await check('pasted rich text stays plain on the canvas',async()=>{- const context=await browser.newContext({viewport:{width:1600,height:1000}});- await context.grantPermissions(['clipboard-read','clipboard-write'],{origin:new URL(baseURL).origin});- const page=await context.newPage(); let latest=fixture();- page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});- await page.goto(baseURL); await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- await page.evaluate(async()=>navigator.clipboard.write([new ClipboardItem({'text/html':new Blob(['<span style="color:red;font-size:80px">Pasted</span>'],{type:'text/html'}),'text/plain':new Blob(['Pasted'],{type:'text/plain'})})]));- const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);- await headline.click(); await page.keyboard.press('ControlOrMeta+A'); await page.keyboard.press('ControlOrMeta+V'); await pause(900);- assert.equal(await headline.evaluate(el=>el.children.length),0); assert.equal(await headline.textContent(),'Pasted');- assert.equal(latest.slidesByDevice.watchos[0].headline.en,'Pasted'); await context.close();- });- await check('export finishes inline when PNG workers fail to load',async()=>{- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- const context=await browser.newContext({viewport:{width:1600,height:1000}});- // A worker whose script never loads: it reports an error and never replies.- await context.addInitScript(()=>{window.Worker=class extends EventTarget{constructor(){super();setTimeout(()=>this.onerror?.(new ErrorEvent('error',{message:'blocked'})),200)}postMessage(){}terminate(){}}});- const page=await context.newPage(); let latest=fixture();- page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});- await page.goto(baseURL); await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- const downloaded=page.waitForEvent('download',{timeout:60000});- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));- const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));- assert.equal(pngs.length,12);- for(const png of pngs) assert.equal((await png.async('nodebuffer'))[25],2);- await context.close();- });- await check('rejected image uploads keep the previous screenshot instead of bypassing validation',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero',screenshot:'/previous.png'})]}}));- const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=c.height=10;return c.toDataURL().split(',')[1]});- await page.route('**/api/upload',route=>route.fulfill({status:400,json:{ok:false,error:'Rejected image'}}));- await page.locator('input[type=file]').last().setInputFiles({name:'test.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- await page.getByText('Rejected image',{exact:true}).waitFor();- await pause(800); assert.equal(latest().slidesByDevice.watchos[0].screenshot,'/previous.png');- await page.close();- });- await check('corrupt images and fonts are rejected before upload',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero'})]}}));- let uploads=0;- await page.route('**/api/upload*',route=>{uploads++;return route.fulfill({status:400,json:{ok:false}})});- await page.locator('input[type=file]').last().setInputFiles({name:'broken.png',mimeType:'image/png',buffer:Buffer.from('iVBORw0KGgo=','base64')});- await page.getByText('Image is corrupt or exceeds 64 megapixels',{exact:true}).waitFor();- await page.locator('input[type=file]').first().setInputFiles({name:'broken.woff2',mimeType:'font/woff2',buffer:Buffer.from('wOF2')});- await page.getByText('Font import failed',{exact:true}).waitFor();- assert.equal(uploads,0);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'');- assert.equal(await page.getByRole('button',{name:'Export bundle',exact:true}).isEnabled(),true);await page.close();- });- await check('HTTP 200 with corrupt image bytes blocks export',async()=>{- const {page}=await open(fixture({slidesByDevice:{watchos:[slide('corrupt',{layout:'hero',screenshot:'/corrupt.png'})]}}));- await page.route('**/corrupt.png',route=>route.fulfill({contentType:'image/png',body:'not an image'}));- let downloads=0;page.on('download',()=>downloads++);- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- await page.getByText('Export failed',{exact:true}).waitFor();- assert.equal(downloads,0);assert.equal(await page.locator('[inert]').count(),0);await page.close();- });- await check('failed saves can be retried without another edit; dirty edits warn before leaving',async()=>{- const {page}=await open();- await pause(800);- let failing=true,writes=0,latest;- await page.route('**/api/project',async route=>{- writes++;latest=route.request().postDataJSON();- await route.fulfill({status:failing?500:200,json:{ok:!failing,error:failing?'Disk temporarily unavailable':undefined}});- });- await page.getByRole('textbox',{name:'App name',exact:true}).fill('Unsaved work');- const dirty=()=>page.evaluate(()=>{const event=new Event('beforeunload',{cancelable:true});window.dispatchEvent(event);return event.defaultPrevented});- assert.equal(await dirty(),true);- await page.getByRole('button',{name:'Retry save',exact:true}).waitFor();- assert.equal(await dirty(),true); failing=false;- await page.getByRole('button',{name:'Retry save',exact:true}).click();- await pause(900);assert.equal(writes,2);assert.equal(latest.appName,'Unsaved work');assert.equal(await dirty(),false);- await page.close();- });- await check('older in-flight save advances the revision for newer queued edits',async()=>{- const {page}=await open();await pause(800);- const headers=[];let count=0;- await page.route('**/api/project',async route=>{- const n=++count;headers.push(route.request().headers()['if-match']);- if(n===1)await pause(1600);- await route.fulfill({headers:{etag:`"revision-${n}"`},json:{ok:true}});- });- await page.getByRole('textbox',{name:'App name',exact:true}).fill('older');await pause(800);- await page.getByRole('textbox',{name:'App name',exact:true}).fill('newer');await pause(2200);- assert.deepEqual(headers,[undefined,'"revision-1"']);await page.close();- });- await check('two real editor tabs cannot silently overwrite each other',async()=>{- const original=await (await fetch(baseURL+'/api/project')).json();- const save=state=>fetch(baseURL+'/api/project',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(state)});- const pages=[];- try {- assert.equal((await save(fixture())).status,200);- for(let i=0;i<2;i++){- const page=await browser.newPage({viewport:{width:1600,height:1000}});pages.push(page);- page.on('pageerror',error=>errors.push(error.message));- await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();await pause(800);- }- await pages[0].getByRole('textbox',{name:'App name',exact:true}).fill('Winner');await pause(900);- await pages[1].getByRole('textbox',{name:'App name',exact:true}).fill('Keep my edits');- await pages[1].getByText(/Project changed in another tab or on disk/).waitFor();- assert.equal((await (await fetch(baseURL+'/api/project')).json()).state.appName,'Winner');- assert.equal(await pages[1].getByRole('textbox',{name:'App name',exact:true}).inputValue(),'Keep my edits');- } finally {for(const page of pages)await page.close();assert.equal((await save(original.state)).status,200);}- });- await check('silent and throwing PNG workers fall back instead of hanging export',async()=>{- for(const mode of ['silent','throw']) {- const context=await browser.newContext({viewport:{width:1600,height:1000}});- await context.addInitScript(mode=>{window.Worker=class extends EventTarget{postMessage(){if(mode==='throw')throw new Error('cannot post')}terminate(){}}},mode);- const page=await context.newPage();page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state:fixture({slidesByDevice:{watchos:[slide('one')]}})}}));- await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- const downloaded=page.waitForEvent('download',{timeout:45000});- await page.getByRole('button',{name:'Export bundle',exact:true}).click();await downloaded;- await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();assert.equal(await page.locator('[inert]').count(),0);- await context.close();- }- });- await check('a stalled asset cannot keep the editor loading forever',async()=>{- const page=await browser.newPage({viewport:{width:1600,height:1000}});- const state=fixture({slidesByDevice:{watchos:[slide('one',{layout:'hero',screenshot:'/stalled.png'})]}});- page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state}}));- await page.route('**/stalled.png',()=>{});- await page.goto(baseURL,{waitUntil:'domcontentloaded'});- await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor({timeout:20000});- await page.getByText('Image not found at /stalled.png',{exact:true}).waitFor();await page.close();- });- await check('a stalled font load releases export controls with an actionable error',async()=>{- const page=await browser.newPage({viewport:{width:1600,height:1000}});- page.on('pageerror',error=>errors.push(error.message));- await page.addInitScript(()=>{- document.fonts.load=()=>new Promise(()=>{});- const original=window.setTimeout;- window.setTimeout=(fn,delay,...args)=>original(fn,delay===15000?250:delay,...args);- });- const state=fixture({fontId:'self-hosted',importedFont:{src:'/fonts/imported/0123456789abcdef.woff2',format:'woff2'}});- await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state}}));- await page.route('**/fonts/imported/**',route=>route.abort());- await page.goto(baseURL);- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- await page.getByText(/The screenshot font could not be loaded/).waitFor({timeout:5000});- assert.equal(await page.locator('[inert]').count(),0);await page.close();- });- await check('narrow screens retain a usable canvas and scrollable inspector',async()=>{- const {page}=await open();await page.setViewportSize({width:390,height:844});- const main=await page.locator('main').boundingBox();assert.ok(main.height>=360);- assert.equal(await page.locator('main').evaluate(el=>el.parentElement.scrollHeight>el.parentElement.clientHeight),true);- await page.locator('textarea').first().fill('Mobile edit');assert.equal(await page.locator('textarea').first().inputValue(),'Mobile edit');await page.close();- });- await check('encoding failures are handled while a previous screen is still encoding',async()=>{- const context=await browser.newContext({viewport:{width:1600,height:1000}});- await context.addInitScript(()=>{- window.CompressionStream=class{constructor(){throw new Error('encoder unavailable')}};- window.Worker=class extends EventTarget{postMessage({id}){setTimeout(()=>this.onmessage?.({data:{id,error:'worker failed'}}),id<6?2000:0)}terminate(){}};- });- const page=await context.newPage();page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state:fixture()}}));- await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- let downloads=0;page.on('download',()=>downloads++);- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- await page.getByText('All 12 renders failed',{exact:true}).waitFor();- assert.equal(downloads,0);assert.equal(await page.locator('[inert]').count(),0);await context.close();- });- await check('newest font import wins when responses arrive out of order',async()=>{- const {page,latest}=await open();- const fontURL=await page.locator('link[as=font]').first().getAttribute('href');- const fontBytes=await (await page.request.get(baseURL+fontURL)).body();- let count=0;- await page.route('**/api/upload-font',async route=>{const n=++count;await pause(n===1?1200:100);await route.fulfill({json:{ok:true,font:{src:`/fonts/imported/${n}.woff2`,format:'woff2'}}})});- await page.locator('input[type=file]').first().setInputFiles({name:'Older.woff2',mimeType:'font/woff2',buffer:fontBytes});await pause(200);- await page.locator('input[type=file]').first().setInputFiles({name:'Newer.woff2',mimeType:'font/woff2',buffer:fontBytes});await pause(2000);- assert.equal(count,2);assert.equal(latest().importedFont.name,'Newer');assert.equal(latest().importedFont.src,'/fonts/imported/2.woff2');await page.close();- });- await check('real image and font uploads survive reload and export',async()=>{- const original=await (await fetch(baseURL+'/api/project')).json();- const save=state=>fetch(baseURL+'/api/project',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(state)});- const page=await browser.newPage({viewport:{width:1600,height:1000}});- page.on('pageerror',error=>errors.push(error.message));- try {- await save(fixture({slidesByDevice:{watchos:[slide('real upload',{layout:'hero'})]}}));- await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=80;c.height=120;const x=c.getContext('2d');x.fillStyle='#ee00aa';x.fillRect(0,0,80,120);return c.toDataURL().split(',')[1]});- const uploaded=page.waitForResponse(r=>r.url().endsWith('/api/upload')&&r.request().method()==='POST');- await page.locator('input[type=file]').last().setInputFiles({name:'real.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});- assert.equal((await uploaded).status(),200);- const fontURL=await page.locator('link[as=font]').first().getAttribute('href');- const fontBytes=await (await page.request.get(baseURL+fontURL)).body();- await page.locator('input[type=file]').first().setInputFiles({name:'Runtimefont.woff2',mimeType:'font/woff2',buffer:fontBytes});- await page.getByText('Imported Runtimefont',{exact:true}).waitFor();await pause(1000);- const disk=(await (await fetch(baseURL+'/api/project')).json()).state;- assert.ok(disk.slidesByDevice.watchos[0].screenshot.startsWith('/screenshots/uploaded/'));- assert.equal(disk.importedFont.name,'Runtimefont');- await page.reload();await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- assert.match(await page.getByRole('combobox',{name:'Screenshot font',exact:true}).innerText(),/Runtimefont/);- const downloaded=page.waitForEvent('download');- await page.getByRole('button',{name:'Export bundle',exact:true}).click();- const JSZip=require('../skills/app-store-screenshots/template/node_modules/jszip');- const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));- assert.equal(Object.values(zip.files).filter(f=>f.name.endsWith('.png')).length,6);- } finally {await page.close();await save(original.state);}- });- assert.deepEqual(errors,[]);- assert.ok(passed>0,'No matching checks');- console.log(`${passed} browser regression checks passed in Google Chrome.`);- } finally { await browser.close(); }-})().catch(error=>{console.error(error);process.exitCode=1});+// Compatibility entry point; the harness ships with every scaffold.+require("../skills/app-store-screenshots/template/tests/harness/bug-bash.cjs");diff --git a/scripts/ui-bug-bash.cjs b/scripts/ui-bug-bash.cjsindex 71a3d2d..54e0dc1 100644--- a/scripts/ui-bug-bash.cjs+++ b/scripts/ui-bug-bash.cjs@@ -1,168 +1,2 @@-// Interaction-focused Chrome bug bash. Uses disposable, mocked project state.-// PLAYWRIGHT_MODULE=/path/to/playwright node scripts/ui-bug-bash.cjs http://localhost:3098-const assert = require('node:assert/strict');-const { chromium } = require(process.env.PLAYWRIGHT_MODULE || 'playwright');-const baseURL = process.argv[2] || 'http://localhost:3098';-const pause = ms => new Promise(resolve=>setTimeout(resolve,ms));-const slide = (id, extra={})=>({id,layout:'no-device',label:{en:'LABEL'},headline:{en:id},screenshot:'',...extra});-const rect = {x:100,y:200,width:160,height:90,zIndex:6};-const fixture=(extra={})=>({schemaVersion:2,appName:'UI bug bash',themeId:'clean-light',connectedCanvas:true,device:'watchos',orientation:'portrait',locale:'en',locales:['en','de'],slidesByDevice:{watchos:[slide('First'),slide('Second'),slide('Third')],android:[slide('Android')],iphone:[slide('iPhone')]},...extra});-(async()=>{- const browser=await chromium.launch({channel:'chrome',headless:true});- const errors=[];let passed=0,failures=0;- async function open(state=fixture(),viewport={width:1600,height:1000},options={}) {- const page=await browser.newPage({viewport,...options});let latest=structuredClone(state);- page.on('pageerror',error=>errors.push(error.message));- await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});- await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();- return {page,latest:()=>latest};- }- async function check(name,run) {- if(process.env.BUG_BASH_FILTER&&!name.includes(process.env.BUG_BASH_FILTER))return;- try{await run();passed++;console.log('PASS',name)}catch(error){failures++;console.error('FAIL',name,error.message)}- }- try {- await check('Escape cancels a draft text size without changing the canvas',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Text',{textElements:[{id:'t',text:{en:'Overlay'},fontSize:26,transform:rect}]})]}}));- await page.locator('main [contenteditable=plaintext-only]').last().focus();- const input=page.getByRole('spinbutton',{name:'Text size in pixels',exact:true});- await input.fill('100');await input.press('Escape');await pause(800);- assert.equal(latest().slidesByDevice.watchos[0].textElements[0].fontSize,26);- await page.close();- });- await check('exploring layouts keeps the chosen secondary screenshot',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Pair',{layout:'two-devices',screenshot:'/front.png',screenshotSecondary:'/back.png'})]}}));- const layout=page.locator('aside').last().getByRole('combobox').first();- await layout.click();await page.getByRole('option',{name:'Hero',exact:true}).click();- await layout.click();await page.getByRole('option',{name:'Two devices',exact:true}).click();await pause(800);- assert.equal(latest().slidesByDevice.watchos[0].screenshotSecondary,'/back.png');await page.close();- });- await check('keyboard reordering preserves selection, content, and undo',async()=>{- const {page,latest}=await open();- await page.getByRole('button',{name:/^Screen 2/}).click();- const handle=page.getByRole('button',{name:/^Reorder screen 2/});- await handle.focus();await page.keyboard.press('Space');await pause(100);- await page.keyboard.press('ArrowUp');await page.getByRole('status').filter({hasText:'over droppable area First'}).waitFor();- await page.keyboard.press('Space');await pause(900);- assert.deepEqual(latest().slidesByDevice.watchos.map(s=>s.id),['Second','First','Third']);- assert.equal(await page.locator('textarea').first().inputValue(),'Second');- await page.getByRole('button',{name:'Undo',exact:true}).click();await pause(800);- assert.deepEqual(latest().slidesByDevice.watchos.map(s=>s.id),['First','Second','Third']);await page.close();- });- await check('deleting the final slide exposes a usable empty state and can be undone',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Only')]}}));- await page.getByRole('button',{name:'Delete screen 1',exact:true}).click();- await page.getByText('No screens yet',{exact:true}).waitFor();- await page.getByRole('button',{name:'Export bundle',exact:true}).click();await page.getByText('No screens to export',{exact:true}).waitFor();- assert.equal(await page.locator('[inert]').count(),0);- await page.getByRole('button',{name:'Undo',exact:true}).first().click();- assert.equal(await page.locator('textarea').first().inputValue(),'Only');- await page.getByRole('button',{name:'Delete screen 1',exact:true}).click();await pause(600);- await page.getByRole('button',{name:'Add screen',exact:true}).click();await pause(800);- assert.equal(latest().slidesByDevice.watchos.length,1);assert.notEqual(latest().slidesByDevice.watchos[0].id,'Only');await page.close();- });- await check('custom background drafts, typography reset, and locale edits stay independent',async()=>{- const {page,latest}=await open();const inspector=page.locator('aside').last();- await inspector.getByRole('combobox').nth(1).click();await page.getByRole('option',{name:'Custom color',exact:true}).click();- const hex=page.getByRole('textbox',{name:'Custom background hex color',exact:true});- await hex.fill('#123456');await page.locator('textarea').first().click();- await hex.fill('#12');await page.locator('textarea').first().click();assert.equal(await hex.inputValue(),'#123456');- const slider=page.getByRole('slider',{name:'Headline size',exact:true});await slider.fill('150');- await page.getByRole('button',{name:'Reset headline to 100%',exact:true}).click();assert.equal(await slider.inputValue(),'100');- await page.getByRole('combobox',{name:'Locale',exact:true}).click();await page.getByRole('option',{name:'DE',exact:true}).click();- await page.locator('textarea').first().fill('Deutsch');await pause(800);- assert.deepEqual(latest().slidesByDevice.watchos[0].headline,{en:'First',de:'Deutsch'});- assert.equal(latest().slidesByDevice.watchos[0].backgroundColor,'#123456');- assert.equal(latest().slidesByDevice.watchos[0].typography,undefined);await page.close();- });- await check('canvas drag, resize, rotation, layer controls, delete, and undo persist',async()=>{- const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Canvas')]}}));- await page.getByRole('button',{name:'Image',exact:true}).click();await pause(700);- const selected=page.locator('main .rnd-selected');const before={...latest().slidesByDevice.watchos[0].imageElements[0].transform};- const box=await selected.boundingBox();const scale=box.width/before.width;- await page.mouse.move(box.x+box.width/2,box.y+box.height/2);await page.mouse.down();await page.mouse.move(box.x+box.width/2+40,box.y+box.height/2+30,{steps:8});await page.mouse.up();await pause(750);- const moved=latest().slidesByDevice.watchos[0].imageElements[0].transform;- assert.ok(Math.abs(moved.x-before.x-40/scale)<2);assert.ok(Math.abs(moved.y-before.y-30/scale)<2);- const handle=await selected.locator('div[style*="cursor: se-resize"]').boundingBox();- await page.mouse.move(handle.x+handle.width/2,handle.y+handle.height/2);await page.mouse.down();await page.mouse.move(handle.x+handle.width/2+35,handle.y+handle.height/2+20,{steps:8});await page.mouse.up();await pause(750);- const resized=latest().slidesByDevice.watchos[0].imageElements[0].transform;- assert.ok(resized.width>moved.width+10);assert.ok(resized.height>moved.height+5);- await page.getByRole('slider',{name:'Image rotation',exact:true}).fill('45');- await page.getByRole('button',{name:'Send to back',exact:true}).click();await pause(750);- const changed=latest().slidesByDevice.watchos[0];assert.equal(changed.imageElements[0].transform.rotation,45);- assert.ok(changed.imageElements[0].transform.zIndex<changed.transforms.caption.zIndex);- await page.getByRole('combobox',{name:'Image fit',exact:true}).click();await page.getByRole('option',{name:'Whole image',exact:true}).click();- await page.getByRole('combobox',{name:'Edge fade',exact:true}).click();await page.getByRole('option',{name:'From left',exact:true}).click();- await page.getByRole('slider',{name:'Fade strength',exact:true}).fill('65');await pause(750);- assert.equal(latest().slidesByDevice.watchos[0].imageElements[0].fit,'contain');assert.deepEqual(latest().slidesByDevice.watchos[0].imageElements[0].fade,{edge:'left',amount:65});- await page.getByRole('button',{name:'Delete image element',exact:true}).click();await pause(750);- assert.equal(latest().slidesByDevice.watchos[0].imageElements,undefined);- await page.getByRole('button',{name:'Undo',exact:true}).click();await pause(750);assert.equal(latest().slidesByDevice.watchos[0].imageElements.length,1);await page.close();- });- await check('all devices and layouts render and remain editable in both tablet orientations',async()=>{- const devices=['iphone','ipad','tvos','watchos','carplay','mac','android','android-7','android-10','feature-graphic'];- const layouts=['Hero','Device bottom','Device top','Two devices','No device','Split (landscape)'];- for(const device of devices) {- const {page,latest}=await open(fixture({device,slidesByDevice:{[device]:[slide('Layout',{layout:device==='feature-graphic'?'feature-graphic':'hero'})]}}));- for(const orientation of (device==='android-7'||device==='android-10'?['portrait','landscape']:['portrait'])) {- if(orientation==='landscape'){await page.getByRole('combobox',{name:'Orientation',exact:true}).click();await page.getByRole('option',{name:'Landscape',exact:true}).click();}- for(const layout of (device==='feature-graphic'?['Feature graphic']:layouts)) {- await page.getByRole('combobox',{name:'Layout',exact:true}).click();await page.getByRole('option',{name:layout,exact:true}).click();- const headline=page.getByRole('textbox',{name:device==='feature-graphic'?'Tagline':'Headline',exact:true});- await headline.fill(`${device} ${orientation} ${layout}`);- const canvas=page.locator('main');assert.ok((await canvas.boundingBox()).height>0);- await page.getByRole('button',{name:'Zoom in',exact:true}).click();await page.getByRole('button',{name:'Fit active screen',exact:true}).click();- }- }- await pause(700);assert.equal(latest().device,device);assert.ok(latest().slidesByDevice[device][0].headline.en.includes(device));await page.close();- }- });- await check('Fit active screen recenters a manually panned canvas at default zoom',async()=>{- const {page}=await open();const scroller=page.locator('main .overflow-auto');await pause(400);- await scroller.evaluate(el=>el.scrollTo({left:400,behavior:'instant'}));assert.ok(await scroller.evaluate(el=>el.scrollLeft)>100);- await page.getByRole('button',{name:'Fit active screen',exact:true}).click();await pause(600);- assert.ok(await scroller.evaluate(el=>el.scrollLeft)<5);await page.close();- });- await check('keyboard focus on an image exposes its inspector controls',async()=>{- const {page}=await open(fixture({slidesByDevice:{watchos:[slide('Image',{imageElements:[{id:'image',src:'',transform:rect}]})]}}));- await page.locator('main .rnd-editable').last().getByRole('button',{name:'Rotate element',exact:true}).focus();- assert.equal(await page.getByRole('combobox',{name:'Image fit',exact:true}).count(),1);await page.close();- });- await check('responsive widths keep the canvas and inspector usable without page overflow',async()=>{- const {page,latest}=await open();- for(const width of [320,390,820,1024,1440]) {- await page.setViewportSize({width,height:900});await pause(150);- assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),`page overflows at ${width}px`);- const canvas=page.locator('main');await canvas.scrollIntoViewIfNeeded();- const box=await canvas.boundingBox();assert.ok(box.width>=280&&box.height>=250,`canvas too small at ${width}px: ${JSON.stringify(box)}`);- const headline=page.getByRole('textbox',{name:'Headline',exact:true});await headline.fill(`Width ${width}`);- if(process.env.BUG_BASH_ARTIFACTS)await page.screenshot({path:`${process.env.BUG_BASH_ARTIFACTS}/ui-${width}.png`,fullPage:true});- }- await pause(750);assert.equal(latest().slidesByDevice.watchos[0].headline.en,'Width 1440');await page.close();- });- await check('touch tablets expose slide actions without requiring hover',async()=>{- const {page,latest}=await open(fixture(),{width:820,height:1180},{hasTouch:true});- const duplicate=page.getByRole('button',{name:'Duplicate screen 1',exact:true});- assert.ok(Number(await duplicate.locator('..').evaluate(el=>getComputedStyle(el).opacity))>0,'slide actions are invisible on touch');- await duplicate.tap();await pause(750);assert.equal(latest().slidesByDevice.watchos.length,4);await page.close();- });- await check('theme and font menus apply every built-in option and preserve content',async()=>{- const {page,latest}=await open();- for(const label of ['Theme','Screenshot font']) {- const menu=page.getByRole('combobox',{name:label,exact:true});await menu.click();- const names=(await page.getByRole('option').allTextContents()).filter(name=>!name.includes('Import font'));- await page.keyboard.press('Escape');- for(const name of names) {- await menu.click();await page.getByRole('option',{name,exact:true}).click();- assert.ok((await menu.innerText()).includes(name));- assert.equal(await page.getByRole('textbox',{name:'Headline',exact:true}).inputValue(),'First');- }- }- await pause(750);assert.ok(latest().themeId);assert.ok(latest().fontId);await page.close();- });- assert.deepEqual(errors,[],'Uncaught browser errors');- assert.ok(passed+failures>0,'No matching checks');- assert.equal(failures,0,`${failures} UI checks failed`);- console.log(`${passed} UI interaction groups passed in Google Chrome.`);- } finally {await browser.close()}-})().catch(error=>{console.error(error);process.exitCode=1});+// Compatibility entry point; the harness ships with every scaffold.+require("../skills/app-store-screenshots/template/tests/harness/ui-bug-bash.cjs");diff --git a/skills/app-store-screenshots/template/.github/workflows/e2e.yml b/skills/app-store-screenshots/template/.github/workflows/e2e.ymlnew file mode 100644index 0000000..d0239ae--- /dev/null+++ b/skills/app-store-screenshots/template/.github/workflows/e2e.yml@@ -0,0 +1,31 @@+name: Editor verification+on:+ pull_request:+ push:+ branches: [main]+permissions:+ contents: read+jobs:+ chrome:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: 24+ - uses: oven-sh/setup-bun@v2+ with:+ bun-version: 1.3.9+ - run: bun install --frozen-lockfile+ - run: npx playwright install chrome --with-deps+ - run: bun run typecheck+ - run: bun run build+ - run: bun run test:e2e+ - run: SCREENSHOTS_E2E_PRODUCTION=1 bun run test:e2e+ - uses: actions/upload-artifact@v4+ if: always()+ with:+ name: editor-e2e+ path: .e2e/+ include-hidden-files: true+ retention-days: 7diff --git a/skills/app-store-screenshots/template/.gitignore b/skills/app-store-screenshots/template/.gitignoreindex a9a0f88..43cb5bf 100644--- a/skills/app-store-screenshots/template/.gitignore+++ b/skills/app-store-screenshots/template/.gitignore@@ -13,3 +13,6 @@ next-env.d.ts# often forbid redistributing them), so keep them out of the template as well.public/fonts/imported/*!public/fonts/imported/.gitkeep++# Tester Army output+.e2e/diff --git a/skills/app-store-screenshots/template/README.md b/skills/app-store-screenshots/template/README.mdindex a19ea1b..aa22bca 100644--- a/skills/app-store-screenshots/template/README.md+++ b/skills/app-store-screenshots/template/README.md@@ -101,3 +101,19 @@ These routes are for a local editor running in one server process. They have noUploads are written atomically. Project and upload requests time out after 15 seconds in the editor; image preloads after 10 seconds. Export also stops with a retryable error if font loading takes longer than 15 seconds. Failed preloads can be retried on export, and failed or stalled PNG workers finish through the inline encoder.The `/screenshots/uploaded/[filename]` and `/fonts/imported/[filename]` routes serve uploads created after server startup, including with `next start`. They accept only the generated hash filenames and supported extensions, preserving the same asset URLs and on-disk locations as the dev server.++## Automated verification++The scaffold includes [Tester Army](https://github.com/tester-army/e2e), pinned to `[email protected]`, `@e2e-dev/[email protected]` and `[email protected]`. Tests require Node.js 22.12 or newer and installed **Google Chrome**. No model account or API key is needed for the deterministic suite.++```bash+bun install --frozen-lockfile+bun run typecheck+bun run build+bun run test:e2e+SCREENSHOTS_E2E_PRODUCTION=1 bun run test:e2e+```++The runner creates a disposable template copy on port 4312 and removes it after shutdown. Project saves, uploads and fonts go into that copy. It refuses an occupied port; set `SCREENSHOTS_E2E_PORT` to choose another. It never reuses your active editor server. Dev verification uses Next's webpack mode because Turbopack cannot resolve the temporary copy's dependency symlink. Production verification uses the template's existing `.next` build.++Reports, ZIP downloads, failure screenshots and traces are under `.e2e/`; harness logs are in `.e2e/logs/`. `bun run test:e2e:list` lists every selected test. The shipped GitHub workflow runs both dev and production verification using Google Chrome. See [the flow matrix](docs/testing/e2e.md) for coverage and limits.diff --git a/skills/app-store-screenshots/template/bun.lock b/skills/app-store-screenshots/template/bun.lockindex 124f4ba..ab03e01 100644--- a/skills/app-store-screenshots/template/bun.lock+++ b/skills/app-store-screenshots/template/bun.lock@@ -21,7 +21,7 @@"html-to-image": "^1.11.11","jszip": "^3.10.1","lucide-react": "^0.460.0",- "next": "16.3.6",+ "next": "16.3.8","react": "^19.2.8","react-dom": "^19.2.8","react-rnd": "^10.5.3",@@ -31,10 +31,13 @@"tailwindcss-animate": "^1.0.7",},"devDependencies": {+ "@e2e-dev/web": "0.11.2","@types/node": "^22","@types/react": "^19.2.17","@types/react-dom": "^19.2.3","autoprefixer": "^10.4.20",+ "e2e": "0.16.0",+ "playwright": "1.63.0","postcss": "^8.5.28","tailwindcss": "^3.4.15","typescript": "^5.6.3",@@ -45,8 +48,14 @@"nanoid": "^3.3.18",},"packages": {+ "@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-+GZJIgz1jk86pwEbb3f1BD2bdoSKyWE4Jg4YUc7NMnMozbWemSKYZcw2F4nMaO5qwsL5A8RmioAKW81YktRpIQ=="],+"@alloc/quick-lru": ["@alloc/[email protected]", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],+ "@clack/core": ["@clack/[email protected]", "", { "dependencies": { "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" } }, "sha512-iHTrHA8MtVuLl2TfZySmcKv1qO2PoyC9Z7pfSDozEuV5vtY3/wcOPKJXlqJ5Oq2Cx5DDGQGAMVx6HZfRRoVEbQ=="],++ "@clack/prompts": ["@clack/[email protected]", "", { "dependencies": { "@clack/core": "1.5.1", "fast-string-width": "^3.0.2", "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" } }, "sha512-dlT1m5e/0yUL0kRNcQn7yGLVThkgbB0Ga/1AmfDDC/8ik6AIiSf2QLQO2zPYvefsHP0aFgxO93cVLCCfDp7kzQ=="],+"@dnd-kit/accessibility": ["@dnd-kit/[email protected]", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw=="],"@dnd-kit/core": ["@dnd-kit/[email protected]", "", { "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ=="],@@ -55,8 +64,62 @@"@dnd-kit/utilities": ["@dnd-kit/[email protected]", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="],+ "@e2e-dev/web": ["@e2e-dev/[email protected]", "", { "peerDependencies": { "e2e": ">=0.15.0 <1", "playwright": ">=1.63.0 <2" } }, "sha512-2JzH42fklbKFxmg1Pp8EnZJC/Y+6lDNnYm2+d71CTaHjx6NGTWi6SjpPVW8zAyRsj1hLFliQcURI+pBJMXNFoA=="],+"@emnapi/runtime": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],+ "@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="],++ "@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="],++ "@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A=="],++ "@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q=="],++ "@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw=="],++ "@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw=="],++ "@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw=="],++ "@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg=="],++ "@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w=="],++ "@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug=="],++ "@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ=="],++ "@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ=="],++ "@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA=="],++ "@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ=="],++ "@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA=="],++ "@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg=="],++ "@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ=="],++ "@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw=="],++ "@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw=="],++ "@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ=="],++ "@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw=="],++ "@esbuild/openharmony-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q=="],++ "@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g=="],++ "@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ=="],++ "@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA=="],++ "@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g=="],+"@floating-ui/core": ["@floating-ui/[email protected]", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="],"@floating-ui/dom": ["@floating-ui/[email protected]", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="],@@ -127,23 +190,27 @@"@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],- "@next/env": ["@next/[email protected]", "", {}, "sha512-x9Vblze1EbtltQYnNH38xCPWU3TVfBd1eXqA3+w9+BTpedkkdNpAaltXlGQ/nsc1+E0mVTNrtcbX3GoO09zeLQ=="],+ "@modelcontextprotocol/core": ["@modelcontextprotocol/[email protected]", "", { "dependencies": { "zod": "^4.2.0" } }, "sha512-iLhmprRmWI8EcosOA3wVvww22z02NkgqhV4fBH6f/odQBsi7xnJc0HGmi21yWO+/iKw2yzqVE127Zhna5/+JXw=="],++ "@modelcontextprotocol/server": ["@modelcontextprotocol/[email protected]", "", { "dependencies": { "@modelcontextprotocol/core": "2.2.0", "zod": "^4.2.0" } }, "sha512-qFnltjus6Gk8Lx6J1w2RXmr3YPN22MNT6qD6zjAkaiWIlFIFxWClz0rXHNuJF/KSUyn5YGhkSvXkWDbQHVLFEQ=="],++ "@next/env": ["@next/[email protected]", "", {}, "sha512-Al9zqHVV7TJv0eFuOU4U7Lvv74PTih4Ch63sk2xCIpSTkE3udFnaOcnzP2lQVymiL7yS9Cj2iClUXlR3EQ5sEw=="],- "@next/swc-darwin-arm64": ["@next/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-E/7GEqaUkt8mk/T8v9lAnrhzR06kdq1ZBkC12F8tAMkdIadwNp3H1KqHynDHrpcTlGCUdq/qu6vUL2aYVyYBdw=="],+ "@next/swc-darwin-arm64": ["@next/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-2JPRMh2nmQG5CiL7cXGL9AGwnPWJQ//cTtAUCT+w511QHk79SYz3LGv/pc5X643B/WEO0rvu3Yww0hqwt3kgeA=="],- "@next/swc-darwin-x64": ["@next/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-yBE893/nDWTlaiBD1p+qgt7NUen4U5R6FXyH0s67Npq1S3E0cVSef1WIXC2xBRgQvwAvJq6DnS6Y6PrY0cy4Ew=="],+ "@next/swc-darwin-x64": ["@next/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-GZtCCOBKJ4leVIT/Th0llWKhD1ca92lzbQiS5R5ON9QkoiFnilFsebDae1JU2a3HWoKMEmEZWGs1AGLavVM72Q=="],- "@next/swc-linux-arm64-gnu": ["@next/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-KJDpjBqBPYlvkivmyrp+Qys6k/7ksbqGQvRVc6ZEGfR+cjQxx+nUkJaWmNZJsmoOrqYNbaXByF8wa0lBwDhB3Q=="],+ "@next/swc-linux-arm64-gnu": ["@next/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-O659ygeQYqneJ1fBKMpFxIFqYkYswu8IAS1OCKK/4f3ZgJJm1dRz4fVJZRi/kLLWjnBKnebOePA4WNv+sV1pVA=="],- "@next/swc-linux-arm64-musl": ["@next/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-mqNg2K+hvWskSRb/QM+Ix412DvBsuSF0XV+frTSw5vmoucNnIlynFwKYew8D01bfATErMOM7Bujrf0BA5DRKFA=="],+ "@next/swc-linux-arm64-musl": ["@next/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-dSjKSyWpzxoO1d3DIZZcP4XJcNaKeLmxQMFOiYl5vuBRMmweIqnAhty8tAmRsvTss779cK1FtYnDMj40e4TQlg=="],- "@next/swc-linux-x64-gnu": ["@next/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-nFncBNGAYouRHjRVaITs9beZRfhX4ssVwpnvPIAbkZVH6LtGoAVlH4bJ8Cnf9SOo9bsXgPFer/GdHtEE3JNOkw=="],+ "@next/swc-linux-x64-gnu": ["@next/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-lbqOuz3RPRcv+o9msNsJw5x4+Y1ZwPTs6vmL6DCf7i0fZfvng/F59wyeDwqHIvV0mK//RBy/jJkZ+nCKsSMXjQ=="],- "@next/swc-linux-x64-musl": ["@next/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-5Mf3cHDGR/Iz0ng2Bj3zUR3p5QS9YK3Hn2QiAfavFmyF48zwThAjpFoiTKNIcOHLYS4zEk+gzyJ/9deQ2ZB8yQ=="],+ "@next/swc-linux-x64-musl": ["@next/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-+316WswI8ScVgZeUd+1KGaXkHhaYQzCjvH/05TZSpJ8zBizb1a4G7DtO7F12jcBIqMOtsz9ji1t48fmKtzqsGA=="],- "@next/swc-win32-arm64-msvc": ["@next/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-0jkJy0C2kbrJWTk4YLa3xk80pVBpx8FCHJym7CnUfDAXe/FWv5qT7SQJbR0KuemyxaEDlEx5WT4VQJoTW+/9Qw=="],+ "@next/swc-win32-arm64-msvc": ["@next/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-ji0gd4kMYUxO+1fJBIbiBVRCjzG/lloiyCccnlebvb1ZJ5qXCPZqYg4Jl1DrrixnWNMKylzgpmMWx0yNDYXlzw=="],- "@next/swc-win32-x64-msvc": ["@next/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-/YXjI1e5OXcZ7YpxRwgP/1jAV/SBKTzeVKqN2mk7mLpcICsyn3Gl5+dIfDTJp70M0ccMhyMMRso4v6mPDCGepg=="],+ "@next/swc-win32-x64-msvc": ["@next/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-WcTlaKt/TWkh5kUjdJcUmB1XgZ+1c6fz4Y9fDHL73YNSdGaUWjceeWrrlwF0nv19iABYWC4iAq1oX1w4Bn0vfg=="],"@nodelib/fs.scandir": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],@@ -221,14 +288,28 @@"@radix-ui/rect": ["@radix-ui/[email protected]", "", {}, "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw=="],+ "@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],+"@swc/helpers": ["@swc/[email protected]", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw=="],+ "@types/chai": ["@types/[email protected]", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],++ "@types/deep-eql": ["@types/[email protected]", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],+"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q=="],"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw=="],"@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],+ "@vitest/expect": ["@vitest/[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", "@vitest/spy": "5.0.2", "@vitest/utils": "5.0.2", "chai": "^6.2.2", "tinyrainbow": "^3.1.1" } }, "sha512-pd6YDkhOHptwC65NYNpGpNxWlJH9M9Gxwtej73osTddb1NpiE0Jz5CIjTTEGXRgK0YtiSN7qBokmBXZ5uPJL1w=="],++ "@vitest/pretty-format": ["@vitest/[email protected]", "", { "dependencies": { "tinyrainbow": "^3.1.1" } }, "sha512-YHM+mQQ7N1ROHMugJ7P/M+fC/q1G4zs/iAMZZCvhHcY8WkwPQcXBHD+z18oz+808Cfa12K7jOr3XPQMcLIovjw=="],++ "@vitest/spy": ["@vitest/[email protected]", "", {}, "sha512-Ijc7T1nT9efNb5LxvjaBrEqw3f/QwUv5EE0nKqZxgqsaV/FxAAZ8baGylA8X/Z2oS4Lp+K74Jr6dTJsDKxJDeg=="],++ "@vitest/utils": ["@vitest/[email protected]", "", { "dependencies": { "@vitest/pretty-format": "5.0.2", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.1" } }, "sha512-mgpUtxFhKeOKVaArBVHNJGdYHAeRh135o59l13uVmPUCS1OUtis5pBqXEgE25iqRgFqEBwXvJlkhknRsYnMeqg=="],+"any-promise": ["[email protected]", "", {}, "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="],"anymatch": ["[email protected]", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="],@@ -237,6 +318,8 @@"aria-hidden": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],+ "assertion-error": ["[email protected]", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],+"autoprefixer": ["[email protected]", "", { "dependencies": { "browserslist": "^4.28.6", "caniuse-lite": "^1.0.30001806", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA=="],"baseline-browser-mapping": ["[email protected]", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-s4+sLr9mZ/CyqeRritFeYV/Zx73OAtmaHn6kkBS1XRoJn1hrg3xIDUcpicAEX68tkcIN0iBCgti31C8zxtkhsQ=="],@@ -251,6 +334,8 @@"caniuse-lite": ["[email protected]", "", {}, "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw=="],+ "chai": ["[email protected]", "", {}, "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg=="],+"chokidar": ["[email protected]", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="],"class-variance-authority": ["[email protected]", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],@@ -259,7 +344,9 @@"clsx": ["[email protected]", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],- "commander": ["[email protected]", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="],+ "commander": ["[email protected]", "", {}, "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg=="],++ "convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],"core-util-is": ["[email protected]", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="],@@ -275,14 +362,24 @@"dlv": ["[email protected]", "", {}, "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="],+ "e2e": ["[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.18", "@clack/prompts": "1.8.1", "@modelcontextprotocol/server": "2.2.0", "@vitest/expect": "5.0.2", "commander": "15.0.0", "picocolors": "1.1.1", "pngjs": "7.0.0", "tsx": "4.23.14", "zod": "4.6.1" }, "peerDependencies": { "@ai-sdk/openai": "^4.0.0", "@ai-sdk/openai-compatible": "^3.0.0", "@ai-sdk/xai": "^5.0.0", "ai": "^7.0.0" }, "optionalPeers": ["@ai-sdk/openai", "@ai-sdk/openai-compatible", "@ai-sdk/xai", "ai"], "bin": { "e2e": "./dist/cli/bin.js" } }, "sha512-KXFks4yu4bCjrVgbebR/eULRzDWTpb3ECqhE+563O92vQwgwJHhIwoAKy7AsJQ5L2/r4qoCF2j5Jn3HW+DHx3A=="],+"electron-to-chromium": ["[email protected]", "", {}, "sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ=="],"es-errors": ["[email protected]", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],+ "esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.2", "@esbuild/android-arm": "0.28.2", "@esbuild/android-arm64": "0.28.2", "@esbuild/android-x64": "0.28.2", "@esbuild/darwin-arm64": "0.28.2", "@esbuild/darwin-x64": "0.28.2", "@esbuild/freebsd-arm64": "0.28.2", "@esbuild/freebsd-x64": "0.28.2", "@esbuild/linux-arm": "0.28.2", "@esbuild/linux-arm64": "0.28.2", "@esbuild/linux-ia32": "0.28.2", "@esbuild/linux-loong64": "0.28.2", "@esbuild/linux-mips64el": "0.28.2", "@esbuild/linux-ppc64": "0.28.2", "@esbuild/linux-riscv64": "0.28.2", "@esbuild/linux-s390x": "0.28.2", "@esbuild/linux-x64": "0.28.2", "@esbuild/netbsd-arm64": "0.28.2", "@esbuild/netbsd-x64": "0.28.2", "@esbuild/openbsd-arm64": "0.28.2", "@esbuild/openbsd-x64": "0.28.2", "@esbuild/openharmony-arm64": "0.28.2", "@esbuild/sunos-x64": "0.28.2", "@esbuild/win32-arm64": "0.28.2", "@esbuild/win32-ia32": "0.28.2", "@esbuild/win32-x64": "0.28.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA=="],+"escalade": ["[email protected]", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],"fast-glob": ["[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],+ "fast-string-truncated-width": ["[email protected]", "", {}, "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g=="],++ "fast-string-width": ["[email protected]", "", { "dependencies": { "fast-string-truncated-width": "^3.0.2" } }, "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg=="],++ "fast-wrap-ansi": ["[email protected]", "", { "dependencies": { "fast-string-width": "^3.0.2" } }, "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q=="],+"fastq": ["[email protected]", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],"fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],@@ -323,6 +420,8 @@"js-tokens": ["[email protected]", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],+ "json-schema": ["[email protected]", "", {}, "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="],+"jszip": ["[email protected]", "", { "dependencies": { "lie": "~3.3.0", "pako": "~1.0.2", "readable-stream": "~2.3.6", "setimmediate": "^1.0.5" } }, "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g=="],"lie": ["[email protected]", "", { "dependencies": { "immediate": "~3.0.5" } }, "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ=="],@@ -343,7 +442,7 @@"nanoid": ["[email protected]", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug=="],- "next": ["[email protected]", "", { "dependencies": { "@next/env": "16.3.6", "@swc/helpers": "0.5.23", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", "postcss": "8.5.23", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.3.6", "@next/swc-darwin-x64": "16.3.6", "@next/swc-linux-arm64-gnu": "16.3.6", "@next/swc-linux-arm64-musl": "16.3.6", "@next/swc-linux-x64-gnu": "16.3.6", "@next/swc-linux-x64-musl": "16.3.6", "@next/swc-win32-arm64-msvc": "16.3.6", "@next/swc-win32-x64-msvc": "16.3.6", "sharp": "^0.35.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-L+otWM/aQbYTx98aZhgEoMb4bZAXx1YVW4UMA/vuCyCoWG5HJyZUili8QAkqzrcC+5///tsz3s0M+SlyB5bLMw=="],+ "next": ["[email protected]", "", { "dependencies": { "@next/env": "16.3.8", "@swc/helpers": "0.5.23", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", "postcss": "8.5.23", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.3.8", "@next/swc-darwin-x64": "16.3.8", "@next/swc-linux-arm64-gnu": "16.3.8", "@next/swc-linux-arm64-musl": "16.3.8", "@next/swc-linux-x64-gnu": "16.3.8", "@next/swc-linux-x64-musl": "16.3.8", "@next/swc-win32-arm64-msvc": "16.3.8", "@next/swc-win32-x64-msvc": "16.3.8", "sharp": "^0.35.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-U7QEZaTini6wKrb8A8hqLLqYQyCetegKjCpJOyxk642vWoMoU1x5PyZCJFvgYgiptA8xc5j/9xYlZFO7w9Sjmw=="],"node-releases": ["[email protected]", "", {}, "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ=="],@@ -365,6 +464,12 @@"pirates": ["[email protected]", "", {}, "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA=="],+ "playwright": ["[email protected]", "", { "dependencies": { "playwright-core": "1.63.0" }, "bin": { "playwright": "cli.js" } }, "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg=="],++ "playwright-core": ["[email protected]", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg=="],++ "pngjs": ["[email protected]", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="],+"postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A=="],"postcss-import": ["[email protected]", "", { "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "peerDependencies": { "postcss": "^8.0.0" } }, "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew=="],@@ -425,6 +530,8 @@"sharp": ["[email protected]", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.4", "@img/sharp-darwin-x64": "0.35.4", "@img/sharp-freebsd-wasm32": "0.35.4", "@img/sharp-libvips-darwin-arm64": "1.3.3", "@img/sharp-libvips-darwin-x64": "1.3.3", "@img/sharp-libvips-linux-arm": "1.3.3", "@img/sharp-libvips-linux-arm64": "1.3.3", "@img/sharp-libvips-linux-ppc64": "1.3.3", "@img/sharp-libvips-linux-riscv64": "1.3.3", "@img/sharp-libvips-linux-s390x": "1.3.3", "@img/sharp-libvips-linux-x64": "1.3.3", "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", "@img/sharp-libvips-linuxmusl-x64": "1.3.3", "@img/sharp-linux-arm": "0.35.4", "@img/sharp-linux-arm64": "0.35.4", "@img/sharp-linux-ppc64": "0.35.4", "@img/sharp-linux-riscv64": "0.35.4", "@img/sharp-linux-s390x": "0.35.4", "@img/sharp-linux-x64": "0.35.4", "@img/sharp-linuxmusl-arm64": "0.35.4", "@img/sharp-linuxmusl-x64": "0.35.4", "@img/sharp-webcontainers-wasm32": "0.35.4", "@img/sharp-win32-arm64": "0.35.4", "@img/sharp-win32-ia32": "0.35.4", "@img/sharp-win32-x64": "0.35.4" } }, "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA=="],+ "sisteransi": ["[email protected]", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],+"sonner": ["[email protected]", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-DIS8z4PfJRbIyfVFDVnK9rO3eYDtse4Omcm6bt0oEr5/jtLgysmjuBl1frJ9E/EQZrFmKx2A8m/s5s9CRXIzhw=="],"source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],@@ -449,12 +556,16 @@"tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="],+ "tinyrainbow": ["[email protected]", "", {}, "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A=="],+"to-regex-range": ["[email protected]", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],"ts-interface-checker": ["[email protected]", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="],"tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],+ "tsx": ["[email protected]", "", { "dependencies": { "esbuild": "~0.28.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": { "tsx": "dist/cli.mjs" } }, "sha512-yFwMnbAsUFz/T3kR8P2ENc/DDUaYd9tKg4oVYo0lhkX0LlK4UuqYAO6mpQ2y6lmcyip1uPJ34C2kPACopDwG4w=="],+"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],"undici-types": ["[email protected]", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],@@ -467,6 +578,8 @@"util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],+ "zod": ["[email protected]", "", {}, "sha512-341aRWQsve0rvronKNTqZpjmzdbUDlFuzHaI/XLg/Ej82qffDJRRfBTCuv7+9q/rMjB6LSLyEBnW4InJeMtt/Q=="],+"chokidar/glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],"fast-glob/glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],@@ -475,6 +588,8 @@"react-rnd/tslib": ["[email protected]", "", {}, "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="],+ "sucrase/commander": ["[email protected]", "", {}, "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA=="],+"tailwindcss/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg=="],"tinyglobby/picomatch": ["[email protected]", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="],diff --git a/skills/app-store-screenshots/template/docs/testing/e2e.md b/skills/app-store-screenshots/template/docs/testing/e2e.mdnew file mode 100644index 0000000..79ca0af--- /dev/null+++ b/skills/app-store-screenshots/template/docs/testing/e2e.md@@ -0,0 +1,116 @@+# Editor end-to-end verification++The product under test is this Next.js editor template. `promo/` demo applications are outside this suite. Every scaffold copies the config, tests, fixtures, harnesses and its own GitHub Actions workflow.++## Run it++Requires Node.js >=22.12, Bun 1.3.9 and installed Google Chrome. App runtime itself supports Node >=20.9. Tester Army is pinned to `[email protected]`, `@e2e-dev/[email protected]`, `[email protected]`. No `agent.*` steps or model credentials are used in this deterministic suite.++```bash+bun install --frozen-lockfile+bun run typecheck+bun run build+bun run test:e2e:list+bun run test:e2e+SCREENSHOTS_E2E_PRODUCTION=1 bun run test:e2e+```++`bun run test:e2e` runs 26 tests: 23 tests that directly drive/inspect the product with Tester Army, plus three tests that run 56 existing regression groups (35 browser/export, 12 UI, nine API). Nested loops cover every advertised device size, layout, orientation, theme and built-in font. Counts refer to test/group definitions, not every loop iteration.++For one direct regression:++```bash+E2E_TELEMETRY_DISABLED=1 npx e2e run tests/editor.e2e.ts --grep 'watchos opens'+```++For the existing harnesses against a server you have already started in a **disposable** project:++```bash+bun run test:regression http://localhost:4312+BUG_BASH_FILTER='connected overlays' node tests/harness/bug-bash.cjs http://localhost:4312+```++These manual commands write the supplied server's disk project and uploads; the normal Tester Army command creates that disposable server automatically.++To exercise cold dev compilation after API-only traffic, start `node e2e-army/server.cjs 4312` from this template in one terminal, then run `node scripts/api-bug-bash.cjs http://localhost:4312` from the repository root in another. The server makes a disposable copy; stop it with Ctrl-C afterward. The equivalent standalone-scaffold command is `node tests/harness/api-bug-bash.cjs http://localhost:4312`. Run this before a browser requests the page so it covers the native ESM Tailwind config-loading regression.++## Isolation and artifacts++The runner starts `e2e-army/server.cjs` on port 4312. It makes a unique system temporary directory containing the app, symlinks only `node_modules`, then starts Next with that directory as cwd. `/api/project`, image uploads, font uploads and runtime asset routes therefore read/write the disposable copy. Teardown removes the copy. An already occupied port causes a startup failure: the config never silently reuses a live editor. Run suites sequentially because API and export harnesses mutate their isolated server project. Tests restore the API project after mutations too.++The browser provider uses Playwright's `channel: 'chrome'` to launch installed **Google Chrome**, then leases its CDP endpoint through the published `BrowserProvider` contract. No Chromium fallback. `SCREENSHOTS_E2E_HEADED=1` opens visible Chrome. Dev mode uses `next dev --webpack`; Turbopack refuses dependency symlinks outside the temporary copy. Production mode copies `.next` from the built template and runs `next start`.++The default `.e2e/` output contains:++- `report.json`: selected tests, status, steps, errors, counts and artifact links.+- `summary.md` and `junit.xml`: readable and CI summaries.+- `artifacts/`: real exported ZIP downloads, failure screenshots and retained failure traces.+- `logs/app.log`, `logs/{api-bug-bash,ui-bug-bash,bug-bash}.log`: application and individual regression group output.+- `evidence/red/report.json`: the initial failing native run proving the undo regression. Only its report and summary were retained; its original screenshots/traces were superseded by later runs.++Use the default output directory for this suite's ZIP-content checks; the published download fixture returns an attempt-relative path, so the ZIP helper finds that path beneath `.e2e/artifacts` without assuming runner-generated test IDs. CI uploads the output directory on success and failure and runs dev and production with Chrome. Dependencies install with the frozen Bun lockfile.++## Flow matrix++| Product flow | Verification |+| --- | --- |+| iOS, Mac, Android tabs and last selected device | Direct tab round-trip verifies device and preserved copy; UI harness verifies all combinations. |+| iPhone, iPad, Apple TV, Watch, CarPlay, Mac, Android phone, 7-inch/10-inch tablets, feature graphic | Ten direct deck tests edit/create/undo on each device; browser harness exports every device at every advertised size and checks screenshot pixels. |+| Portrait/landscape and every layout | UI harness iterates devices/layouts and both supported tablet orientations, checks editing/persistence. |+| Screen create, select, duplicate, delete, empty state, reorder | Direct CRUD and keyboard reorder assertions; UI harness pointer/keyboard ordering, selected copy, final-slide deletion/undo and usable empty states. |+| Undo/redo, cross-deck editing, shortcuts | Direct regression proves rapid copy edit + Add screen preserves copy after Undo on ten decks; harness checks typing, menu arrows, cross-deck history and undo/redo. |+| Inspector/canvas label, headline/tagline, copy ideas | Direct editable headline formula, locale edits and deck editing; harness inline clearing/retyping, plain paste, fallback behavior and caption appearance. |+| Text/image elements, size, transforms, layering | UI harness adds/selects/deletes text and image elements; actual pointer drag/resize; rotation, fit, fade, stacking and undo; draft-size Escape cancels. |+| Layout/background/text contrast/theme/font menus | UI harness explores layouts, secondary screenshot preservation, custom backgrounds and draft hex, typography reset; iterates built-in themes/fonts and preserves content; browser harness verifies feature-graphic contrast. |+| Screenshot picker/upload, secondary screenshots, icons | Actual PNG/JPEG round trips, inspector picker, feature graphic icon PNG composition, reloading uploaded assets; invalid files retain previous selection; race/clear latest upload wins. |+| Font import, errors and overlapping imports | Valid real WOFF2 upload/browser decode/reload/export; invalid/truncated containers rejected; latest response wins; font-load timeout unlocks controls. |+| Locale and RTL | Direct EN/DE/AR editing and computed Arabic direction; browser harness checks inline locale clearing/fallback and independent Hebrew/Latin direction. ZIP tests assert per-locale names/counts. |+| Autosave, reload, local cache, retry, concurrent revision conflict | Direct real disk edit/reload/cache and stale API revision; browser harness serialized slow saves, queued revision advance, two real tabs, invalid project load, failed-save retry, beforeunload warning. |+| Connected/isolated crops and off-canvas transforms | Direct mode toggle/undo/redo; browser harness decodes exported PNG pixels across a boundary in both modes and compares out-of-bounds composition. |+| Export ZIP/files/count/dimensions/RGB and screenshot composition | Direct real 24-PNG Watch ZIP validates filenames, EN/DE, advertised dimensions, PNG color type 2 and nonuniform pixels; harness every device/file resolution and screenshot/overlay/icon pixels. |+| Export lock, progress, failure and fallback | Harness editor becomes inert immediately through ZIP completion, downloads once, unlocks; missing/corrupt/stalled assets/font fail with actionable messages; failing/silent/throwing workers use inline encoder; encoding failure is observed safely. |+| Narrow viewport, touch, keyboard access | Direct 390px layout and keyboard reordering; UI harness 390–1440px screenshots/layout, scrollable inspector, touch actions without hover, keyboard canvas image focus and Fit active screen recentering. |+| API inputs, origin, limits, asset serving and migration | Direct invalid project/no mutation, stale conflict, corrupt image/font and foreign origins; API harness exact JSON type/origin, request byte limits including chunked upload, concurrent atomic uploads, runtime filename/traversal rejection and legacy migration. Root repository reads the live skill migration; standalone scaffold uses the bundled recipe fixture. |+| Reset and cancel reset | Harness reset-all preserves app/theme/locales, editor confirmation allows cancellation; structural reset has separate undo boundary. |++## Bugs fixed and evidence++1. **Rapid structural actions erased preceding copy during undo.** Type a headline, immediately Add screen, then Undo. All ten direct deck regressions failed with original headline `First` instead of edited copy. The save/history hook previously coalesced every change within the typing window. Add, duplicate, delete, reorder and reset now start an independent history step and close the current coalescing group. Subsequent typing still coalesces. The retained initial red report contains the exact expected/observed values; the final suite verifies the repaired behavior on all ten devices.+2. **Default screen selection jumped after keyboard reordering.** Initial rendering derived the selected slide from index zero but left its ID unset. Moving that initially selected slide changed the inspector to the new first slide. Hydration now pins the actual screen ID; reordering preserves its selection. A direct keyboard regression exposed this case, which the existing harness missed because it explicitly clicked a screen first.+3. **Template framework dependency predates the September 30 security release.** Updated Next from 16.3.6 to 16.3.8 and regenerated the Bun lock. The [official release](https://github.com/vercel/next.js/releases/tag/v16.3.8) lists the repaired advisories. `bun audit --json` returned `{}` before and after; that result alone is not a security clearance. Build, types and dev/production editor tests validate compatibility; these UI tests do not prove absence of every security vulnerability.+4. **Cold dev page compilation crashed after API-only traffic.** An independent Luna follow-up exposed `ReferenceError: require is not defined` at `tailwind.config.ts:65` when the root API harness first fetched the page for its bundled font, after six API groups had passed. The same exact isolated invocation reproduced the failure and terminated Next. Replacing the animation plugin's CommonJS `require` with a static ESM import passed all nine root API groups on a fresh dev server. Both cold-start logs are retained in `.e2e/evidence/root-dev-{red,green}/`; typecheck, build and complete dev/production suites were rerun after the fix.++Harness integration also corrected trailing-slash URLs from `app.baseUrl`: `//api/upload` redirected the streaming request and Node fetch could not replay its body. All harness entry points now normalize the supplied URL. The test locator/artifact mistakes found during authoring were corrected without weakening product expectations.++## Honest limits++- Chrome on a local desktop and emulated touch/viewport sizes are verified. Real iOS/Android hardware, WebKit/Firefox rendering and installed macOS system fonts on other operating systems are not covered.+- This is flow/regression coverage, not a complete accessibility audit, visual pixel-baseline suite, load test, or exhaustive security scan. Keyboard actions and responsive overflow are exercised; screen readers, every contrast combination and every tab sequence are not exhaustively judged.+- Export exposes a busy/progress state and error recovery. The product has no export-cancel control; no cancellation test is presented as covered. Reset dialog cancellation is a separate flow.+- Font coverage uses valid bundled WOFF2 and corrupt containers. It does not enumerate every licensed TTF/OTF/WOFF binary or font family.+- The suite never submits to App Store Connect or Google Play. It validates the editor's declared export contract; hosted store acceptance is not verified.+- Existing harnesses retain fixed short waits from the previous regression work. New direct Tester Army flows use readiness assertions/responses/download events. All selected tests must pass; there are no skip declarations disguising untested areas.++## Recorded execution++Validated locally on 2026-10-03 with Node 24.15.0, Bun 1.3.9 and Google Chrome 154.0.8037.97.++| Check | Result | Evidence |+| --- | --- | --- |+| Frozen install | Passed, no lock changes | `bun install --frozen-lockfile` |+| TypeScript and production build | Passed (Next 16.3.8) | `bun run typecheck`, `bun run build` |+| Final dev Tester Army suite after ESM fix | 26/26 passed, zero skips/retries, 263.30s | `.e2e/evidence/dev-esm/report.json` |+| Shipped groups within final dev suite | 35 browser/export +12 UI +9 API passed | `.e2e/evidence/dev-esm/logs/` |+| Default-selection regression repeat | 3/3 uncached repeats passed | `.e2e/evidence/selection-green/report.json` |+| Final production Tester Army suite after ESM fix | 26/26 passed, zero skips/retries, 191.81s | `.e2e/evidence/production-esm/report.json` |+| Shipped groups within final production suite | 35 browser/export +12 UI +9 API passed | `.e2e/evidence/production-esm/logs/` |+| Cold root dev API before ESM fix | Failed after 6 groups; Next crashed at config require | `.e2e/evidence/root-dev-red/{harness,server}.log` |+| Cold root dev API after ESM fix | 9/9 groups passed, including live migration | `.e2e/evidence/root-dev-green/{harness,server}.log` |++The initial native red run recorded the undo bug on all ten devices. A later direct keyboard regression exposed the separate default-selection bug; its failing screenshot/trace and report are preserved in `.e2e/evidence/selection-red/`. Final dev and production artifacts, including ZIP output and screenshots at 320, 390, 820, 1024 and 1440 pixels, were retained in `.e2e/evidence/{dev-esm,production-esm}/artifacts/`. Earlier passing implementation runs remain in `.e2e/evidence/{dev,production}/`.++Before the ESM fix, independent Luna verification passed both 26-test suites and a separate production root API run (9/9), inspected real Watch ZIPs and narrow-screen output, checked occupied-port refusal, workspace cleanup and canonical-file preservation. Its additional cold root dev invocation then exposed the config bug; the final implementation reruns above include the fix. The independent report is at `/Users/parthjadhav/research/e2e-rollout-2026-10-03/screenshots-luna.md`, with its untouched evidence under `/tmp/app-store-screenshots-rollout-verification-20261003/`.++The independent Luna follow-up passed the repaired cold root dev API sequence (9/9), a fresh dev suite (26/26 plus all 56 groups, zero failures/skips/flakes/retries/model use and all cleanups complete), typecheck and build. It verified the built animation plugin CSS, reviewed the retained final production 26/26 report, and validated a copied standalone scaffold with a webpack build plus all nine API groups using its bundled migration fixture. Production was not repeated during this follow-up; it was independently run before the config fix and fully rerun by the implementation afterward. No additional findings remained. The follow-up report is `/Users/parthjadhav/research/e2e-rollout-2026-10-03/screenshots-luna-followup.md`; cold-dev logs are under `/tmp/screenshots-luna-followup-20261003-root-dev/`. Both independent loops confirmed Chrome use, freed port 4312, workspace cleanup and unchanged canonical project/assets.++The canonical `app-store-screenshots.json` and source `public/` assets remained unchanged, and the original untracked `promo/` directory was preserved. No commits, pushes, PRs, store uploads or external feedback were created.diff --git a/skills/app-store-screenshots/template/e2e-army/chrome-provider.ts b/skills/app-store-screenshots/template/e2e-army/chrome-provider.tsnew file mode 100644index 0000000..9fc1b44--- /dev/null+++ b/skills/app-store-screenshots/template/e2e-army/chrome-provider.ts@@ -0,0 +1,46 @@+import { createServer } from "node:net";+import type { BrowserProvider } from "@e2e-dev/web";+import { type Browser, chromium } from "playwright";++// The published web engine has no channel option. Its supported provider+// contract lets us use installed Google Chrome without a Chromium fallback.+export function googleChrome(): BrowserProvider {+ const browsers = new Map<string, Browser>();+ return {+ name: "installed-google-chrome",+ async acquire(request) {+ const port = await new Promise<number>((resolve, reject) => {+ const server = createServer();+ server.once("error", reject);+ server.listen(0, "127.0.0.1", () => {+ const address = server.address();+ if (address == null || typeof address === "string") {+ server.close(() => reject(new Error("Cannot allocate Chrome CDP port")));+ return;+ }+ server.close(() => resolve(address.port));+ });+ });+ const browser = await chromium.launch({+ channel: "chrome",+ headless: request.env.SCREENSHOTS_E2E_HEADED !== "1",+ args: [`--remote-debugging-port=${port}`],+ });+ const id = `${request.runId}-${request.targetName}-${request.slot}`;+ try {+ request.signal.throwIfAborted();+ browsers.set(id, browser);+ request.log(`Google Chrome ${browser.version()} (channel: chrome)`);+ return { id, cdpEndpoint: `http://127.0.0.1:${port}` };+ } catch (error) {+ await browser.close();+ throw error;+ }+ },+ async release(lease) {+ const browser = browsers.get(lease.id);+ browsers.delete(lease.id);+ await browser?.close();+ },+ };+}diff --git a/skills/app-store-screenshots/template/e2e-army/server.cjs b/skills/app-store-screenshots/template/e2e-army/server.cjsnew file mode 100644index 0000000..163c009--- /dev/null+++ b/skills/app-store-screenshots/template/e2e-army/server.cjs@@ -0,0 +1,20 @@+// Copy the complete product into a disposable directory: API writes/uploads+// resolve from cwd, and must never touch a user's project or generated assets.+const { cpSync, mkdtempSync, symlinkSync, rmSync } = require('node:fs');+const { tmpdir } = require('node:os');+const path = require('node:path');+const { spawn } = require('node:child_process');+const source = path.resolve(__dirname, '..');+const workspace = mkdtempSync(path.join(tmpdir(), 'screenshots-e2e-'));+cpSync(source, workspace, { recursive: true, filter: p => {+ const first = path.relative(source, p).split(path.sep)[0];+ return !['node_modules', '.next', '.e2e', '.git', 'tests', 'e2e-army'].includes(first);+}});+symlinkSync(path.join(source, 'node_modules'), path.join(workspace, 'node_modules'), 'dir');+const production = process.env.SCREENSHOTS_E2E_PRODUCTION === '1';+if (production) cpSync(path.join(source, '.next'), path.join(workspace, '.next'), { recursive: true });+console.log(`Disposable editor workspace: ${workspace}`);+const child = spawn(process.execPath, [path.join(source, 'node_modules/next/dist/bin/next'), production ? 'start' : 'dev', ...(production ? [] : ['--webpack']), '--hostname', '0.0.0.0', '--port', process.argv[2] || '4312'], { cwd: workspace, stdio: 'inherit', env: { ...process.env, NEXT_TELEMETRY_DISABLED: '1' } });+let stopping = false;+for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, () => { stopping = true; child.kill(signal); });+child.on('exit', (code, signal) => { rmSync(workspace, { recursive: true, force: true }); process.exit(stopping ? 0 : code ?? (signal ? 1 : 0)); });diff --git a/skills/app-store-screenshots/template/e2e.config.ts b/skills/app-store-screenshots/template/e2e.config.tsnew file mode 100644index 0000000..852266f--- /dev/null+++ b/skills/app-store-screenshots/template/e2e.config.ts@@ -0,0 +1,22 @@+import type { E2EConfig } from 'e2e';+import { web } from '@e2e-dev/web';+import { googleChrome } from './e2e-army/chrome-provider';++export default {+ tests: 'tests/**/*.e2e.ts',+ workers: 1,+ retries: 0,+ timeout: 120_000,+ assertionTimeout: 10_000,+ cache: 'off',+ reporters: ['list', 'junit', 'markdown'],+ trace: 'retain-on-failure',+ targets: [{+ name: 'google-chrome',+ engine: web({ browser: googleChrome(), viewport: { width: 1600, height: 1000 } }),+ app: {+ url: `http://localhost:${process.env.SCREENSHOTS_E2E_PORT ?? '4312'}`,+ command: { executable: process.execPath, args: ['e2e-army/server.cjs', '{port}'], startupTimeout: 120_000, log: '.e2e/logs/app.log', env: { SCREENSHOTS_E2E_PRODUCTION: process.env.SCREENSHOTS_E2E_PRODUCTION ?? '0' } },+ },+ }],+} satisfies E2EConfig;diff --git a/skills/app-store-screenshots/template/package.json b/skills/app-store-screenshots/template/package.jsonindex 6cd800a..2bff7d7 100644--- a/skills/app-store-screenshots/template/package.json+++ b/skills/app-store-screenshots/template/package.json@@ -2,11 +2,17 @@"name": "app-store-screenshots","version": "0.1.0","private": true,- "engines": { "node": ">=20.9.0" },+ "engines": {+ "node": ">=20.9.0"+ },"scripts": {"dev": "next dev","build": "next build",- "start": "next start"+ "start": "next start",+ "typecheck": "tsc --noEmit",+ "test:e2e": "E2E_TELEMETRY_DISABLED=1 e2e run",+ "test:e2e:list": "E2E_TELEMETRY_DISABLED=1 e2e list",+ "test:regression": "node tests/harness/run.cjs"},"dependencies": {"@dnd-kit/core": "^6.1.0",@@ -25,7 +31,7 @@"html-to-image": "^1.11.11","jszip": "^3.10.1","lucide-react": "^0.460.0",- "next": "16.3.6",+ "next": "16.3.8","react": "^19.2.8","react-dom": "^19.2.8","react-rnd": "^10.5.3",@@ -41,7 +47,10 @@"autoprefixer": "^10.4.20","postcss": "^8.5.28","tailwindcss": "^3.4.15",- "typescript": "^5.6.3"+ "typescript": "^5.6.3",+ "e2e": "0.16.0",+ "@e2e-dev/web": "0.11.2",+ "playwright": "1.63.0"},"overrides": {"nanoid": "^3.3.18"diff --git a/skills/app-store-screenshots/template/src/components/editor/screenshot-editor.tsx b/skills/app-store-screenshots/template/src/components/editor/screenshot-editor.tsxindex 1f3054c..1c0b738 100644--- a/skills/app-store-screenshots/template/src/components/editor/screenshot-editor.tsx+++ b/skills/app-store-screenshots/template/src/components/editor/screenshot-editor.tsx@@ -64,10 +64,12 @@ export function ScreenshotEditor() {React.useEffect(() => {if (!hydrated) return;- if (!activeSlide && currentSlides.length > 0) {- setActiveSlideId(currentSlides[0].id);+ // Pin the default selection to its ID before reordering can change index 0.+ // A deleted/undone screen falls back to the first remaining screen.+ if (!currentSlides.some((slide) => slide.id === activeSlideId)) {+ setActiveSlideId(currentSlides[0]?.id ?? null);}- }, [hydrated, currentSlides, activeSlide]);+ }, [hydrated, currentSlides, activeSlideId]);React.useEffect(() => {if (!supportsLandscape(state.device) && state.orientation !== "portrait") {@@ -166,7 +168,7 @@ export function ScreenshotEditor() {setState((prev) => ({...prev,slidesByDevice: { ...prev.slidesByDevice, [prev.device]: next },- }));+ }), { coalesce: false });},[setState],);@@ -186,7 +188,7 @@ export function ScreenshotEditor() {...prev,slidesByDevice: { ...prev.slidesByDevice, [dev]: cur.filter((s) => s.id !== id) },};- });+ }, { coalesce: false });setActiveSlideId((cur) => (cur === id ? fallback?.id || null : cur));toast("Screen deleted", {@@ -201,7 +203,7 @@ export function ScreenshotEditor() {...prev,slidesByDevice: { ...prev.slidesByDevice, [dev]: restored },};- });+ }, { coalesce: false });setActiveSlideId(snap.id);},},@@ -219,7 +221,7 @@ export function ScreenshotEditor() {...prev.slidesByDevice,[prev.device]: [...(prev.slidesByDevice[prev.device] || []), slide],},- }));+ }), { coalesce: false });setActiveSlideId(slide.id);},[setState],@@ -335,7 +337,7 @@ export function ScreenshotEditor() {...prev,slidesByDevice: { ...prev.slidesByDevice, [prev.device]: next },};- });+ }, { coalesce: false });if (newId) setActiveSlideId(newId);},[setState],diff --git a/skills/app-store-screenshots/template/src/lib/storage.ts b/skills/app-store-screenshots/template/src/lib/storage.tsindex 64127dc..d97988e 100644--- a/skills/app-store-screenshots/template/src/lib/storage.ts+++ b/skills/app-store-screenshots/template/src/lib/storage.ts@@ -343,7 +343,8 @@ export function useProject() {// an edit, so it neither takes an undo step nor clears redo. Undo still// restores the snapshot's device, which takes you to the deck the undone// edit was made on.- const setState = useCallback((updater: Updater, options?: { history?: boolean }) => {+ // Structural actions form their own step and end the typing/slider group.+ const setState = useCallback((updater: Updater, options?: { history?: boolean; coalesce?: boolean }) => {const prev = stateRef.current;const next = applyUpdater(updater, prev);if (next === prev) return;@@ -353,12 +354,12 @@ export function useProject() {lastPushAt.current = 0;} else {const now = Date.now();- if (now - lastPushAt.current > COALESCE_MS) {+ if (options?.coalesce === false || now - lastPushAt.current > COALESCE_MS) {pastRef.current.push(prev);if (pastRef.current.length > HISTORY_LIMIT) pastRef.current.shift();}futureRef.current.length = 0;- lastPushAt.current = now;+ lastPushAt.current = options?.coalesce === false ? 0 : now;}commit(next);}, [commit]);@@ -384,7 +385,7 @@ export function useProject() {// "Reset all devices" resets the decks only. App name, theme, font, icon and// especially `locales` (which has no editor UI) are project settings.const reset = useCallback(() => {- setState((prev) => ({ ...prev, slidesByDevice: DEFAULT_PROJECT.slidesByDevice }));+ setState((prev) => ({ ...prev, slidesByDevice: DEFAULT_PROJECT.slidesByDevice }), { coalesce: false });}, [setState]);const resetDevice = useCallback((device: Device) => {@@ -394,7 +395,7 @@ export function useProject() {...prev.slidesByDevice,[device]: DEFAULT_PROJECT.slidesByDevice[device],},- }));+ }), { coalesce: false });}, [setState]);return {diff --git a/skills/app-store-screenshots/template/tailwind.config.ts b/skills/app-store-screenshots/template/tailwind.config.tsindex 7fc6933..65b3b2e 100644--- a/skills/app-store-screenshots/template/tailwind.config.ts+++ b/skills/app-store-screenshots/template/tailwind.config.ts@@ -1,4 +1,5 @@import type { Config } from "tailwindcss";+import animate from "tailwindcss-animate";const config: Config = {darkMode: ["class"],@@ -62,6 +63,6 @@ const config: Config = {},},},- plugins: [require("tailwindcss-animate")],+ plugins: [animate],};export default config;diff --git a/skills/app-store-screenshots/template/tests/editor.e2e.ts b/skills/app-store-screenshots/template/tests/editor.e2e.tsnew file mode 100644index 0000000..a8b0478--- /dev/null+++ b/skills/app-store-screenshots/template/tests/editor.e2e.ts@@ -0,0 +1,189 @@+import { test } from '@e2e-dev/web';+import type { Browser } from '@e2e-dev/web';+import { expect } from 'e2e';+import { readFile, readdir } from 'node:fs/promises';+import JSZip from 'jszip';+import sharp from 'sharp';++const slide = (id: string) => ({ id, layout: 'no-device', screenshot: '', label: { en: 'FEATURE' }, headline: { en: id } });+const fixture = (device = 'watchos', extra = {}) => ({ schemaVersion: 2, appName: 'Tester Army', themeId: 'clean-light', connectedCanvas: true, locales: ['en', 'de', 'ar'], locale: 'en', device, orientation: 'portrait', slidesByDevice: { [device]: [slide('First'), slide('Second')] }, ...extra });+async function mock(browser: Browser, state = fixture()) {+ await browser.route('**/api/project', async route => {+ if (route.request.method === 'POST') state = JSON.parse(route.request.postData!);+ await route.fulfill({ json: { ok: true, state }, headers: { etag: '"mock"' } });+ });+}++for (const device of ['iphone', 'ipad', 'tvos', 'watchos', 'carplay', 'mac', 'android', 'android-7', 'android-10', 'feature-graphic']) {+ test(`${device} opens and edits its own deck`, async ({ app, browser, screen }) => {+ await mock(browser, fixture(device));+ await app.open('/');+ const headline = screen.getByRole('textbox', device === 'feature-graphic' ? 'Tagline' : 'Headline');+ await expect(headline).toHaveValue('First');+ await headline.fill(`Edited ${device}`);+ await screen.getByRole('button', 'Add screen').tap();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(3);+ await browser.locator('button[aria-label="Undo"]').tap();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(2);+ await expect(headline).toHaveValue(`Edited ${device}`);+ });+}++test('create duplicate delete and undo preserve selection and copy', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ await screen.getByRole('button', 'Duplicate screen 1').tap();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(3);+ await screen.getByRole('textbox', 'Headline').fill('Copy edited');+ await screen.getByRole('button', 'Delete screen 2').tap();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(2);+ await browser.locator('button[aria-label="Undo"]').tap();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(3);+ await screen.getByRole('button', /Screen 2 ·/).tap();+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('Copy edited');+});++test('locale edits stay independent and Arabic canvas has RTL direction', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ await screen.getByRole('combobox', 'Locale').tap();+ await screen.getByRole('option', 'DE', { exact: true }).tap();+ await screen.getByRole('textbox', 'Headline').fill('Deutsch');+ await screen.getByRole('combobox', 'Locale').tap();+ await screen.getByRole('option', 'AR', { exact: true }).tap();+ await screen.getByRole('textbox', 'Headline').fill('مرحبا بالعالم');+ await expect(browser.locator('main [contenteditable="plaintext-only"]').nth(1)).toContainText('مرحبا بالعالم');+ await expect(await browser.evaluate(() => getComputedStyle(document.querySelectorAll('main [contenteditable="plaintext-only"]')[1]).direction)).toBe('rtl');+ await screen.getByRole('combobox', 'Locale').tap();+ await screen.getByRole('option', 'EN', { exact: true }).tap();+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('First');+});++test('platform tabs remember the last device and its copy', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ await screen.getByRole('tab', 'Android', { exact: true }).tap();+ await screen.getByRole('textbox', 'Headline').fill('Android copy');+ await screen.getByRole('tab', 'iOS', { exact: true }).tap();+ await expect(screen.getByRole('combobox', 'Device')).toContainText('Watch');+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('First');+ await screen.getByRole('tab', 'Android', { exact: true }).tap();+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('Android copy');+});++test('connected mode toggles and survives undo and redo', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ await screen.getByRole('button', 'Connected', { exact: true }).tap();+ await expect(screen.getByRole('button', 'Isolated', { exact: true })).toHaveAttribute('aria-pressed', 'false');+ await browser.locator('button[aria-label="Undo"]').tap();+ await expect(screen.getByRole('button', 'Connected', { exact: true })).toHaveAttribute('aria-pressed', 'true');+ await screen.getByRole('button', 'Redo').tap();+ await expect(screen.getByRole('button', 'Isolated', { exact: true })).toBeVisible();+ await screen.getByRole('button', 'Reset', { exact: true }).tap();+ await expect(screen.getByRole('dialog')).toBeVisible();+ await screen.getByRole('button', 'Cancel', { exact: true }).tap();+ await expect(screen.getByRole('dialog')).toHaveCount(0);+ await expect(screen.getByRole('button', 'Isolated', { exact: true })).toBeVisible();+ await expect(screen.getByRole('button', /^Delete screen/)).toHaveCount(2);+});++test('copy ideas inserts an editable headline formula', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ await screen.getByRole('button', 'Copy ideas').tap();+ const item = screen.getByRole('menuitem').first();+ await item.tap();+ await expect(screen.getByRole('textbox', 'Headline')).toBeVisible();+ const value = await screen.getByRole('textbox', 'Headline').inputValue();+ await expect(value).toContain('[');+ await screen.getByRole('textbox', 'Headline').fill('Final copy');+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('Final copy');+});++test('mobile viewport retains usable controls without document overflow', async ({ app, browser, screen }) => {+ await mock(browser); await browser.setViewport({ width: 390, height: 844 }); await app.open('/');+ await expect(screen.getByRole('button', 'Add screen')).toBeVisible();+ await screen.getByRole('textbox', 'Headline').fill('Mobile edited');+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('Mobile edited');+ await expect(await browser.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);+});++test('missing referenced images prevent downloads and unlock controls', async ({ app, browser, screen }) => {+ await mock(browser, fixture('watchos', { slidesByDevice: { watchos: [{ ...slide('Broken'), layout: 'hero', screenshot: '/missing-tester-army.png' }] } }));+ await app.open('/'); await screen.getByRole('button', 'Export bundle', { exact: true }).tap();+ await expect(screen.getByText('Export failed', { exact: true })).toBeVisible();+ await expect(screen.getByRole('textbox', 'App name')).toBeEnabled();+ await expect(browser.locator('[inert]')).toHaveCount(0);+});++test('real ZIP exports exact RGB dimensions locale filenames and composition', async ({ app, browser, screen }) => {+ await mock(browser, fixture('watchos', { locales: ['en', 'de'] })); await app.open('/');+ const download = await browser.waitForDownload(() => screen.getByRole('button', 'Export bundle', { exact: true }).tap(), { timeout: 120_000 });+ const matches = (await readdir('.e2e/artifacts', { recursive: true })).filter(file => file.endsWith(download.path));+ await expect(matches).toHaveLength(1);+ const zip = await JSZip.loadAsync(await readFile(`.e2e/artifacts/${matches[0]}`));+ const pngs = Object.values(zip.files).filter(file => file.name.endsWith('.png'));+ await expect(pngs).toHaveLength(24);+ for (const file of pngs) {+ const bytes = await file.async('nodebuffer'); const dimensions = file.name.match(/\/(\d+)x(\d+)\/(en|de)\/0[12]-no-device\.png$/)!;+ await expect(dimensions).toBeTruthy();+ await expect(bytes.readUInt32BE(16)).toBe(Number(dimensions[1])); await expect(bytes.readUInt32BE(20)).toBe(Number(dimensions[2]));+ await expect(bytes[25]).toBe(2);+ }+ const stats = await sharp(await pngs[0].async('nodebuffer')).stats();+ await expect(stats.channels.some(channel => channel.stdev > 3)).toBe(true);+ await expect(screen.getByRole('textbox', 'App name')).toBeEnabled();+});++test('real disk autosave reload and cache preserve edits', async ({ app, browser, screen }) => {+ const endpoint = new URL('/api/project', app.baseUrl);+ const original = (await (await fetch(endpoint)).json()).state;+ try {+ await fetch(endpoint, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(fixture()) });+ await app.open('/'); await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('First');+ const saved = browser.waitForResponse('**/api/project');+ await screen.getByRole('textbox', 'App name').fill('Persisted army');+ await expect((await saved).status).toBe(200);+ await expect(browser.locator('[title="Project saved"]')).toBeVisible();+ await browser.reload(); await expect(screen.getByRole('textbox', 'App name')).toHaveValue('Persisted army');+ await expect((await (await fetch(endpoint)).json()).state.appName).toBe('Persisted army');+ await expect(await browser.evaluate(() => Object.keys(localStorage).length > 0)).toBe(true);+ } finally { await fetch(endpoint, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(original) }); }+});++test('keyboard screen reorder keeps the selected screen and has a separate undo step', async ({ app, browser, screen }) => {+ await mock(browser); await app.open('/');+ const handle = screen.getByRole('button', 'Reorder screen 1 (press space, then arrow keys)', { exact: true });+ await handle.press('Space');+ await expect(handle).toHaveAttribute('aria-pressed', 'true');+ await expect(screen.getByRole('status')).toContainText(/First was (picked up|moved over droppable area First)/);+ await browser.keyboard.press('ArrowDown');+ await expect(screen.getByRole('status')).toContainText('over droppable area Second');+ await browser.keyboard.press('Space');+ await expect(screen.getByRole('button', /Screen 1 ·.*Second/)).toBeVisible();+ await expect(screen.getByRole('textbox', 'Headline')).toHaveValue('First');+ await browser.locator('button[aria-label="Undo"]').tap();+ await expect(screen.getByRole('button', /Screen 1 ·.*First/)).toBeVisible();+});++test('real API rejects invalid projects without changing disk', async ({ app }) => {+ const url = new URL('/api/project', app.baseUrl); const original = await fetch(url); const state = (await original.json()).state;+ for (const invalid of [null, {}, { ...state, schemaVersion: 999 }, { ...state, slidesByDevice: { unknown: [] } }]) {+ await expect((await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(invalid) })).status).toBe(400);+ }+ await expect((await (await fetch(url)).json()).state).toEqual(state);+});++test('real API stale revisions conflict and keep the winning project', async ({ app }) => {+ const url = new URL('/api/project', app.baseUrl); const initial = await fetch(url); const state = (await initial.json()).state; const revision = initial.headers.get('etag')!;+ const post = (appName: string) => fetch(url, { method: 'POST', headers: { 'content-type': 'application/json', 'if-match': revision }, body: JSON.stringify({ ...state, appName }) });+ try {+ const responses = await Promise.all([post('Winner A'), post('Winner B')]);+ await expect(responses.map(response => response.status).sort()).toEqual([200, 412]);+ await expect((await (await fetch(url)).json()).state.appName).toBe(responses[0].status === 200 ? 'Winner A' : 'Winner B');+ } finally { await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(state) }); }+});++test('real upload endpoints reject corrupt content and foreign origins', async ({ app }) => {+ for (const [endpoint, data] of [['/api/upload', { dataUrl: 'data:image/png;base64,iVBORw0KGgo=' }], ['/api/upload-font', { data: 'd09GMg==' }]] as const) {+ const url = new URL(endpoint, app.baseUrl); const body = JSON.stringify(data);+ await expect((await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body })).status).toBe(400);+ await expect((await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json', origin: 'https://foreign.example' }, body })).status).toBe(403);+ }+});diff --git a/skills/app-store-screenshots/template/tests/harness/api-bug-bash.cjs b/skills/app-store-screenshots/template/tests/harness/api-bug-bash.cjsnew file mode 100644index 0000000..6bccd00--- /dev/null+++ b/skills/app-store-screenshots/template/tests/harness/api-bug-bash.cjs@@ -0,0 +1,141 @@+// Run only against a disposable template copy; this writes projects and assets.+// node scripts/api-bug-bash.cjs http://localhost:3098+const assert = require('node:assert/strict');+const sharp = require('sharp');+const fs = require('node:fs/promises');+const os = require('node:os');+const path = require('node:path');+const {execFileSync} = require('node:child_process');+const {randomBytes} = require('node:crypto');+const base = (process.argv[2] || 'http://localhost:3098').replace(/\/$/, '');+const projectURL = base + '/api/project';+const post = (route, data, headers = {}) => fetch(base + route, {+ method: 'POST', headers: {'content-type': 'application/json', ...headers}, body: JSON.stringify(data),+});+let passed = 0;+async function check(name, run) { await run(); console.log('PASS', name); passed++; }+(async () => {+ const initial = await fetch(projectURL);+ assert.equal(initial.status, 200);+ const {state: original} = await initial.json();+ assert.ok(original, 'Start with a disposable template project');+ try {+ await check('invalid project shapes are rejected without replacing the file', async () => {+ const slide = {id:'a', layout:'no-device', screenshot:'', label:{en:'Test'}, headline:{en:'Test'}};+ const rect = {x:0,y:0,width:10,height:10};+ const invalid = [null, [], {}, {...original,schemaVersion:999}, {...original,connectedCanvas:'false'},+ {...original,slidesByDevice:{typo:[]}}, {...original,locales:['en','en']},+ ...[{headline:{en:[]}}, {transforms:{caption:{...rect,width:-1}}}, {textElements:[null]},+ {imageElements:[{id:'x',src:'a',transform:rect},{id:'x',src:'b',transform:rect}]}]+ .map(patch => ({...original, slidesByDevice:{watchos:[{...slide,...patch}]}}))];+ for (const state of invalid) assert.equal((await post('/api/project',state)).status,400);+ assert.deepEqual((await (await fetch(projectURL)).json()).state, original);+ });+ await check('every write route requires exact JSON content type and same origin', async () => {+ for (const route of ['/api/project','/api/upload','/api/upload-font']) {+ for (const type of ['text/plain','application/json-invalid']) assert.equal((await post(route,{}, {'content-type':type})).status,415);+ for (const origin of ['null','https://evil.example','http://localhost:9999']) assert.equal((await post(route,{}, {origin})).status,403);+ assert.equal((await post(route,{}, {'sec-fetch-site':'cross-site'})).status,403);+ }+ for (const host of ['localhost','127.0.0.1']) {+ const url = new URL(projectURL); url.hostname = host;+ const response = await fetch(url, {method:'POST',headers:{'content-type':'application/json',origin:url.origin,'sec-fetch-site':'same-origin'},body:JSON.stringify(original)});+ assert.equal(response.status,200,host);+ }+ });+ await check('concurrent stale project writes conflict and preserve the winning state', async () => {+ const revision = (await fetch(projectURL)).headers.get('etag');+ assert.ok(revision);+ const candidates = ['tab A','tab B'].map(appName=>({...original,appName}));+ const responses = await Promise.all(candidates.map(data=>post('/api/project',data,{'if-match':revision})));+ assert.deepEqual(responses.map(r=>r.status).sort(),[200,412]);+ const winning = responses.findIndex(r=>r.status===200);+ const current = await fetch(projectURL);+ assert.deepEqual((await current.json()).state,candidates[winning]);+ assert.equal(current.headers.get('etag'),responses[winning].headers.get('etag'));+ assert.equal((await post('/api/project',original,{'if-match':revision})).status,412);+ assert.equal((await post('/api/project',original,{'if-match':current.headers.get('etag')})).status,200);+ });+ await check('truncated, forged, malformed base64 and wrong-type uploads are rejected', async () => {+ for (const data of [null, {}, {dataUrl:'data:image/png;base64,iVBORw0KGgo='}, {dataUrl:'data:image/jpeg;base64,/9j/'},+ {dataUrl:'data:image/png;base64,iVBORw0K!Ggo='}, {dataUrl:'data:text/html;base64,SGk='}]) {+ assert.equal((await post('/api/upload',data)).status,400);+ }+ for (const data of [null,{}, {data:'d09GMg=='},{data:'T1RUTw=='},{data:'AAEAAA=='},{data:'d09GRg=='}]) {+ assert.equal((await post('/api/upload-font',data)).status,400);+ }+ });+ await check('real PNG/JPEG uploads round-trip; identical concurrent uploads stay intact', async () => {+ for (const format of ['png','jpeg']) {+ // Always a new hash, so restarting next start cannot mask missing+ // runtime asset serving by indexing files from a previous test run.+ const bytes = await sharp({create:{width:24,height:30,channels:3,background:'#'+randomBytes(3).toString('hex')}})[format]().toBuffer();+ const responses = await Promise.all(Array.from({length:4},()=>post('/api/upload',{dataUrl:`data:image/${format};base64,${bytes.toString('base64')}`})));+ let path;+ for (const response of responses) {+ assert.equal(response.status,200); const result = await response.json();+ if (path) assert.equal(result.path,path); path = result.path;+ const saved = await fetch(base+path); assert.equal(saved.status,200);+ assert.deepEqual(Buffer.from(await saved.arrayBuffer()),bytes);+ }+ assert.equal((await post('/api/upload',{dataUrl:`data:image/${format==='png'?'jpeg':'png'};base64,${bytes.toString('base64')}`})).status,400);+ }+ });+ await check('oversized request bodies are rejected including chunked bodies', async () => {+ const chunk = new Uint8Array(1024*1024).fill(32);+ for (const [route, megabytes] of [['/api/upload',13], ['/api/upload-font',24], ['/api/project',65]]) {+ const response = await fetch(base+route,{method:'POST',headers:{'content-type':'application/json'},duplex:'half',+ body:new ReadableStream({start(controller){for(let i=0;i<megabytes;i++)controller.enqueue(chunk);controller.close();}})});+ assert.equal(response.status,413,route);+ }+ });+ await check('valid WOFF2 uploads persist and truncated copies are rejected', async () => {+ const html = await (await fetch(base)).text();+ const fontPath = html.match(/\/_next\/static\/media\/[^"\s<>]+\.woff2/)?.[0];+ assert.ok(fontPath,'Expected bundled Next font');+ const bytes = Buffer.from(await (await fetch(base+fontPath)).arrayBuffer());+ // WOFF2's header version is metadata, independent of the glyph stream.+ randomBytes(4).copy(bytes,24);+ const response = await post('/api/upload-font',{data:bytes.toString('base64')});+ assert.equal(response.status,200); const {font}=await response.json();+ assert.equal(font.format,'woff2');+ assert.deepEqual(Buffer.from(await (await fetch(base+font.src)).arrayBuffer()),bytes);+ assert.equal((await post('/api/upload-font',{data:bytes.subarray(0,64).toString('base64')})).status,400);+ });+ await check('runtime asset routes reject missing files and traversal paths', async () => {+ for (const prefix of ['/screenshots/uploaded/','/fonts/imported/']) {+ for (const name of ['not-a-hash.png','0000000000000000.woff2','..%2f..%2fapp-store-screenshots.json']) {+ assert.ok([400,404].includes((await fetch(base+prefix+name)).status));+ }+ }+ });+ await check('documented migration handles null overlays and duplicate element IDs', async () => {+ const skill = await fs.readFile(path.join(__dirname,'../../../SKILL.md'),'utf8').catch(error => { if (error.code !== 'ENOENT') throw error; return null; });+ const source = skill+ ? skill.match(/BACKUP_DIR="\$BACKUP_DIR" node <<'NODE'\n([\s\S]*?)\nNODE/)[1]+ : await fs.readFile(path.join(__dirname,'migration-fixture.cjs'),'utf8');+ const temporary = await fs.mkdtemp(path.join(os.tmpdir(),'screenshot-migration-'));+ const transform = {x:10,y:20,width:0,height:40};+ try {+ const old = {...original, schemaVersion:1, connectedCanvas:undefined, slidesByDevice:{watchos:[{+ id:'legacy', layout:'hero', label:'Label', headline:'Old headline', screenshot:'/old.png',+ textElements:[null,{id:'same',text:'Hello',transform},{id:'same',text:{en:'Copy',de:42},transform,fontSize:-3}],+ imageElements:[null,{id:'same',src:'/a.png',transform},{id:'same',src:'/b.png',transform}],+ }]}};+ await fs.writeFile(path.join(temporary,'app-store-screenshots.json'),JSON.stringify(old));+ execFileSync(process.execPath,['-e',source],{cwd:temporary,env:{...process.env,BACKUP_DIR:temporary}});+ const migrated=JSON.parse(await fs.readFile(path.join(temporary,'app-store-screenshots.json'),'utf8'));+ assert.equal(migrated.connectedCanvas,false);assert.equal(migrated.schemaVersion,2);+ const slide=migrated.slidesByDevice.watchos[0];+ assert.deepEqual(slide.headline,{en:'Old headline'});assert.equal(slide.screenshot,'/old.png');+ assert.equal(slide.textElements.length,2);assert.equal(slide.imageElements.length,2);+ assert.equal(new Set(slide.textElements.map(e=>e.id)).size,2);+ assert.equal(new Set(slide.imageElements.map(e=>e.id)).size,2);+ assert.equal((await post('/api/project',migrated)).status,200);+ } finally { await fs.rm(temporary,{recursive:true,force:true}); }+ });+ console.log(`${passed} API regression groups passed.`);+ } finally {+ assert.equal((await post('/api/project',original)).status,200,'Could not restore disposable project');+ }+})().catch(error=>{console.error(error);process.exitCode=1;});diff --git a/skills/app-store-screenshots/template/tests/harness/bug-bash.cjs b/skills/app-store-screenshots/template/tests/harness/bug-bash.cjsnew file mode 100644index 0000000..d490b11--- /dev/null+++ b/skills/app-store-screenshots/template/tests/harness/bug-bash.cjs@@ -0,0 +1,467 @@+// Run against a disposable copy: this exercises uploads and /api/project.+// PLAYWRIGHT_MODULE=/path/to/playwright node scripts/bug-bash.cjs http://localhost:3098+const assert = require('node:assert/strict');+const fs = require('node:fs/promises');+const { chromium } = require(process.env.PLAYWRIGHT_MODULE || 'playwright');+const baseURL = (process.argv[2] || 'http://localhost:3098').replace(/\/$/, '');+const pause = ms => new Promise(resolve => setTimeout(resolve, ms));+const slide = (id, extra = {}) => ({ id, layout: 'no-device', label: {en: 'LABEL'}, headline: {en: id}, screenshot: '', ...extra });+const fixture = (extra = {}) => ({schemaVersion:2,appName:'Bug bash',themeId:'clean-light',connectedCanvas:true,locales:['en'],locale:'en',device:'watchos',orientation:'portrait',slidesByDevice:{watchos:[slide('first'),slide('second')],android:[slide('android')],iphone:[slide('iphone')]},...extra});+(async () => {+ const browser = await chromium.launch({channel:'chrome', headless:true});+ const errors = [];+ async function open(state=fixture(), save) {+ const page = await browser.newPage({viewport:{width:1600,height:1000}});+ let latest=structuredClone(state);+ page.on('pageerror', error=>errors.push(error.message));+ await page.route('**/api/project',async route=>{+ if(route.request().method()==='POST') {+ const data=route.request().postDataJSON();+ if(save) await save(data);+ latest=data;+ }+ await route.fulfill({json:{ok:true,state:latest}});+ });+ await page.goto(baseURL);+ await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ return {page, latest:()=>latest};+ }+ let passed=0;+ async function check(name, run) {+ if(process.env.BUG_BASH_FILTER && !name.includes(process.env.BUG_BASH_FILTER)) return;+ await run(); passed++; console.log('PASS',name);+ }+ try {+ await check('menu arrows do not navigate slides',async()=>{+ const {page}=await open();+ await page.getByRole('combobox',{name:'Theme',exact:true}).click();+ await page.keyboard.press('ArrowDown');+ assert.match(await page.locator('main').innerText(),/Screen 1/);+ await page.keyboard.press('Escape'); await page.close();+ });+ await check('duplicate selects copy; undo and redo preserve edits',async()=>{+ const {page}=await open();+ await page.getByRole('button',{name:'Duplicate screen 1',exact:true}).click();+ assert.match(await page.locator('main').innerText(),/Screen 2/);+ await page.getByRole('button',{name:'Undo',exact:true}).click();+ assert.equal(await page.getByRole('button',{name:/^Delete screen/}).count(),2);+ await page.getByRole('button',{name:'Redo',exact:true}).click();+ assert.equal(await page.getByRole('button',{name:/^Delete screen/}).count(),3);+ await page.close();+ });+ await check('rapid edits on different decks have separate undo steps',async()=>{+ const {page}=await open();+ await page.locator('textarea').first().fill('watch changed');+ await page.getByRole('tab',{name:'Android',exact:true}).click();+ await page.locator('textarea').first().fill('android changed');+ await page.getByRole('button',{name:'Undo',exact:true}).click();+ assert.equal(await page.locator('textarea').first().inputValue(),'android');+ await page.getByRole('button',{name:'Undo',exact:true}).click();+ assert.equal(await page.locator('textarea').first().inputValue(),'first');+ await page.close();+ });+ await check('editing does not reset a manually panned canvas',async()=>{+ const {page}=await open();+ const scroller=page.locator('main .overflow-auto');+ await scroller.evaluate(el=>el.scrollTo({left:300,behavior:'instant'}));+ const before=await scroller.evaluate(el=>el.scrollLeft);+ assert.ok(before>0);+ await page.locator('textarea').first().fill('edited while panned');+ await pause(400);+ assert.equal(await scroller.evaluate(el=>el.scrollLeft),before);+ await page.close();+ });+ await check('slow autosaves never overlap or overwrite newer state',async()=>{+ let active=0,maxActive=0; const completed=[];+ const {page,latest}=await open(fixture(),async data=>{+ maxActive=Math.max(maxActive,++active);+ await pause(data.appName==='older'?1800:50);+ completed.push(data.appName); active--;+ });+ await pause(800);+ await page.getByRole('textbox',{name:'App name',exact:true}).fill('older');+ await pause(800);+ await page.getByRole('textbox',{name:'App name',exact:true}).fill('newer');+ await pause(2600);+ assert.equal(maxActive,1); assert.equal(latest().appName,'newer');+ assert.equal(completed.at(-1),'newer'); await page.close();+ });+ await check('export locks immediately and through completion, PNG dimensions/locales are correct',async()=>{+ const {page}=await open(fixture({locales:['en','de']}));+ let downloadCount=0; page.on('download',()=>downloadCount++);+ const downloaded=page.waitForEvent('download');+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ assert.equal(await page.locator('main').evaluate(el=>!!el.closest('[inert]')),true);+ assert.equal(await page.getByRole('textbox',{name:'App name',exact:true}).isDisabled(),true);+ const download=await downloaded; const file=await download.path();+ const JSZip=require('jszip');+ const zip=await JSZip.loadAsync(await fs.readFile(file));+ const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));+ assert.equal(pngs.length,24);+ for(const png of pngs) {+ const bytes=await png.async('nodebuffer'); const [,w,h]=png.name.match(/\/(\d+)x(\d+)\//);+ assert.equal(bytes.readUInt32BE(16),Number(w)); assert.equal(bytes.readUInt32BE(20),Number(h));+ assert.equal(bytes[25],2,'stores need opaque 24-bit RGB PNGs, not RGBA');+ }+ await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ assert.equal(await page.locator('[inert]').count(),0); assert.equal(downloadCount,1); await page.close();+ });+ await check('missing referenced image blocks export and recovers controls',async()=>{+ const {page}=await open(fixture({slidesByDevice:{watchos:[slide('broken',{layout:'hero',screenshot:'/missing-bugbash.png'})]}}));+ let downloads=0;page.on('download',()=>downloads++);+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ await page.getByText('Export failed',{exact:true}).waitFor();+ assert.match(await page.locator('body').innerText(),/Images could not be loaded/);+ assert.equal(downloads,0); assert.equal(await page.locator('[inert]').count(),0); await page.close();+ });+ await check('latest upload wins; clear cancels pending replacement',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero'})]}}));+ const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=10;c.height=10;const x=c.getContext('2d');x.fillStyle='red';x.fillRect(0,0,10,10);return c.toDataURL().split(',')[1]});+ let count=0;+ await page.route('**/api/upload',async route=>{const n=++count;await pause(n===1?1200:100);await route.fulfill({json:{ok:true,path:`/upload-${n}.png`}})});+ const input=page.locator('input[type=file]').last();+ await input.setInputFiles({name:'first.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ await pause(150);+ await input.setInputFiles({name:'second.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ await pause(1800);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'/upload-2.png');+ await input.setInputFiles({name:'third.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ await page.getByRole('button',{name:'Clear screenshot',exact:true}).click();+ await pause(850);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'');await page.close();+ });+ await check('feature graphic background, contrast, and selection match inspector',async()=>{+ const {page}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('banner one',{layout:'feature-graphic'}),slide('banner two',{layout:'feature-graphic'})]}}));+ const inspector=page.locator('aside').last();+ await inspector.getByRole('combobox').nth(1).click();+ await page.getByRole('option',{name:'Custom color',exact:true}).click();+ await page.getByRole('textbox',{name:'Custom background hex color',exact:true}).fill('#FFFFFF');+ const caption=page.locator('main [contenteditable=plaintext-only]').first();+ assert.equal(await caption.evaluate(el=>getComputedStyle(el).color),'rgb(23, 23, 23)');+ assert.equal(await caption.evaluate(el=>getComputedStyle(el.parentElement.parentElement.parentElement).backgroundColor),'rgb(255, 255, 255)');+ await page.locator('main [contenteditable=plaintext-only]').nth(1).focus();+ assert.match(await page.locator('main').innerText(),/Screen 2/);+ assert.equal(await page.locator('textarea').first().inputValue(),'banner two');+ await page.close();+ });+ await check('connected overlays split across PNG crops; isolated mode clips them',async()=>{+ const JSZip=require('jszip');+ for(const connectedCanvas of [true,false]) {+ const {page}=await open(fixture({connectedCanvas}));+ const src=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=10;c.height=10;const ctx=c.getContext('2d');ctx.fillStyle='#ff0000';ctx.fillRect(0,0,10,10);return c.toDataURL()});+ await page.close();+ const probe=await open(fixture({connectedCanvas,slidesByDevice:{watchos:[slide('left',{label:{},headline:{},imageElements:[{id:'cross',src,transform:{x:350,y:220,width:144,height:80,zIndex:10}}]}),slide('right',{label:{},headline:{}})]}}));+ const download=probe.page.waitForEvent('download');+ await probe.page.getByRole('button',{name:'Export bundle',exact:true}).click();+ const file=await (await download).path();const zip=await JSZip.loadAsync(await fs.readFile(file));+ const image=await zip.file('ios/watchos/422x514/en/02-no-device.png').async('base64');+ const pixel=await probe.page.evaluate(async data=>{const img=new Image();img.src='data:image/png;base64,'+data;await img.decode();const c=document.createElement('canvas');c.width=422;c.height=514;const ctx=c.getContext('2d');ctx.drawImage(img,0,0);return Array.from(ctx.getImageData(25,250,1,1).data)},image);+ assert.equal(pixel[0]===255&&pixel[1]===0&&pixel[2]===0,connectedCanvas);+ await probe.page.close();+ }+ });+ await check('every device exports real images at its advertised sizes',async()=>{+ const JSZip=require('jszip');+ const devices=['iphone','ipad','tvos','watchos','carplay','mac','android','android-7','android-10','feature-graphic'];+ for(const device of devices) {+ const bootstrap=await open();+ const src=await bootstrap.page.evaluate(()=>{const c=document.createElement('canvas');c.width=200;c.height=400;const x=c.getContext('2d');x.fillStyle='#ff00ff';x.fillRect(0,0,200,400);return c.toDataURL()});+ await bootstrap.page.close();+ const {page}=await open(fixture({device,appIcon:src,slidesByDevice:{[device]:[slide('device',{layout:device==='feature-graphic'?'feature-graphic':'hero',screenshot:src})]}}));+ const downloaded=page.waitForEvent('download');+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ const file=await (await downloaded).path();const zip=await JSZip.loadAsync(await fs.readFile(file));+ const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));+ const expected={iphone:4,ipad:2,tvos:2,watchos:6,carplay:4,mac:4,android:1,'android-7':1,'android-10':1,'feature-graphic':1};+ assert.equal(pngs.length,expected[device],device);+ for(const png of pngs) {+ const bytes=await png.async('nodebuffer');const [,w,h]=png.name.match(/\/(\d+)x(\d+)\//);+ assert.equal(bytes.readUInt32BE(16),Number(w));assert.equal(bytes.readUInt32BE(20),Number(h));+ }+ const pixels=await page.evaluate(async data=>{const image=new Image();image.src='data:image/png;base64,'+data;await image.decode();const c=document.createElement('canvas');c.width=50;c.height=50;const x=c.getContext('2d');x.drawImage(image,0,0,50,50);const p=x.getImageData(0,0,50,50).data;let n=0;for(let i=0;i<p.length;i+=4)if(p[i]>230&&p[i+1]<30&&p[i+2]>230)n++;return n},await pngs[0].async('base64'));+ assert.ok(pixels>5,`${device}: screenshot missing from rendered PNG`);+ await page.close();+ }+ });+ await check('malformed generated project does not crash or autosave over disk',async()=>{+ let writes=0;+ const {page}=await open(fixture({locales:'en'}),async()=>{writes++});+ await page.getByText('save failed',{exact:false}).waitFor();+ await pause(800); assert.equal(writes,0); await page.close();+ });+ await check('project API rejects invalid data without overwriting valid state',async()=>{+ const context=await browser.newContext();const request=context.request;+ const original=await request.get(baseURL+'/api/project'); const payload=await original.json();+ assert.equal(original.status(),200);+ for(const body of [null,[],{},fixture({device:'bad'}),fixture({slidesByDevice:{watchos:[null]}})]) {+ const response=await request.post(baseURL+'/api/project',{data:JSON.stringify(body),headers:{'content-type':'application/json'}});+ assert.equal(response.status(),400);+ }+ const after=await request.get(baseURL+'/api/project');assert.deepEqual((await after.json()).state,payload.state);+ const saved=await request.post(baseURL+'/api/project',{data:payload.state});assert.equal(saved.status(),200);+ const roundTrip=await request.get(baseURL+'/api/project');assert.deepEqual((await roundTrip.json()).state,payload.state);+ await context.close();+ });+ await check('out-of-bounds elements export where the editor shows them',async()=>{+ const {page}=await open(fixture({connectedCanvas:false,slidesByDevice:{watchos:[slide('a',{textElements:[{id:'t1',text:{en:'WIDE'},transform:{x:300,y:10,width:300,height:80,zIndex:6}}]})]}}));+ const editorX=await page.locator('main .rnd-editable').last().evaluate(el=>new DOMMatrix(getComputedStyle(el).transform).m41);+ const exportX=await page.locator('[aria-hidden] [contenteditable=false]').filter({hasText:'WIDE'}).last().evaluate(el=>parseFloat(el.closest('div[style*="z-index"]').style.left));+ assert.equal(exportX,editorX); await page.close();+ });+ await check('clearing inline copy saves nothing and shows the fallback after blur',async()=>{+ const {page,latest}=await open(fixture({locales:['en','de'],locale:'de',slidesByDevice:{watchos:[slide('a',{headline:{en:'English',de:'Deutsch'}})]}}));+ const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);+ await headline.click(); await page.keyboard.press('ControlOrMeta+A'); await page.keyboard.press('Backspace');+ await page.locator('textarea').first().click(); await pause(900);+ assert.equal(latest().slidesByDevice.watchos[0].headline.de,undefined);+ assert.equal(await headline.textContent(),'English'); await page.close();+ });+ await check('overlay text can be cleared and retyped in a non-default locale',async()=>{+ const {page,latest}=await open(fixture({locales:['en','de'],locale:'de',slidesByDevice:{watchos:[slide('a',{textElements:[{id:'t1',text:{en:'Hello'},transform:{x:10,y:10,width:300,height:80,zIndex:6}}]})]}}));+ await page.locator('main [contenteditable=plaintext-only]').nth(2).focus();+ const text=page.getByRole('textbox',{name:'Overlay text',exact:true});+ assert.equal(await text.inputValue(),''); assert.equal(await text.getAttribute('placeholder'),'Hello');+ await text.fill('Hallo'); await pause(900);+ assert.deepEqual(latest().slidesByDevice.watchos[0].textElements[0].text,{en:'Hello',de:'Hallo'}); await page.close();+ });+ await check('RTL copy gets its own base direction',async()=>{+ const {page}=await open(fixture({locales:['en','he'],locale:'he',slidesByDevice:{watchos:[slide('a',{headline:{en:'Hi',he:'שלום עולם!'}})]}}));+ const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);+ assert.equal(await headline.evaluate(el=>getComputedStyle(el).direction),'rtl');+ assert.equal(await page.locator('main [contenteditable=plaintext-only]').first().evaluate(el=>getComputedStyle(el).direction),'ltr'); await page.close();+ });+ await check('generated feature-graphic decks normalise without an undo step',async()=>{+ const {page,latest}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('one',{layout:'hero'}),slide('two',{layout:'hero'})]}}));+ await pause(1000);+ assert.equal(await page.getByRole('button',{name:'Undo',exact:true}).isEnabled(),false);+ assert.deepEqual(latest().slidesByDevice['feature-graphic'].map(s=>s.layout),['feature-graphic','feature-graphic']); await page.close();+ });+ await check('feature graphic app icon can be picked and exports',async()=>{+ const JSZip=require('jszip');+ const {page,latest}=await open(fixture({device:'feature-graphic',slidesByDevice:{'feature-graphic':[slide('banner',{layout:'feature-graphic'})]}}));+ const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=64;c.height=64;const x=c.getContext('2d');x.fillStyle='#00ff00';x.fillRect(0,0,64,64);return c.toDataURL().split(',')[1]});+ await page.route('**/api/upload',route=>route.fulfill({json:{ok:true,path:'/bugbash-icon.png'}}));+ await page.locator('aside').last().locator('input[type=file]').setInputFiles({name:'icon.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ await pause(900); assert.equal(latest().appIcon,'/bugbash-icon.png');+ const downloaded=page.waitForEvent('download');+ await page.route('**/bugbash-icon.png',route=>route.fulfill({body:Buffer.from(png,'base64'),contentType:'image/png'}));+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));+ const image=await Object.values(zip.files).find(f=>f.name.endsWith('.png')).async('base64');+ const green=await page.evaluate(async data=>{const img=new Image();img.src='data:image/png;base64,'+data;await img.decode();const c=document.createElement('canvas');c.width=img.width;c.height=img.height;const x=c.getContext('2d');x.drawImage(img,0,0);const p=x.getImageData(0,0,c.width,c.height).data;let n=0;for(let i=0;i<p.length;i+=4)if(p[i]<30&&p[i+1]>225&&p[i+2]<30)n++;return n},image);+ assert.ok(green>1000,'icon missing from feature graphic export'); await page.close();+ });+ await check('reset all devices keeps project settings and locales',async()=>{+ const {page,latest}=await open(fixture({appName:'Keep me',themeId:'dark-bold',locales:['en','de'],locale:'de',connectedCanvas:false}));+ await page.getByRole('button',{name:/reset/i}).first().click();+ await page.getByRole('button',{name:'Reset all devices',exact:true}).click(); await pause(900);+ const state=latest();+ assert.equal(state.appName,'Keep me'); assert.equal(state.themeId,'dark-bold'); assert.deepEqual(state.locales,['en','de']);+ assert.equal(state.locale,'de'); assert.equal(state.connectedCanvas,false); assert.equal(state.device,'watchos');+ assert.notEqual(state.slidesByDevice.watchos[0].id,'first'); await page.close();+ });+ await check('pasted rich text stays plain on the canvas',async()=>{+ const context=await browser.newContext({viewport:{width:1600,height:1000}});+ await context.grantPermissions(['clipboard-read','clipboard-write'],{origin:new URL(baseURL).origin});+ const page=await context.newPage(); let latest=fixture();+ page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});+ await page.goto(baseURL); await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ await page.evaluate(async()=>navigator.clipboard.write([new ClipboardItem({'text/html':new Blob(['<span style="color:red;font-size:80px">Pasted</span>'],{type:'text/html'}),'text/plain':new Blob(['Pasted'],{type:'text/plain'})})]));+ const headline=page.locator('main [contenteditable=plaintext-only]').nth(1);+ await headline.click(); await page.keyboard.press('ControlOrMeta+A'); await page.keyboard.press('ControlOrMeta+V'); await pause(900);+ assert.equal(await headline.evaluate(el=>el.children.length),0); assert.equal(await headline.textContent(),'Pasted');+ assert.equal(latest.slidesByDevice.watchos[0].headline.en,'Pasted'); await context.close();+ });+ await check('export finishes inline when PNG workers fail to load',async()=>{+ const JSZip=require('jszip');+ const context=await browser.newContext({viewport:{width:1600,height:1000}});+ // A worker whose script never loads: it reports an error and never replies.+ await context.addInitScript(()=>{window.Worker=class extends EventTarget{constructor(){super();setTimeout(()=>this.onerror?.(new ErrorEvent('error',{message:'blocked'})),200)}postMessage(){}terminate(){}}});+ const page=await context.newPage(); let latest=fixture();+ page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});+ await page.goto(baseURL); await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ const downloaded=page.waitForEvent('download',{timeout:60000});+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));+ const pngs=Object.values(zip.files).filter(f=>f.name.endsWith('.png'));+ assert.equal(pngs.length,12);+ for(const png of pngs) assert.equal((await png.async('nodebuffer'))[25],2);+ await context.close();+ });+ await check('rejected image uploads keep the previous screenshot instead of bypassing validation',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero',screenshot:'/previous.png'})]}}));+ const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=c.height=10;return c.toDataURL().split(',')[1]});+ await page.route('**/api/upload',route=>route.fulfill({status:400,json:{ok:false,error:'Rejected image'}}));+ await page.locator('input[type=file]').last().setInputFiles({name:'test.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ await page.getByText('Rejected image',{exact:true}).waitFor();+ await pause(800); assert.equal(latest().slidesByDevice.watchos[0].screenshot,'/previous.png');+ await page.close();+ });+ await check('corrupt images and fonts are rejected before upload',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('upload',{layout:'hero'})]}}));+ let uploads=0;+ await page.route('**/api/upload*',route=>{uploads++;return route.fulfill({status:400,json:{ok:false}})});+ await page.locator('input[type=file]').last().setInputFiles({name:'broken.png',mimeType:'image/png',buffer:Buffer.from('iVBORw0KGgo=','base64')});+ await page.getByText('Image is corrupt or exceeds 64 megapixels',{exact:true}).waitFor();+ await page.locator('input[type=file]').first().setInputFiles({name:'broken.woff2',mimeType:'font/woff2',buffer:Buffer.from('wOF2')});+ await page.getByText('Font import failed',{exact:true}).waitFor();+ assert.equal(uploads,0);assert.equal(latest().slidesByDevice.watchos[0].screenshot,'');+ assert.equal(await page.getByRole('button',{name:'Export bundle',exact:true}).isEnabled(),true);await page.close();+ });+ await check('HTTP 200 with corrupt image bytes blocks export',async()=>{+ const {page}=await open(fixture({slidesByDevice:{watchos:[slide('corrupt',{layout:'hero',screenshot:'/corrupt.png'})]}}));+ await page.route('**/corrupt.png',route=>route.fulfill({contentType:'image/png',body:'not an image'}));+ let downloads=0;page.on('download',()=>downloads++);+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ await page.getByText('Export failed',{exact:true}).waitFor();+ assert.equal(downloads,0);assert.equal(await page.locator('[inert]').count(),0);await page.close();+ });+ await check('failed saves can be retried without another edit; dirty edits warn before leaving',async()=>{+ const {page}=await open();+ await pause(800);+ let failing=true,writes=0,latest;+ await page.route('**/api/project',async route=>{+ writes++;latest=route.request().postDataJSON();+ await route.fulfill({status:failing?500:200,json:{ok:!failing,error:failing?'Disk temporarily unavailable':undefined}});+ });+ await page.getByRole('textbox',{name:'App name',exact:true}).fill('Unsaved work');+ const dirty=()=>page.evaluate(()=>{const event=new Event('beforeunload',{cancelable:true});window.dispatchEvent(event);return event.defaultPrevented});+ assert.equal(await dirty(),true);+ await page.getByRole('button',{name:'Retry save',exact:true}).waitFor();+ assert.equal(await dirty(),true); failing=false;+ await page.getByRole('button',{name:'Retry save',exact:true}).click();+ await pause(900);assert.equal(writes,2);assert.equal(latest.appName,'Unsaved work');assert.equal(await dirty(),false);+ await page.close();+ });+ await check('older in-flight save advances the revision for newer queued edits',async()=>{+ const {page}=await open();await pause(800);+ const headers=[];let count=0;+ await page.route('**/api/project',async route=>{+ const n=++count;headers.push(route.request().headers()['if-match']);+ if(n===1)await pause(1600);+ await route.fulfill({headers:{etag:`"revision-${n}"`},json:{ok:true}});+ });+ await page.getByRole('textbox',{name:'App name',exact:true}).fill('older');await pause(800);+ await page.getByRole('textbox',{name:'App name',exact:true}).fill('newer');await pause(2200);+ assert.deepEqual(headers,[undefined,'"revision-1"']);await page.close();+ });+ await check('two real editor tabs cannot silently overwrite each other',async()=>{+ const original=await (await fetch(baseURL+'/api/project')).json();+ const save=state=>fetch(baseURL+'/api/project',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(state)});+ const pages=[];+ try {+ assert.equal((await save(fixture())).status,200);+ for(let i=0;i<2;i++){+ const page=await browser.newPage({viewport:{width:1600,height:1000}});pages.push(page);+ page.on('pageerror',error=>errors.push(error.message));+ await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();await pause(800);+ }+ await pages[0].getByRole('textbox',{name:'App name',exact:true}).fill('Winner');await pause(900);+ await pages[1].getByRole('textbox',{name:'App name',exact:true}).fill('Keep my edits');+ await pages[1].getByText(/Project changed in another tab or on disk/).waitFor();+ assert.equal((await (await fetch(baseURL+'/api/project')).json()).state.appName,'Winner');+ assert.equal(await pages[1].getByRole('textbox',{name:'App name',exact:true}).inputValue(),'Keep my edits');+ } finally {for(const page of pages)await page.close();assert.equal((await save(original.state)).status,200);}+ });+ await check('silent and throwing PNG workers fall back instead of hanging export',async()=>{+ for(const mode of ['silent','throw']) {+ const context=await browser.newContext({viewport:{width:1600,height:1000}});+ await context.addInitScript(mode=>{window.Worker=class extends EventTarget{postMessage(){if(mode==='throw')throw new Error('cannot post')}terminate(){}}},mode);+ const page=await context.newPage();page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state:fixture({slidesByDevice:{watchos:[slide('one')]}})}}));+ await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ const downloaded=page.waitForEvent('download',{timeout:45000});+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();await downloaded;+ await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();assert.equal(await page.locator('[inert]').count(),0);+ await context.close();+ }+ });+ await check('a stalled asset cannot keep the editor loading forever',async()=>{+ const page=await browser.newPage({viewport:{width:1600,height:1000}});+ const state=fixture({slidesByDevice:{watchos:[slide('one',{layout:'hero',screenshot:'/stalled.png'})]}});+ page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state}}));+ await page.route('**/stalled.png',()=>{});+ await page.goto(baseURL,{waitUntil:'domcontentloaded'});+ await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor({timeout:20000});+ await page.getByText('Image not found at /stalled.png',{exact:true}).waitFor();await page.close();+ });+ await check('a stalled font load releases export controls with an actionable error',async()=>{+ const page=await browser.newPage({viewport:{width:1600,height:1000}});+ page.on('pageerror',error=>errors.push(error.message));+ await page.addInitScript(()=>{+ document.fonts.load=()=>new Promise(()=>{});+ const original=window.setTimeout;+ window.setTimeout=(fn,delay,...args)=>original(fn,delay===15000?250:delay,...args);+ });+ const state=fixture({fontId:'self-hosted',importedFont:{src:'/fonts/imported/0123456789abcdef.woff2',format:'woff2'}});+ await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state}}));+ await page.route('**/fonts/imported/**',route=>route.abort());+ await page.goto(baseURL);+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ await page.getByText(/The screenshot font could not be loaded/).waitFor({timeout:5000});+ assert.equal(await page.locator('[inert]').count(),0);await page.close();+ });+ await check('narrow screens retain a usable canvas and scrollable inspector',async()=>{+ const {page}=await open();await page.setViewportSize({width:390,height:844});+ const main=await page.locator('main').boundingBox();assert.ok(main.height>=360);+ assert.equal(await page.locator('main').evaluate(el=>el.parentElement.scrollHeight>el.parentElement.clientHeight),true);+ await page.locator('textarea').first().fill('Mobile edit');assert.equal(await page.locator('textarea').first().inputValue(),'Mobile edit');await page.close();+ });+ await check('encoding failures are handled while a previous screen is still encoding',async()=>{+ const context=await browser.newContext({viewport:{width:1600,height:1000}});+ await context.addInitScript(()=>{+ window.CompressionStream=class{constructor(){throw new Error('encoder unavailable')}};+ window.Worker=class extends EventTarget{postMessage({id}){setTimeout(()=>this.onmessage?.({data:{id,error:'worker failed'}}),id<6?2000:0)}terminate(){}};+ });+ const page=await context.newPage();page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',route=>route.fulfill({json:{ok:true,state:fixture()}}));+ await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ let downloads=0;page.on('download',()=>downloads++);+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ await page.getByText('All 12 renders failed',{exact:true}).waitFor();+ assert.equal(downloads,0);assert.equal(await page.locator('[inert]').count(),0);await context.close();+ });+ await check('newest font import wins when responses arrive out of order',async()=>{+ const {page,latest}=await open();+ const fontURL=await page.locator('link[as=font]').first().getAttribute('href');+ const fontBytes=await (await page.request.get(baseURL+fontURL)).body();+ let count=0;+ await page.route('**/api/upload-font',async route=>{const n=++count;await pause(n===1?1200:100);await route.fulfill({json:{ok:true,font:{src:`/fonts/imported/${n}.woff2`,format:'woff2'}}})});+ await page.locator('input[type=file]').first().setInputFiles({name:'Older.woff2',mimeType:'font/woff2',buffer:fontBytes});await pause(200);+ await page.locator('input[type=file]').first().setInputFiles({name:'Newer.woff2',mimeType:'font/woff2',buffer:fontBytes});await pause(2000);+ assert.equal(count,2);assert.equal(latest().importedFont.name,'Newer');assert.equal(latest().importedFont.src,'/fonts/imported/2.woff2');await page.close();+ });+ await check('real image and font uploads survive reload and export',async()=>{+ const original=await (await fetch(baseURL+'/api/project')).json();+ const save=state=>fetch(baseURL+'/api/project',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(state)});+ const page=await browser.newPage({viewport:{width:1600,height:1000}});+ page.on('pageerror',error=>errors.push(error.message));+ try {+ await save(fixture({slidesByDevice:{watchos:[slide('real upload',{layout:'hero'})]}}));+ await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ const png=await page.evaluate(()=>{const c=document.createElement('canvas');c.width=80;c.height=120;const x=c.getContext('2d');x.fillStyle='#ee00aa';x.fillRect(0,0,80,120);return c.toDataURL().split(',')[1]});+ const uploaded=page.waitForResponse(r=>r.url().endsWith('/api/upload')&&r.request().method()==='POST');+ await page.locator('input[type=file]').last().setInputFiles({name:'real.png',mimeType:'image/png',buffer:Buffer.from(png,'base64')});+ assert.equal((await uploaded).status(),200);+ const fontURL=await page.locator('link[as=font]').first().getAttribute('href');+ const fontBytes=await (await page.request.get(baseURL+fontURL)).body();+ await page.locator('input[type=file]').first().setInputFiles({name:'Runtimefont.woff2',mimeType:'font/woff2',buffer:fontBytes});+ await page.getByText('Imported Runtimefont',{exact:true}).waitFor();await pause(1000);+ const disk=(await (await fetch(baseURL+'/api/project')).json()).state;+ assert.ok(disk.slidesByDevice.watchos[0].screenshot.startsWith('/screenshots/uploaded/'));+ assert.equal(disk.importedFont.name,'Runtimefont');+ await page.reload();await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ assert.match(await page.getByRole('combobox',{name:'Screenshot font',exact:true}).innerText(),/Runtimefont/);+ const downloaded=page.waitForEvent('download');+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();+ const JSZip=require('jszip');+ const zip=await JSZip.loadAsync(await fs.readFile(await (await downloaded).path()));+ assert.equal(Object.values(zip.files).filter(f=>f.name.endsWith('.png')).length,6);+ } finally {await page.close();await save(original.state);}+ });+ assert.deepEqual(errors,[]);+ assert.ok(passed>0,'No matching checks');+ console.log(`${passed} browser regression checks passed in Google Chrome.`);+ } finally { await browser.close(); }+})().catch(error=>{console.error(error);process.exitCode=1});diff --git a/skills/app-store-screenshots/template/tests/harness/migration-fixture.cjs b/skills/app-store-screenshots/template/tests/harness/migration-fixture.cjsnew file mode 100644index 0000000..8747bdb--- /dev/null+++ b/skills/app-store-screenshots/template/tests/harness/migration-fixture.cjs@@ -0,0 +1,166 @@+// Migration recipe from the shipped skill; keep in sync with SKILL.md.+const fs = require("fs");+const path = require("path");++const PROJECT_FILE = "app-store-screenshots.json";+const DEFAULT_LOCALE = "en";+const DEVICE_KEYS = ["iphone", "ipad", "tvos", "watchos", "carplay", "mac", "android", "android-7", "android-10", "feature-graphic"];+const LAYOUTS = ["hero", "device-bottom", "device-top", "two-devices", "no-device", "split-landscape", "feature-graphic"];++function readJson(file) {+ try {+ return JSON.parse(fs.readFileSync(file, "utf8"));+ } catch {+ return null;+ }+}++const templateState =+ readJson(path.join(process.env.BACKUP_DIR || "", "template-app-store-screenshots.json")) ||+ readJson(PROJECT_FILE) ||+ {};+const existingState = readJson(PROJECT_FILE) || {};+const hasExplicitConnectedCanvas = typeof existingState.connectedCanvas === "boolean";+const existingDecks =+ existingState.slidesByDevice && typeof existingState.slidesByDevice === "object" && !Array.isArray(existingState.slidesByDevice)+ ? existingState.slidesByDevice+ : {};+const hasExistingDecks = Object.keys(existingDecks).length > 0;+const state = {+ ...templateState,+ ...existingState,+ slidesByDevice: hasExistingDecks ? existingDecks : templateState.slidesByDevice || {},+};++const legacySlides =+ Array.isArray(existingState.slides) ? existingState.slides :+ Array.isArray(existingState.screens) ? existingState.screens :+ Array.isArray(existingState.features) ? existingState.features :+ null;++if (legacySlides && !hasExistingDecks) {+ state.slidesByDevice = {+ iphone: legacySlides,+ };+}++function localized(value) {+ if (typeof value === "string") return { [DEFAULT_LOCALE]: value };+ if (value && typeof value === "object" && !Array.isArray(value)) {+ return Object.fromEntries(Object.entries(value).filter(([, text]) => typeof text === "string"));+ }+ return {};+}++function cleanTransform(value) {+ if (!value || typeof value !== "object") return undefined;+ const { x, y, width, height, rotation, zIndex } = value;+ if (![x, y, width, height].every((n) => typeof n === "number" && Number.isFinite(n))) return undefined;+ return {+ x,+ y,+ width: Math.max(1, width),+ height: Math.max(1, height),+ ...(typeof rotation === "number" && Number.isFinite(rotation) ? { rotation } : {}),+ ...(typeof zIndex === "number" && Number.isFinite(zIndex) ? { zIndex } : {}),+ };+}++function firstString(...values) {+ return values.find((value) => typeof value === "string") || "";+}++// The editor refuses to load a deck with empty or repeated screen ids.+function uniqueId(value, used) {+ let id = typeof value === "string" && value.trim() ? value : "";+ while (!id || used.has(id)) id = `migrated-${Math.random().toString(36).slice(2, 10)}`;+ used.add(id);+ return id;+}++function migrateSlide(slide, used) {+ if (!slide || typeof slide !== "object" || Array.isArray(slide)) return null;+ const transforms = {};+ const rawTransforms = slide.transforms && typeof slide.transforms === "object" ? slide.transforms : {};+ for (const [id, transform] of Object.entries(rawTransforms)) {+ const cleaned = cleanTransform(transform);+ if (["caption", "device", "deviceSecondary"].includes(id) && cleaned) transforms[id] = cleaned;+ }+ const textIds = new Set();+ const textElements = Array.isArray(slide.textElements)+ ? slide.textElements+ .map((element) => {+ if (!element || typeof element !== "object" || Array.isArray(element)) return null;+ const transform = cleanTransform(element.transform);+ if (!transform) return null;+ return {+ ...element,+ id: uniqueId(element.id, textIds),+ text: localized(element.text),+ transform,+ fontSize: Number.isFinite(element.fontSize) && element.fontSize > 0 ? element.fontSize : undefined,+ fontWeight: Number.isFinite(element.fontWeight) && element.fontWeight > 0 ? element.fontWeight : undefined,+ };+ })+ .filter(Boolean)+ : undefined;++ const imageIds = new Set();+ const imageElements = Array.isArray(slide.imageElements)+ ? slide.imageElements.map((element) => {+ if (!element || typeof element !== "object" || Array.isArray(element) || typeof element.src !== "string") return null;+ const transform = cleanTransform(element.transform);+ return transform ? { ...element, id: uniqueId(element.id, imageIds), transform } : null;+ }).filter(Boolean)+ : undefined;++ return {+ ...slide,+ id: uniqueId(slide.id, used),+ layout: LAYOUTS.includes(slide.layout) ? slide.layout : "device-bottom",+ label: localized(slide.label),+ headline: localized(slide.headline || slide.title || slide.caption || slide.copy),+ screenshot: firstString(slide.screenshot, slide.image, slide.src, slide.path),+ screenshotSecondary: typeof slide.screenshotSecondary === "string" ? slide.screenshotSecondary : undefined,+ inverted: typeof slide.inverted === "boolean" ? slide.inverted : undefined,+ ...(Object.keys(transforms).length ? { transforms } : { transforms: undefined }),+ ...(textElements && textElements.length ? { textElements } : { textElements: undefined }),+ ...(imageElements && imageElements.length ? { imageElements } : { imageElements: undefined }),+ };+}++state.schemaVersion = 2;+state.connectedCanvas = hasExplicitConnectedCanvas ? existingState.connectedCanvas : false;+// Unique codes like "en", "pt-BR", "zh_Hans"; anything else makes the editor refuse the file.+const LOCALE_CODE = /^[a-zA-Z0-9]+(?:[-_][a-zA-Z0-9]+)*$/;+state.locales = Array.isArray(state.locales)+ ? [...new Set(state.locales.filter((locale) => typeof locale === "string" && LOCALE_CODE.test(locale)))]+ : [];+if (!state.locales.length) state.locales = [DEFAULT_LOCALE];+state.locale = state.locales.includes(state.locale) ? state.locale : state.locales[0];+state.device = DEVICE_KEYS.includes(state.device) ? state.device : "iphone";+if (state.orientation !== "portrait" && state.orientation !== "landscape") delete state.orientation;+for (const key of ["appName", "themeId", "appIcon"]) {+ if (state[key] !== undefined && typeof state[key] !== "string") delete state[key];+}+// The feature graphic only shows an icon that `appIcon` points at.+if (!state.appIcon && fs.existsSync(path.join("public", "app-icon.png"))) state.appIcon = "/app-icon.png";++if (state.slidesByDevice && typeof state.slidesByDevice === "object") {+ for (const [device, slides] of Object.entries(state.slidesByDevice)) {+ // The editor only accepts known device decks; the backup keeps the original.+ if (!DEVICE_KEYS.includes(device)) {+ delete state.slidesByDevice[device];+ continue;+ }+ const used = new Set();+ state.slidesByDevice[device] = Array.isArray(slides) ? slides.map((slide) => migrateSlide(slide, used)).filter(Boolean) : [];+ }+}++if (!state.slidesByDevice[state.device]) {+ const firstDeviceWithSlides = DEVICE_KEYS.find((device) => state.slidesByDevice[device]?.length);+ if (firstDeviceWithSlides) state.device = firstDeviceWithSlides;+}++fs.writeFileSync(PROJECT_FILE, JSON.stringify(state, null, 2) + "\n");diff --git a/skills/app-store-screenshots/template/tests/harness/run.cjs b/skills/app-store-screenshots/template/tests/harness/run.cjsnew file mode 100644index 0000000..d5bad59--- /dev/null+++ b/skills/app-store-screenshots/template/tests/harness/run.cjs@@ -0,0 +1,8 @@+const { spawnSync } = require('node:child_process');+const path = require('node:path');+const base = process.argv[2];+if (!base) throw new Error('Provide the URL of a disposable server (never your working editor).');+for (const script of ['api-bug-bash.cjs', 'ui-bug-bash.cjs', 'bug-bash.cjs']) {+ const result = spawnSync(process.execPath, [path.join(__dirname, script), base], { stdio: 'inherit' });+ if (result.status !== 0) process.exit(result.status ?? 1);+}diff --git a/skills/app-store-screenshots/template/tests/harness/ui-bug-bash.cjs b/skills/app-store-screenshots/template/tests/harness/ui-bug-bash.cjsnew file mode 100644index 0000000..4124366--- /dev/null+++ b/skills/app-store-screenshots/template/tests/harness/ui-bug-bash.cjs@@ -0,0 +1,168 @@+// Interaction-focused Chrome bug bash. Uses disposable, mocked project state.+// PLAYWRIGHT_MODULE=/path/to/playwright node scripts/ui-bug-bash.cjs http://localhost:3098+const assert = require('node:assert/strict');+const { chromium } = require(process.env.PLAYWRIGHT_MODULE || 'playwright');+const baseURL = (process.argv[2] || 'http://localhost:3098').replace(/\/$/, '');+const pause = ms => new Promise(resolve=>setTimeout(resolve,ms));+const slide = (id, extra={})=>({id,layout:'no-device',label:{en:'LABEL'},headline:{en:id},screenshot:'',...extra});+const rect = {x:100,y:200,width:160,height:90,zIndex:6};+const fixture=(extra={})=>({schemaVersion:2,appName:'UI bug bash',themeId:'clean-light',connectedCanvas:true,device:'watchos',orientation:'portrait',locale:'en',locales:['en','de'],slidesByDevice:{watchos:[slide('First'),slide('Second'),slide('Third')],android:[slide('Android')],iphone:[slide('iPhone')]},...extra});+(async()=>{+ const browser=await chromium.launch({channel:'chrome',headless:true});+ const errors=[];let passed=0,failures=0;+ async function open(state=fixture(),viewport={width:1600,height:1000},options={}) {+ const page=await browser.newPage({viewport,...options});let latest=structuredClone(state);+ page.on('pageerror',error=>errors.push(error.message));+ await page.route('**/api/project',async route=>{if(route.request().method()==='POST')latest=route.request().postDataJSON();await route.fulfill({json:{ok:true,state:latest}})});+ await page.goto(baseURL);await page.getByRole('button',{name:'Export bundle',exact:true}).waitFor();+ return {page,latest:()=>latest};+ }+ async function check(name,run) {+ if(process.env.BUG_BASH_FILTER&&!name.includes(process.env.BUG_BASH_FILTER))return;+ try{await run();passed++;console.log('PASS',name)}catch(error){failures++;console.error('FAIL',name,error.message)}+ }+ try {+ await check('Escape cancels a draft text size without changing the canvas',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Text',{textElements:[{id:'t',text:{en:'Overlay'},fontSize:26,transform:rect}]})]}}));+ await page.locator('main [contenteditable=plaintext-only]').last().focus();+ const input=page.getByRole('spinbutton',{name:'Text size in pixels',exact:true});+ await input.fill('100');await input.press('Escape');await pause(800);+ assert.equal(latest().slidesByDevice.watchos[0].textElements[0].fontSize,26);+ await page.close();+ });+ await check('exploring layouts keeps the chosen secondary screenshot',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Pair',{layout:'two-devices',screenshot:'/front.png',screenshotSecondary:'/back.png'})]}}));+ const layout=page.locator('aside').last().getByRole('combobox').first();+ await layout.click();await page.getByRole('option',{name:'Hero',exact:true}).click();+ await layout.click();await page.getByRole('option',{name:'Two devices',exact:true}).click();await pause(800);+ assert.equal(latest().slidesByDevice.watchos[0].screenshotSecondary,'/back.png');await page.close();+ });+ await check('keyboard reordering preserves selection, content, and undo',async()=>{+ const {page,latest}=await open();+ await page.getByRole('button',{name:/^Screen 2/}).click();+ const handle=page.getByRole('button',{name:/^Reorder screen 2/});+ await handle.focus();await page.keyboard.press('Space');await pause(100);+ await page.keyboard.press('ArrowUp');await page.getByRole('status').filter({hasText:'over droppable area First'}).waitFor();+ await page.keyboard.press('Space');await pause(900);+ assert.deepEqual(latest().slidesByDevice.watchos.map(s=>s.id),['Second','First','Third']);+ assert.equal(await page.locator('textarea').first().inputValue(),'Second');+ await page.getByRole('button',{name:'Undo',exact:true}).click();await pause(800);+ assert.deepEqual(latest().slidesByDevice.watchos.map(s=>s.id),['First','Second','Third']);await page.close();+ });+ await check('deleting the final slide exposes a usable empty state and can be undone',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Only')]}}));+ await page.getByRole('button',{name:'Delete screen 1',exact:true}).click();+ await page.getByText('No screens yet',{exact:true}).waitFor();+ await page.getByRole('button',{name:'Export bundle',exact:true}).click();await page.getByText('No screens to export',{exact:true}).waitFor();+ assert.equal(await page.locator('[inert]').count(),0);+ await page.getByRole('button',{name:'Undo',exact:true}).first().click();+ assert.equal(await page.locator('textarea').first().inputValue(),'Only');+ await page.getByRole('button',{name:'Delete screen 1',exact:true}).click();await pause(600);+ await page.getByRole('button',{name:'Add screen',exact:true}).click();await pause(800);+ assert.equal(latest().slidesByDevice.watchos.length,1);assert.notEqual(latest().slidesByDevice.watchos[0].id,'Only');await page.close();+ });+ await check('custom background drafts, typography reset, and locale edits stay independent',async()=>{+ const {page,latest}=await open();const inspector=page.locator('aside').last();+ await inspector.getByRole('combobox').nth(1).click();await page.getByRole('option',{name:'Custom color',exact:true}).click();+ const hex=page.getByRole('textbox',{name:'Custom background hex color',exact:true});+ await hex.fill('#123456');await page.locator('textarea').first().click();+ await hex.fill('#12');await page.locator('textarea').first().click();assert.equal(await hex.inputValue(),'#123456');+ const slider=page.getByRole('slider',{name:'Headline size',exact:true});await slider.fill('150');+ await page.getByRole('button',{name:'Reset headline to 100%',exact:true}).click();assert.equal(await slider.inputValue(),'100');+ await page.getByRole('combobox',{name:'Locale',exact:true}).click();await page.getByRole('option',{name:'DE',exact:true}).click();+ await page.locator('textarea').first().fill('Deutsch');await pause(800);+ assert.deepEqual(latest().slidesByDevice.watchos[0].headline,{en:'First',de:'Deutsch'});+ assert.equal(latest().slidesByDevice.watchos[0].backgroundColor,'#123456');+ assert.equal(latest().slidesByDevice.watchos[0].typography,undefined);await page.close();+ });+ await check('canvas drag, resize, rotation, layer controls, delete, and undo persist',async()=>{+ const {page,latest}=await open(fixture({slidesByDevice:{watchos:[slide('Canvas')]}}));+ await page.getByRole('button',{name:'Image',exact:true}).click();await pause(700);+ const selected=page.locator('main .rnd-selected');const before={...latest().slidesByDevice.watchos[0].imageElements[0].transform};+ const box=await selected.boundingBox();const scale=box.width/before.width;+ await page.mouse.move(box.x+box.width/2,box.y+box.height/2);await page.mouse.down();await page.mouse.move(box.x+box.width/2+40,box.y+box.height/2+30,{steps:8});await page.mouse.up();await pause(750);+ const moved=latest().slidesByDevice.watchos[0].imageElements[0].transform;+ assert.ok(Math.abs(moved.x-before.x-40/scale)<2);assert.ok(Math.abs(moved.y-before.y-30/scale)<2);+ const handle=await selected.locator('div[style*="cursor: se-resize"]').boundingBox();+ await page.mouse.move(handle.x+handle.width/2,handle.y+handle.height/2);await page.mouse.down();await page.mouse.move(handle.x+handle.width/2+35,handle.y+handle.height/2+20,{steps:8});await page.mouse.up();await pause(750);+ const resized=latest().slidesByDevice.watchos[0].imageElements[0].transform;+ assert.ok(resized.width>moved.width+10);assert.ok(resized.height>moved.height+5);+ await page.getByRole('slider',{name:'Image rotation',exact:true}).fill('45');+ await page.getByRole('button',{name:'Send to back',exact:true}).click();await pause(750);+ const changed=latest().slidesByDevice.watchos[0];assert.equal(changed.imageElements[0].transform.rotation,45);+ assert.ok(changed.imageElements[0].transform.zIndex<changed.transforms.caption.zIndex);+ await page.getByRole('combobox',{name:'Image fit',exact:true}).click();await page.getByRole('option',{name:'Whole image',exact:true}).click();+ await page.getByRole('combobox',{name:'Edge fade',exact:true}).click();await page.getByRole('option',{name:'From left',exact:true}).click();+ await page.getByRole('slider',{name:'Fade strength',exact:true}).fill('65');await pause(750);+ assert.equal(latest().slidesByDevice.watchos[0].imageElements[0].fit,'contain');assert.deepEqual(latest().slidesByDevice.watchos[0].imageElements[0].fade,{edge:'left',amount:65});+ await page.getByRole('button',{name:'Delete image element',exact:true}).click();await pause(750);+ assert.equal(latest().slidesByDevice.watchos[0].imageElements,undefined);+ await page.getByRole('button',{name:'Undo',exact:true}).click();await pause(750);assert.equal(latest().slidesByDevice.watchos[0].imageElements.length,1);await page.close();+ });+ await check('all devices and layouts render and remain editable in both tablet orientations',async()=>{+ const devices=['iphone','ipad','tvos','watchos','carplay','mac','android','android-7','android-10','feature-graphic'];+ const layouts=['Hero','Device bottom','Device top','Two devices','No device','Split (landscape)'];+ for(const device of devices) {+ const {page,latest}=await open(fixture({device,slidesByDevice:{[device]:[slide('Layout',{layout:device==='feature-graphic'?'feature-graphic':'hero'})]}}));+ for(const orientation of (device==='android-7'||device==='android-10'?['portrait','landscape']:['portrait'])) {+ if(orientation==='landscape'){await page.getByRole('combobox',{name:'Orientation',exact:true}).click();await page.getByRole('option',{name:'Landscape',exact:true}).click();}+ for(const layout of (device==='feature-graphic'?['Feature graphic']:layouts)) {+ await page.getByRole('combobox',{name:'Layout',exact:true}).click();await page.getByRole('option',{name:layout,exact:true}).click();+ const headline=page.getByRole('textbox',{name:device==='feature-graphic'?'Tagline':'Headline',exact:true});+ await headline.fill(`${device} ${orientation} ${layout}`);+ const canvas=page.locator('main');assert.ok((await canvas.boundingBox()).height>0);+ await page.getByRole('button',{name:'Zoom in',exact:true}).click();await page.getByRole('button',{name:'Fit active screen',exact:true}).click();+ }+ }+ await pause(700);assert.equal(latest().device,device);assert.ok(latest().slidesByDevice[device][0].headline.en.includes(device));await page.close();+ }+ });+ await check('Fit active screen recenters a manually panned canvas at default zoom',async()=>{+ const {page}=await open();const scroller=page.locator('main .overflow-auto');await pause(400);+ await scroller.evaluate(el=>el.scrollTo({left:400,behavior:'instant'}));assert.ok(await scroller.evaluate(el=>el.scrollLeft)>100);+ await page.getByRole('button',{name:'Fit active screen',exact:true}).click();await pause(600);+ assert.ok(await scroller.evaluate(el=>el.scrollLeft)<5);await page.close();+ });+ await check('keyboard focus on an image exposes its inspector controls',async()=>{+ const {page}=await open(fixture({slidesByDevice:{watchos:[slide('Image',{imageElements:[{id:'image',src:'',transform:rect}]})]}}));+ await page.locator('main .rnd-editable').last().getByRole('button',{name:'Rotate element',exact:true}).focus();+ assert.equal(await page.getByRole('combobox',{name:'Image fit',exact:true}).count(),1);await page.close();+ });+ await check('responsive widths keep the canvas and inspector usable without page overflow',async()=>{+ const {page,latest}=await open();+ for(const width of [320,390,820,1024,1440]) {+ await page.setViewportSize({width,height:900});await pause(150);+ assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),`page overflows at ${width}px`);+ const canvas=page.locator('main');await canvas.scrollIntoViewIfNeeded();+ const box=await canvas.boundingBox();assert.ok(box.width>=280&&box.height>=250,`canvas too small at ${width}px: ${JSON.stringify(box)}`);+ const headline=page.getByRole('textbox',{name:'Headline',exact:true});await headline.fill(`Width ${width}`);+ if(process.env.BUG_BASH_ARTIFACTS)await page.screenshot({path:`${process.env.BUG_BASH_ARTIFACTS}/ui-${width}.png`,fullPage:true});+ }+ await pause(750);assert.equal(latest().slidesByDevice.watchos[0].headline.en,'Width 1440');await page.close();+ });+ await check('touch tablets expose slide actions without requiring hover',async()=>{+ const {page,latest}=await open(fixture(),{width:820,height:1180},{hasTouch:true});+ const duplicate=page.getByRole('button',{name:'Duplicate screen 1',exact:true});+ assert.ok(Number(await duplicate.locator('..').evaluate(el=>getComputedStyle(el).opacity))>0,'slide actions are invisible on touch');+ await duplicate.tap();await pause(750);assert.equal(latest().slidesByDevice.watchos.length,4);await page.close();+ });+ await check('theme and font menus apply every built-in option and preserve content',async()=>{+ const {page,latest}=await open();+ for(const label of ['Theme','Screenshot font']) {+ const menu=page.getByRole('combobox',{name:label,exact:true});await menu.click();+ const names=(await page.getByRole('option').allTextContents()).filter(name=>!name.includes('Import font'));+ await page.keyboard.press('Escape');+ for(const name of names) {+ await menu.click();await page.getByRole('option',{name,exact:true}).click();+ assert.ok((await menu.innerText()).includes(name));+ assert.equal(await page.getByRole('textbox',{name:'Headline',exact:true}).inputValue(),'First');+ }+ }+ await pause(750);assert.ok(latest().themeId);assert.ok(latest().fontId);await page.close();+ });+ assert.deepEqual(errors,[],'Uncaught browser errors');+ assert.ok(passed+failures>0,'No matching checks');+ assert.equal(failures,0,`${failures} UI checks failed`);+ console.log(`${passed} UI interaction groups passed in Google Chrome.`);+ } finally {await browser.close()}+})().catch(error=>{console.error(error);process.exitCode=1});diff --git a/skills/app-store-screenshots/template/tests/regression.e2e.ts b/skills/app-store-screenshots/template/tests/regression.e2e.tsnew file mode 100644index 0000000..30286e9--- /dev/null+++ b/skills/app-store-screenshots/template/tests/regression.e2e.ts@@ -0,0 +1,27 @@+import { test } from '@e2e-dev/web';+import { expect } from 'e2e';+import { execFile } from 'node:child_process';+import { promisify } from 'node:util';+import path from 'node:path';+import { writeFile, mkdir } from 'node:fs/promises';+const run = promisify(execFile);+for (const script of ['api-bug-bash', 'ui-bug-bash', 'bug-bash']) {+ test(`shipped ${script} regression groups`, { timeout: 900_000 }, async ({ app }) => {+ const log = path.resolve('.e2e/logs', `${script}.log`);+ await mkdir(path.dirname(log), { recursive: true });+ const artifacts = path.resolve('.e2e/artifacts', script);+ await mkdir(artifacts, { recursive: true });+ try {+ const { stdout, stderr } = await run(process.execPath, [path.resolve(`tests/harness/${script}.cjs`), app.baseUrl!], { timeout: 850_000, maxBuffer: 8 * 1024 * 1024, env: { ...process.env, PLAYWRIGHT_MODULE: path.resolve('node_modules/playwright'), BUG_BASH_FILTER: '', BUG_BASH_ARTIFACTS: artifacts } });+ await writeFile(log, stdout + stderr);+ const passed = stdout.match(/^PASS /gm) ?? [];+ await expect(passed.length).toBeGreaterThan(0);+ await expect(stdout + stderr).not.toContain('FAIL ');+ console.log(`${script}: ${passed.length} regression groups passed; evidence ${log}`);+ } catch (error) {+ const output = error as Error & { stdout?: string; stderr?: string };+ await writeFile(log, `${output.stdout ?? ''}${output.stderr ?? ''}\n${output.message}`);+ throw error;+ }+ });+}