Files
taxbaik/tests/e2e/inquiry-detail.spec.ts
kjh2064 67bd5dc666
TaxBaik CI/CD / build-and-deploy (push) Successful in 54s
test(e2e): suppress inquiry telegrams in ci
2026-06-28 21:40:11 +09:00

51 lines
2.4 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { findInquiryByName, getAdminToken, loginThroughAdminUi, navigateInBlazor } from './helpers/admin-auth';
const username = process.env.E2E_ADMIN_USERNAME ?? 'admin';
const password = process.env.E2E_ADMIN_PASSWORD;
const baseUrl = (process.env.E2E_BASE_URL ?? 'http://178.104.200.7/taxbaik').replace(/\/$/, '');
test.describe('inquiry detail', () => {
test('shows the created inquiry and admin action links', async ({ page, request }) => {
const stamp = Date.now();
const name = `Detail-${stamp}`;
const phone = '010-9876-5432';
const email = `detail-${stamp}@example.com`;
const message = '상세 화면 검증용 문의입니다.';
const createResponse = await request.post(`${baseUrl}/api/inquiry`, {
data: {
name,
phone,
email,
serviceType: '기타',
message,
suppressNotification: true,
},
});
expect(createResponse.ok()).toBeTruthy();
const createBody = await createResponse.json();
expect(createBody.message).toContain('상담 신청이 접수되었습니다');
test.skip(!password, 'E2E_ADMIN_PASSWORD is required to verify inquiry detail.');
const token = await getAdminToken(request, baseUrl, username, password);
const inquiry = await findInquiryByName(request, baseUrl, token, name);
await loginThroughAdminUi(page, baseUrl, username, password);
await navigateInBlazor(page, `${baseUrl}/admin/inquiries/${inquiry.id}`);
await expect(page).toHaveURL(/\/taxbaik\/admin\/inquiries\/\d+$/);
await expect(page.getByText(name, { exact: true }).first()).toBeVisible();
await expect(page.getByText(phone, { exact: true }).first()).toBeVisible();
await expect(page.getByText(message, { exact: true }).first()).toBeVisible();
await expect(page.getByRole('button', { name: '신규' })).toBeVisible();
await expect(page.getByRole('button', { name: '상담중' })).toBeVisible();
await expect(page.getByRole('button', { name: '계약완료' })).toBeVisible();
await expect(page.getByRole('button', { name: '거절' })).toBeVisible();
await expect(page.getByRole('button', { name: '종결' })).toBeVisible();
await expect(page.getByRole('button', { name: '문의 목록으로' })).toBeVisible();
await expect(page.getByRole('button', { name: '고객으로 등록' })).toBeVisible();
});
});