name: Fix Caterium v17.7.1 E2E suite on: push: branches: - main paths: - '.github/workflows/fix-v17-7-1-e2e.yml' permissions: contents: write jobs: fix: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Restore and patch full test suite run: | git show 1e781f51b3ca39b4fda5260d9073855801cd802f:tests/app.spec.mjs > tests/app.spec.mjs python - <<'PY' from pathlib import Path p=Path('tests/app.spec.mjs') s=p.read_text(encoding='utf-8') old="""test('v17.7.0 data layer can update orders without direct UI globals', async ({ page }) => { await page.goto('/index.html',{waitUntil:'domcontentloaded'}); const source=fs.readFileSync(path.join(process.cwd(),'public','core','data-layer-v1770.js'),'utf8');await page.addScriptTag({content:source}); const result=await page.evaluate(()=>{window.CateriumDataV1770.orders.replace([{id:77,status:'Новый',total:1000}],{persistLocal:false,reason:'e2e-seed'});const before=window.CateriumDataV1770.orders.get(77);window.CateriumDataV1770.orders.update(77,o=>({...o,status:'Тест'}),{persistLocal:false});return {before:before.status,after:window.CateriumDataV1770.orders.get(77).status,version:window.CateriumDataV1770.VERSION}}); expect(result).toEqual({before:'Новый',after:'Тест',version:'17.7.0'}); });""" new="""test('v17.7.1 data layer can update orders without direct UI globals', async ({ page }) => { await page.goto('/index.html',{waitUntil:'domcontentloaded'}); await page.waitForFunction(()=>Boolean(window.CateriumDataV1771),null,{timeout:5000}); const result=await page.evaluate(()=>{const d=window.CateriumDataV1771;d.orders.replace([{id:77,status:'Новый',total:1000}],{persistLocal:false,reason:'e2e-seed'});const before=d.orders.get(77);d.orders.update(77,o=>({...o,status:'Тест'}),{persistLocal:false});return {before:before.status,after:d.orders.get(77).status,version:d.VERSION,alias:window.CateriumDataV1770===d}}); expect(result).toEqual({before:'Новый',after:'Тест',version:'17.7.1',alias:true}); });""" if old not in s: raise SystemExit('target v17.7.0 data-layer test not found') s=s.replace(old,new,1) p.write_text(s,encoding='utf-8') PY - name: Validate static release checks run: | npm install npm run check:deploy - name: Commit repair run: | rm -f .github/workflows/fix-v17-7-1-e2e.yml ops/qa-trigger-v1771.txt git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add -A git commit -m "Fix v17.7.1 E2E compatibility coverage" git push