43 lines
1.6 KiB
JavaScript
43 lines
1.6 KiB
JavaScript
|
|
const { test, expect } = require('@playwright/test');
|
||
|
|
const { login } = require('./helpers/auth');
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 워크스페이스(탭) — 메뉴를 탭(iframe)으로 열고 전환해도 작업 상태 유지
|
||
|
|
*/
|
||
|
|
test.describe('워크스페이스 탭', () => {
|
||
|
|
test('탭 열기·전환·상태 유지·닫기', async ({ page }) => {
|
||
|
|
await login(page, 'admin');
|
||
|
|
await page.goto('/admin/select-local-government');
|
||
|
|
await page.evaluate(() => {
|
||
|
|
const r = document.querySelector('input[name="lg_idx"][value="1"]');
|
||
|
|
if (r) { r.checked = true; r.form.submit(); }
|
||
|
|
});
|
||
|
|
await page.waitForTimeout(700);
|
||
|
|
|
||
|
|
await page.goto('/workspace');
|
||
|
|
await page.waitForTimeout(2500);
|
||
|
|
|
||
|
|
// 대시보드 탭이 자동으로 열림
|
||
|
|
await expect(page.locator('.ws-tab')).toHaveCount(1);
|
||
|
|
await expect(page.locator('.ws-frame.active')).toBeVisible();
|
||
|
|
|
||
|
|
// 대시보드 탭에 입력
|
||
|
|
await page.frameLocator('.ws-frame.active').locator('#mainMenuSearch').fill('WS_STATE', { timeout: 8000 });
|
||
|
|
|
||
|
|
// 사이드바 메뉴 클릭 → 새 탭
|
||
|
|
await page.locator('.sidebar .my-menu-list a').first().click();
|
||
|
|
await page.waitForTimeout(1500);
|
||
|
|
await expect(page.locator('.ws-tab')).toHaveCount(2);
|
||
|
|
|
||
|
|
// 첫 탭으로 복귀 → 입력값 유지 확인
|
||
|
|
await page.locator('.ws-tab').first().click();
|
||
|
|
await page.waitForTimeout(400);
|
||
|
|
await expect(page.frameLocator('.ws-frame.active').locator('#mainMenuSearch')).toHaveValue('WS_STATE');
|
||
|
|
|
||
|
|
// 탭 닫기
|
||
|
|
await page.locator('.ws-tab').nth(1).locator('.t-close').click();
|
||
|
|
await page.waitForTimeout(300);
|
||
|
|
await expect(page.locator('.ws-tab')).toHaveCount(1);
|
||
|
|
});
|
||
|
|
});
|