[verified] feat: add reusable presentation-derived animation patterns
This commit is contained in:
1 parent
ecbbcf8ba0
commit
5b07a9a3e5
127 files changed
+72164
-157
No files matched your search
@@ -157,7 +157,7 @@ try{for(const variant of ['source','dist'])for(const reducedMotion of ['no-prefe
|
||||
if(variant==='dist'&&reducedMotion==='no-preference'&&(id===ids[0]||id===catalog.find(x=>x.kind==='industry')?.id))await page.waitForFunction(id=>{const s=animeGallery.controllers[id].state();return s.paused&&s.time===s.duration;},id);
|
||||
await page.locator('[data-action="settle"]').click();sameVisual(await visual(),final);
|
||||
if(variant==='dist'&&reducedMotion==='no-preference'&&(id==='assemble-explode'||id===catalog.find(x=>x.kind==='industry')?.id)){
|
||||
await page.locator('article').screenshot({path:path.join(evidence,`animejs-0.6.0-${id}-final.png`)});await call('seek',s.duration*.45);await page.locator('article').screenshot({path:path.join(evidence,`animejs-0.6.0-${id}-mid.png`)});
|
||||
await page.locator('article').screenshot({path:path.join(evidence,`${manifest.package}-${id}-final.png`)});await call('seek',s.duration*.45);await page.locator('article').screenshot({path:path.join(evidence,`${manifest.package}-${id}-mid.png`)});
|
||||
}
|
||||
await call('replay');await page.emulateMedia({reducedMotion:'reduce'});await page.waitForFunction(id=>{const s=animeGallery.controllers[id].state();return s.paused&&s.time===s.duration;},id);await page.emulateMedia({reducedMotion:'no-preference'});
|
||||
for(const event of ['beforeprint','pagehide']){await call('replay');await page.evaluate(event=>dispatchEvent(new Event(event)),event);assert.equal((await state()).paused,true);assert.equal((await state()).time,s.duration);}
|
||||
@@ -175,4 +175,4 @@ try{for(const variant of ['source','dist'])for(const reducedMotion of ['no-prefe
|
||||
assert.deepEqual(errors,[]);assert.deepEqual(network,[]);Object.assign(run,{passed:run.examples.length===ids.length,checksApplyTo:'Successful IDs in examples; failures in findings',deterministicSeek:reducedMotion==='no-preference',cleanupRemount:true,beatControls:true,bounds:true,errors,network});await ctx.close();
|
||||
}assert.equal(report.findings.length,0,'Recipe integration findings: '+report.findings.map(f=>f.variant+'/'+f.id).join(', ')+' (see evidence report)');report.status='passed';console.log(JSON.stringify({status:report.status,examples:ids.length,runs:report.runs.map(r=>({variant:r.variant,motion:r.reducedMotion,examples:r.examples.length})),completeCatalog:manifest.complete}));}
|
||||
catch(error){report.status='failed';report.failure=String(error.stack);throw error;}
|
||||
finally{fs.writeFileSync(path.join(evidence,'animejs-gallery-test-report.json'),JSON.stringify(report,null,2)+'\n');await browser.close();}
|
||||
finally{fs.writeFileSync(path.join(evidence,manifest.package+'-test-report.json'),JSON.stringify(report,null,2)+'\n');await browser.close();}
|
||||
Reference in new issue
Block a user