test(uat): расширить per-control на оприходования/списания/инвентаризации/возвраты/движения
21/21 ✓: Товары (поиск/сброс/сорт/пагинация/экспорт), Приёмки (поиск/фильтр оплаты/ сорт/экспорт + жизненный цикл провести→снять→удалить), Продажи (поиск/сорт), Движения (store-фильтр), Контрагенты (поиск), Оприходования/Списания/Инвентаризации/ Возвраты поставщику (поиск). Семантику параметр→строки держит filters-sweep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
605c1bac2c
commit
eafc8c15fc
|
|
@ -27,7 +27,9 @@ test.describe('UAT per-control (browser)', () => {
|
||||||
return (pred ? items.find(pred) : items[0]).id as string
|
return (pred ? items.find(pred) : items[0]).id as string
|
||||||
}
|
}
|
||||||
const unitId = await first('/api/catalog/units-of-measure?pageSize=50')
|
const unitId = await first('/api/catalog/units-of-measure?pageSize=50')
|
||||||
const storeId = await first('/api/catalog/stores?pageSize=50')
|
const storesList = (await (await ctx.get('/api/catalog/stores?pageSize=50')).json()).items as { id: string; name: string }[]
|
||||||
|
const storeId = storesList[0].id
|
||||||
|
const storeName = storesList[0].name
|
||||||
const currencyId = await first('/api/catalog/currencies?pageSize=50', (c: any) => c.code === 'KZT')
|
const currencyId = await first('/api/catalog/currencies?pageSize=50', (c: any) => c.code === 'KZT')
|
||||||
const priceTypeId = await first('/api/catalog/price-types?pageSize=50')
|
const priceTypeId = await first('/api/catalog/price-types?pageSize=50')
|
||||||
const groupId = await first('/api/catalog/product-groups?pageSize=50')
|
const groupId = await first('/api/catalog/product-groups?pageSize=50')
|
||||||
|
|
@ -181,6 +183,31 @@ test.describe('UAT per-control (browser)', () => {
|
||||||
await check('Контрагенты', 'поиск → search=', () =>
|
await check('Контрагенты', 'поиск → search=', () =>
|
||||||
fires(() => page.getByPlaceholder(/поиск|названи|имен|бин/i).first().fill('Поставщик'), '/api/catalog/counterparties', 'search='))
|
fires(() => page.getByPlaceholder(/поиск|названи|имен|бин/i).first().fill('Поставщик'), '/api/catalog/counterparties', 'search='))
|
||||||
|
|
||||||
|
// ── Остальные документные списки: поиск (всегда в шапке) шлёт search= ─
|
||||||
|
const docScreens: [string, string, string, RegExp][] = [
|
||||||
|
['Оприходования', '/inventory/enters', '/api/inventory/enters', /номер/i],
|
||||||
|
['Списания', '/inventory/losses', '/api/inventory/losses', /номер/i],
|
||||||
|
['Инвентаризации', '/inventory/inventories', '/api/inventory/inventories', /номер/i],
|
||||||
|
['Возвраты поставщику', '/purchases/supplier-returns', '/api/purchases/supplier-returns', /номер|поставщик/i],
|
||||||
|
]
|
||||||
|
for (const [name, path, url, ph] of docScreens) {
|
||||||
|
await attachSession(page, sess, path)
|
||||||
|
await page.waitForTimeout(1200)
|
||||||
|
await check(name, 'поиск → search=', () =>
|
||||||
|
fires(() => page.getByPlaceholder(ph).first().fill('X1'), url, 'search='))
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Движения: фильтр по складу шлёт storeId ─────────────────────────
|
||||||
|
await attachSession(page, sess, '/inventory/movements')
|
||||||
|
await page.waitForTimeout(1500)
|
||||||
|
await check('Движения', 'фильтр склада → storeId=', () =>
|
||||||
|
fires(async () => {
|
||||||
|
await page.getByText('Все склады', { exact: true }).first().click()
|
||||||
|
await page.waitForTimeout(300)
|
||||||
|
// пункт списка кастомного Select — <button> с названием склада
|
||||||
|
await page.getByRole('button', { name: storeName }).first().click()
|
||||||
|
}, '/api/inventory/movements', 'storeId='))
|
||||||
|
|
||||||
// ── итог ──────────────────────────────────────────────────────────────
|
// ── итог ──────────────────────────────────────────────────────────────
|
||||||
const fails = results.filter((r) => !r.ok)
|
const fails = results.filter((r) => !r.ok)
|
||||||
console.log(`\n[uat-controls] ${results.length - fails.length} ✓ / ${fails.length} ✗`)
|
console.log(`\n[uat-controls] ${results.length - fails.length} ✓ / ${fails.length} ✗`)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue