Files
jongryangje/e2e/bag-price.spec.js
javamon1174 a0103eb95d 사이트 메뉴 /bag/* 10개 페이지 구현 + E2E 테스트 timeout 보강
- Bag 컨트롤러 신규 (기본정보/발주입고/불출/재고/판매/판매현황/수불/통계/창/도움말)
- 사이트 공통 레이아웃 bag/layout/main.php 추출
- /bag/* 라우트 10개 등록 (Routes.php)
- bag-site.spec.js E2E 테스트 11개 추가
- Playwright timeout 30s→60s, waitForURL 15s→30s
- P4 지자체관리자 접근 테스트 3개로 분리

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:30:45 +09:00

49 lines
1.7 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('P2-03/04: 봉투 단가 관리', () => {
test.beforeEach(async ({ page }) => {
await loginAsAdmin(page);
});
test('단가 목록 접근', async ({ page }) => {
await page.goto('/admin/bag-prices');
await expect(page).toHaveURL(/\/admin\/bag-prices/);
});
test('단가 등록 폼 표시', async ({ page }) => {
await page.goto('/admin/bag-prices/create');
await expect(page.locator('select[name="bp_bag_code"]')).toBeVisible();
await expect(page.locator('input[name="bp_order_price"]')).toBeVisible();
});
test('기간 필터 조회', async ({ page }) => {
await page.goto('/admin/bag-prices?start_date=2026-01-01&end_date=2026-12-31');
await expect(page).toHaveURL(/start_date/);
});
test('단가 변경 이력 페이지 (빈 상태)', async ({ page }) => {
// 먼저 데이터가 있어야 하므로, 목록 페이지만 접근 확인
await page.goto('/admin/bag-prices');
await expect(page).toHaveURL(/\/admin\/bag-prices/);
});
});
test.describe('P2-03: 지자체관리자 접근', () => {
test('지자체관리자도 단가 목록 접근 가능', async ({ page }) => {
await login(page, 'local');
await page.goto('/admin/bag-prices');
await expect(page).toHaveURL(/\/admin\/bag-prices/);
});
});