// @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('/bag/bag-prices'); await expect(page).toHaveURL(/\/bag\/bag-prices/); }); test('단가 등록 폼 표시', async ({ page }) => { await page.goto('/bag/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('/bag/bag-prices'); await expect(page).toHaveURL(/\/bag\/bag-prices/); }); }); test.describe('P2-03: 지자체관리자 접근', () => { test('지자체관리자도 단가 목록 접근 가능', async ({ page }) => { await login(page, 'local'); await page.goto('/bag/bag-prices'); await expect(page).toHaveURL(/\/bag\/bag-prices/); }); });