Files
jongryangje/e2e/phase3-order.spec.js
taekyoungc 0f1d414f37 사이트·관리자 봉투 물류 기능(수불·통계·레포트·재고·발주)과 DB·메뉴·E2E를 운영 반영한다.
통계 분석(전년대비·월별·계절별), 수급계획·LOT 수불, 지정판매소·실사·메뉴 링크 등을 포함한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 16:15:15 +09:00

73 lines
2.5 KiB
JavaScript

// @ts-check
const { test, expect } = require('@playwright/test');
const { login } = require('./helpers/auth');
async function loginAsAdmin(page) {
await login(page, 'admin');
await page.locator('input[name="lg_idx"]').first().check();
await page.click('button[type="submit"]');
await page.waitForURL(url => !url.pathname.includes('select-local-government'), { timeout: 30000 });
}
test.describe('P3: 발주 관리', () => {
test('발주 현황 접근', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-orders');
await expect(page).toHaveURL(/\/admin\/bag-orders/);
});
test('발주 등록 폼', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-orders/create');
await expect(page.locator('input[name="bo_order_date"]')).toBeVisible();
});
test('발주 변경 허브', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/order/change');
await expect(page).toHaveURL(/\/bag\/order\/change/);
await expect(page.locator('select[name="month"]')).toBeVisible();
await expect(page.locator('legend:has-text("변경 구분")')).toBeVisible();
});
test('기간 필터 조회', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-orders?start_date=2026-01-01&end_date=2026-12-31');
await expect(page).toHaveURL(/start_date/);
});
});
test.describe('P3: 입고 관리', () => {
test('입고 현황 접근', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-receivings');
await expect(page).toHaveURL(/\/admin\/bag-receivings/);
});
test('입고 처리 폼', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-receivings/create');
await expect(page.locator('select[name="br_bo_idx"]')).toBeVisible();
});
});
test.describe('P3: 재고 현황', () => {
test('재고 현황 접근', async ({ page }) => {
await loginAsAdmin(page);
await page.goto('/bag/bag-inventory');
await expect(page).toHaveURL(/\/admin\/bag-inventory/);
});
});
test.describe('P3: 지자체관리자 접근', () => {
test('발주/입고/재고 접근 가능', async ({ page }) => {
await login(page, 'local');
await page.goto('/bag/bag-orders');
await expect(page).toHaveURL(/\/admin\/bag-orders/);
await page.goto('/bag/bag-receivings');
await expect(page).toHaveURL(/\/admin\/bag-receivings/);
await page.goto('/bag/bag-inventory');
await expect(page).toHaveURL(/\/admin\/bag-inventory/);
});
});