const assert=require('node:assert/strict'); module.exports=async({page,go,shot})=>{ await page.route('**/api/access/policies',async route=>{await new Promise(r=>setTimeout(r,2200));await route.continue()}); await go('/access/policies'); assert.equal(await page.getByText('No policies yet.',{exact:true}).count(),0); await page.getByText('Loading policies…',{exact:true}).waitFor({state:'hidden'}); await page.route('**/api/tasks?**',async route=>{ if(new URL(route.request().url()).searchParams.has('workflow')) await route.fulfill({status:200,contentType:'application/json',body:'unreadable response'}); else await route.continue(); }); await go('/workflows'); await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor(); await page.getByRole('tab',{name:/^Runs/}).click(); assert.equal(await page.getByText('No runs yet',{exact:true}).count(),0); await page.unroute('**/api/tasks?**'); await page.getByRole('button',{name:'Retry runs',exact:true}).click(); await page.getByRole('alert').filter({hasText:'Could not load recent runs'}).waitFor({state:'hidden'}); await shot('recovered'); };