- 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>
74 lines
2.6 KiB
JavaScript
74 lines
2.6 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 });
|
|
}
|
|
|
|
async function loginAsLocal(page) {
|
|
await login(page, 'local');
|
|
}
|
|
|
|
test.describe('P2-07/08: 판매 대행소 관리', () => {
|
|
test('목록 접근 (Super Admin)', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/sales-agencies');
|
|
await expect(page).toHaveURL(/\/admin\/sales-agencies/);
|
|
});
|
|
test('등록 폼 표시', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/sales-agencies/create');
|
|
await expect(page.locator('input[name="sa_name"]')).toBeVisible();
|
|
});
|
|
test('지자체관리자 접근', async ({ page }) => {
|
|
await loginAsLocal(page);
|
|
await page.goto('/admin/sales-agencies');
|
|
await expect(page).toHaveURL(/\/admin\/sales-agencies/);
|
|
});
|
|
});
|
|
|
|
test.describe('P2-09/10: 담당자 관리', () => {
|
|
test('목록 접근', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/managers');
|
|
await expect(page).toHaveURL(/\/admin\/managers/);
|
|
});
|
|
test('등록 폼 표시', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/managers/create');
|
|
await expect(page.locator('input[name="mg_name"]')).toBeVisible();
|
|
});
|
|
});
|
|
|
|
test.describe('P2-11/12: 업체 관리', () => {
|
|
test('목록 접근', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/companies');
|
|
await expect(page).toHaveURL(/\/admin\/companies/);
|
|
});
|
|
test('등록 폼 표시', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/companies/create');
|
|
await expect(page.locator('select[name="cp_type"]')).toBeVisible();
|
|
await expect(page.locator('input[name="cp_name"]')).toBeVisible();
|
|
});
|
|
});
|
|
|
|
test.describe('P2-13/14: 무료용 대상자 관리', () => {
|
|
test('목록 접근', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/free-recipients');
|
|
await expect(page).toHaveURL(/\/admin\/free-recipients/);
|
|
});
|
|
test('등록 폼 표시', async ({ page }) => {
|
|
await loginAsAdmin(page);
|
|
await page.goto('/admin/free-recipients/create');
|
|
await expect(page.locator('select[name="fr_type_code"]')).toBeVisible();
|
|
await expect(page.locator('input[name="fr_name"]')).toBeVisible();
|
|
});
|
|
});
|