From fe4cb6446d0ed67bedbd7f972b09ed6310ac643e Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Wed, 9 Sep 2026 02:37:43 +0300 Subject: [PATCH] Restore full E2E suite and patch v17.7.1 compatibility test --- .github/workflows/fix-v17-7-1-e2e.yml | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/fix-v17-7-1-e2e.yml diff --git a/.github/workflows/fix-v17-7-1-e2e.yml b/.github/workflows/fix-v17-7-1-e2e.yml new file mode 100644 index 0000000..7565be0 --- /dev/null +++ b/.github/workflows/fix-v17-7-1-e2e.yml @@ -0,0 +1,52 @@ +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