This commit is contained in:
dahyeon committed 2026-08-13 01:34:54 +09:00
1 parent d2c03d155d
commit db60190e19
13 files changed
+505 -38

No files matched your search

+11 -5
View File
@@ -101,17 +101,23 @@ test.describe('[escape-reserve] e2e tests', () => {
test('monitors live server time and runs a safe timing probe', async () => {
await page.getByRole('button', { name: '자동 예약' }).click()
await page.getByRole('button', { name: '정밀 보정 설정' }).click()
await expect(page.getByText('경계 측정 간격 (ms)')).toBeVisible()
await page.getByLabel('전송 모드').selectOption('http2')
await page.getByRole('button', { name: '설정 적용' }).click()
await page.getByRole('button', { name: '모니터 시작' }).click()
await expect(page.getByRole('button', { name: '모니터 중지' })).toBeVisible({ timeout: 10_000 })
await expect(page.getByLabel('관측 서버시간 값')).toContainText(':')
await page.getByRole('button', { name: '정밀 보정 설정' }).click()
await expect(page.getByText('경계 측정 간격 (ms)')).toBeVisible()
await page.getByRole('button', { name: '기본값' }).click()
await page.getByRole('button', { name: '설정 적용' }).click()
await expect.poll(() => page.evaluate(async () => (await window.reservationApi.getClockState()).protocol), {
timeout: 10_000,
}).toBe('h2')
await page.getByRole('button', { name: '3초 테스트' }).click()
await expect(page.getByText('arrival error')).toBeVisible({ timeout: 10_000 })
const h2State = await page.evaluate(() => window.reservationApi.getClockState())
expect(h2State.protocol).toBe('h2')
expect(h2State.connectionId).toMatch(/^h2-\d+$/)
expect(h2State.connectionReused).toBe(true)
})
test('arms and disarms an automatic reservation without submitting', async () => {
+17 -1
View File
@@ -1,5 +1,11 @@
import { describe, expect, it } from 'vitest'
import { EDGE_USER_AGENT, edgeBrowserHeaders, encodeMultipart } from '../electron/main/keyescape-http'
import {
EDGE_USER_AGENT,
edgeBrowserHeaders,
encodeMultipart,
getKeyescapeTransportMode,
setKeyescapeTransportMode,
} from '../electron/main/keyescape-http'
describe('Edge-compatible Keyescape request metadata', () => {
it('matches the captured Edge client hints and XHR metadata', () => {
@@ -17,6 +23,8 @@ describe('Edge-compatible Keyescape request metadata', () => {
expect(headers['Sec-Fetch-Mode']).toBe('cors')
expect(headers['Sec-Fetch-Dest']).toBe('empty')
expect(headers['X-Requested-With']).toBe('XMLHttpRequest')
expect(headers.Origin).toBe('https://www.keyescape.com')
expect(headers.Priority).toBe('u=1, i')
expect(headers.Referer).toBe('https://www.keyescape.com/reservation2.php')
})
@@ -30,4 +38,12 @@ describe('Edge-compatible Keyescape request metadata', () => {
expect(first.body.toString('utf8')).toContain('Content-Disposition: form-data; name="device"')
expect(first.body.toString('utf8')).toMatch(/--\r\n$/)
})
it('switches explicitly between the legacy and HTTP/2 transports', () => {
setKeyescapeTransportMode('http2')
expect(getKeyescapeTransportMode()).toBe('http2')
expect(setKeyescapeTransportMode('http2')).toBe(false)
expect(setKeyescapeTransportMode('http1')).toBe(true)
expect(getKeyescapeTransportMode()).toBe('http1')
})
})
Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 117 KiB