Fix v17.7.1 E2E repair workflow
This commit is contained in:
parent
6a7e69cb5b
commit
bbb1105d63
26
.github/workflows/fix-v17-7-1-e2e.yml
vendored
26
.github/workflows/fix-v17-7-1-e2e.yml
vendored
@ -15,36 +15,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Restore and patch full test suite
|
- name: Restore and patch full test suite
|
||||||
run: |
|
run: python ops/fix_v1771_e2e.py
|
||||||
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
|
- name: Validate static release checks
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
npm run check:deploy
|
npm run check:deploy
|
||||||
- name: Commit repair
|
- name: Commit repair
|
||||||
run: |
|
run: |
|
||||||
rm -f .github/workflows/fix-v17-7-1-e2e.yml ops/qa-trigger-v1771.txt
|
rm -f .github/workflows/fix-v17-7-1-e2e.yml ops/fix_v1771_e2e.py ops/qa-trigger-v1771.txt
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git add -A
|
git add -A
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user