Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

503 рядки
22 KiB

  1. import type { Page, Route } from '@playwright/test'
  2. import { captureScreenshot, expect, test } from './fixtures'
  3. const DEFAULT_SYSTEM_NAME = '某类装备维修实训数字车间'
  4. const PNG_BYTES = Buffer.from(
  5. 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=',
  6. 'base64',
  7. )
  8. type BrandAsset = 'logo' | 'favicon'
  9. interface ConfigurationState {
  10. systemName: string
  11. systemNameConfigured: boolean
  12. systemNameDataVersion: number
  13. defaultTheme: 'military' | 'technology' | 'graphite' | 'dark'
  14. defaultThemeConfigured: boolean
  15. defaultThemeDataVersion: number
  16. digitalHumanWidgetConfigured: boolean
  17. digitalHumanWidget: {
  18. baseUrl: string
  19. agentSlug: string
  20. position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
  21. label: string
  22. } | null
  23. digitalHumanWidgetDataVersion: number
  24. logoConfigured: boolean
  25. logoUrl: string | null
  26. logoMediaType: string | null
  27. logoOriginalName: string | null
  28. logoSize: number | null
  29. logoSha256: string | null
  30. logoDataVersion: number
  31. faviconConfigured: boolean
  32. faviconUrl: string | null
  33. faviconMediaType: string | null
  34. faviconOriginalName: string | null
  35. faviconSize: number | null
  36. faviconSha256: string | null
  37. faviconDataVersion: number
  38. }
  39. const initialConfiguration = (): ConfigurationState => ({
  40. systemName: DEFAULT_SYSTEM_NAME,
  41. systemNameConfigured: false,
  42. systemNameDataVersion: 0,
  43. defaultTheme: 'military',
  44. defaultThemeConfigured: true,
  45. defaultThemeDataVersion: 1,
  46. digitalHumanWidgetConfigured: false,
  47. digitalHumanWidget: null,
  48. digitalHumanWidgetDataVersion: 0,
  49. logoConfigured: false,
  50. logoUrl: null,
  51. logoMediaType: null,
  52. logoOriginalName: null,
  53. logoSize: null,
  54. logoSha256: null,
  55. logoDataVersion: 0,
  56. faviconConfigured: false,
  57. faviconUrl: null,
  58. faviconMediaType: null,
  59. faviconOriginalName: null,
  60. faviconSize: null,
  61. faviconSha256: null,
  62. faviconDataVersion: 0,
  63. })
  64. const profile = (canUpdate: boolean) => ({
  65. user: {
  66. id: '1',
  67. username: 'admin',
  68. displayName: '系统管理员',
  69. departmentId: '10',
  70. departmentName: '信息中心',
  71. mustChangePassword: false,
  72. version: 1,
  73. },
  74. activeRoleId: '100',
  75. activeRole: { id: '100', code: 'admin', name: '管理员' },
  76. roles: [{
  77. id: '100', code: 'admin', name: '管理员', shortName: '管', status: 1,
  78. builtIn: 1, isSuperAdmin: 1, dataScopeCode: 'ALL',
  79. }],
  80. permissions: ['system.config', ...(canUpdate ? ['system.config.update'] : [])],
  81. authorizationMode: 'SINGLE_ACTIVE',
  82. loginTime: 1786387200,
  83. })
  84. const loginContext = {
  85. defaultRoleCode: 'admin',
  86. roles: [{ code: 'admin', label: '管理员', accountLabel: '登录账号', organizationMode: 'NONE', organizationLabels: [] }],
  87. departments: [],
  88. }
  89. const envelope = (data: unknown, message = '成功', code: number | string = 200) => JSON.stringify({
  90. code,
  91. message,
  92. data,
  93. timestamp: '2026-08-11T12:00:00+08:00',
  94. requestId: 'ute2e-system-config',
  95. })
  96. const fulfillJson = (route: Route, data: unknown, status = 200, message = '成功', code: number | string = status) => route.fulfill({
  97. status,
  98. contentType: 'application/json',
  99. body: envelope(data, message, code),
  100. })
  101. class SystemConfigurationMock {
  102. readonly state = initialConfiguration()
  103. readonly mutations: string[] = []
  104. readonly canUpdate: boolean
  105. conflictNextNameSave = false
  106. managementReadCount = 0
  107. constructor(canUpdate = true) {
  108. this.canUpdate = canUpdate
  109. }
  110. async install(page: Page, authenticated = true) {
  111. if (authenticated) {
  112. await page.addInitScript(() => {
  113. sessionStorage.setItem('unreal-tran:web:access-token:v1', 'ute2e-system-config-token')
  114. })
  115. }
  116. await page.route('**/api/auth/v1/**', (route) => this.handle(route))
  117. await page.route('https://human.example.test/**', (route) => route.fulfill({
  118. status: 200,
  119. headers: { 'Content-Type': 'text/html; charset=utf-8' },
  120. body: `<!doctype html><html><body style="margin:0;background:transparent">
  121. <button style="width:188px;height:56px">问数字教员</button>
  122. <script>parent.postMessage({source:'virtual-instructor-widget',type:'resize',width:208,height:92}, '*')</script>
  123. </body></html>`,
  124. }))
  125. }
  126. private publicState() {
  127. return {
  128. systemName: this.state.systemName,
  129. defaultTheme: this.state.defaultTheme,
  130. digitalHumanWidget: this.state.digitalHumanWidget,
  131. logoConfigured: this.state.logoConfigured,
  132. logoUrl: this.state.logoUrl,
  133. logoMediaType: this.state.logoMediaType,
  134. faviconConfigured: this.state.faviconConfigured,
  135. faviconUrl: this.state.faviconUrl,
  136. faviconMediaType: this.state.faviconMediaType,
  137. }
  138. }
  139. private configureAsset(asset: BrandAsset) {
  140. const nextVersion = this.state[`${asset}DataVersion`] + 1
  141. this.state[`${asset}Configured`] = true
  142. this.state[`${asset}Url`] = `/api/auth/v1/system-config/assets/${asset}?v=${nextVersion}`
  143. this.state[`${asset}MediaType`] = 'image/png'
  144. this.state[`${asset}OriginalName`] = asset === 'logo' ? 'brand-logo.png' : 'site-icon.png'
  145. this.state[`${asset}Size`] = PNG_BYTES.length
  146. this.state[`${asset}Sha256`] = `mock-${asset}-sha256`
  147. this.state[`${asset}DataVersion`] = nextVersion
  148. }
  149. private removeAsset(asset: BrandAsset) {
  150. this.state[`${asset}Configured`] = false
  151. this.state[`${asset}Url`] = null
  152. this.state[`${asset}MediaType`] = null
  153. this.state[`${asset}OriginalName`] = null
  154. this.state[`${asset}Size`] = null
  155. this.state[`${asset}Sha256`] = null
  156. this.state[`${asset}DataVersion`] += 1
  157. }
  158. private async handle(route: Route) {
  159. const request = route.request()
  160. const url = new URL(request.url())
  161. const path = url.pathname
  162. const method = request.method()
  163. if (method === 'GET' && path === '/api/auth/v1/system-config/public') {
  164. return fulfillJson(route, this.publicState())
  165. }
  166. if (method === 'GET' && path === '/api/auth/v1/auth/login-context') {
  167. return fulfillJson(route, loginContext)
  168. }
  169. if (method === 'GET' && path === '/api/auth/v1/auth/me') {
  170. return fulfillJson(route, profile(this.canUpdate))
  171. }
  172. if (method === 'GET' && path === '/api/auth/v1/menus/navigation') {
  173. return fulfillJson(route, [])
  174. }
  175. if (method === 'GET' && path === '/api/auth/v1/system-config') {
  176. this.managementReadCount += 1
  177. return fulfillJson(route, this.state)
  178. }
  179. if (method === 'PUT' && path === '/api/auth/v1/system-config/name') {
  180. this.mutations.push('name')
  181. if (this.conflictNextNameSave) {
  182. this.conflictNextNameSave = false
  183. this.state.systemName = '其他管理员刚保存的名称'
  184. this.state.systemNameConfigured = true
  185. this.state.systemNameDataVersion += 1
  186. return fulfillJson(route, null, 409, '系统名称版本冲突', 'CONFIG_VERSION_CONFLICT')
  187. }
  188. const body = request.postDataJSON() as { systemName?: string }
  189. const nextName = String(body.systemName ?? '').trim()
  190. this.state.systemName = nextName || DEFAULT_SYSTEM_NAME
  191. this.state.systemNameConfigured = Boolean(nextName)
  192. this.state.systemNameDataVersion += 1
  193. return fulfillJson(route, this.state)
  194. }
  195. if (method === 'PUT' && path === '/api/auth/v1/system-config/default-theme') {
  196. this.mutations.push('default-theme')
  197. const body = request.postDataJSON() as { defaultTheme?: ConfigurationState['defaultTheme'] }
  198. this.state.defaultTheme = body.defaultTheme ?? 'military'
  199. this.state.defaultThemeConfigured = true
  200. this.state.defaultThemeDataVersion += 1
  201. return fulfillJson(route, this.state)
  202. }
  203. if (method === 'POST' && path === '/api/auth/v1/system-config/digital-human-widget/parse') {
  204. const body = request.postDataJSON() as { embedCode?: string }
  205. const code = String(body.embedCode ?? '')
  206. if (!code.includes('/embed/') || !code.includes('virtual-instructor-widget')) {
  207. return fulfillJson(route, null, 400, '不是数字人系统生成的有效悬浮图标代码', 'VALIDATION_FAILED')
  208. }
  209. return fulfillJson(route, {
  210. baseUrl: 'https://human.example.test',
  211. agentSlug: 'dh-global-demo',
  212. position: 'bottom-right',
  213. label: '问数字教员',
  214. })
  215. }
  216. if (method === 'PUT' && path === '/api/auth/v1/system-config/digital-human-widget') {
  217. this.mutations.push('digital-human-widget')
  218. this.state.digitalHumanWidgetConfigured = true
  219. this.state.digitalHumanWidget = {
  220. baseUrl: 'https://human.example.test',
  221. agentSlug: 'dh-global-demo',
  222. position: 'bottom-right',
  223. label: '问数字教员',
  224. }
  225. this.state.digitalHumanWidgetDataVersion += 1
  226. return fulfillJson(route, this.state)
  227. }
  228. if (method === 'DELETE' && path === '/api/auth/v1/system-config/digital-human-widget') {
  229. this.mutations.push('remove-digital-human-widget')
  230. this.state.digitalHumanWidgetConfigured = false
  231. this.state.digitalHumanWidget = null
  232. this.state.digitalHumanWidgetDataVersion += 1
  233. return fulfillJson(route, this.state)
  234. }
  235. if (method === 'POST' && /^\/api\/auth\/v1\/system-config\/(logo|favicon)$/.test(path)) {
  236. const asset = path.endsWith('/logo') ? 'logo' : 'favicon'
  237. this.mutations.push(`upload-${asset}`)
  238. this.configureAsset(asset)
  239. return fulfillJson(route, this.state)
  240. }
  241. if (method === 'DELETE' && /^\/api\/auth\/v1\/system-config\/(logo|favicon)$/.test(path)) {
  242. const asset = path.endsWith('/logo') ? 'logo' : 'favicon'
  243. this.mutations.push(`remove-${asset}`)
  244. this.removeAsset(asset)
  245. return fulfillJson(route, this.state)
  246. }
  247. if (method === 'GET' && /^\/api\/auth\/v1\/system-config\/assets\/(logo|favicon)$/.test(path)) {
  248. return route.fulfill({
  249. status: 200,
  250. contentType: 'image/png',
  251. headers: { 'Cache-Control': 'public, max-age=31536000, immutable' },
  252. body: PNG_BYTES,
  253. })
  254. }
  255. return fulfillJson(route, {})
  256. }
  257. }
  258. const configuredBrandImage = (page: Page) => page.locator('.platform-brand .brand-mark.configured img')
  259. const faviconLink = (page: Page) => page.locator('link[rel~="icon"]')
  260. test.describe('系统配置(状态化 Mock,不访问真实 API/数据库)', () => {
  261. test('公开配置为空时登录页使用当前内置品牌', async ({ page }) => {
  262. const mock = new SystemConfigurationMock()
  263. await mock.install(page, false)
  264. await page.goto('/login')
  265. await expect(page.locator('.login-brand')).toContainText(DEFAULT_SYSTEM_NAME)
  266. await expect(page).toHaveTitle(`登录 - ${DEFAULT_SYSTEM_NAME}`)
  267. await expect(faviconLink(page)).toHaveAttribute('href', '/favicon.svg')
  268. await expect(faviconLink(page)).toHaveAttribute('type', 'image/svg+xml')
  269. expect(mock.mutations).toEqual([])
  270. })
  271. test('已配置的悬浮数字人只挂载到登录后的业务外壳', async ({ page }) => {
  272. const mock = new SystemConfigurationMock()
  273. mock.state.digitalHumanWidgetConfigured = true
  274. mock.state.digitalHumanWidget = {
  275. baseUrl: 'https://human.example.test',
  276. agentSlug: 'dh-global-demo',
  277. position: 'bottom-right',
  278. label: '问数字教员',
  279. }
  280. mock.state.digitalHumanWidgetDataVersion = 1
  281. await mock.install(page, false)
  282. await page.goto('/login')
  283. await expect(page.getByTestId('global-digital-human-widget')).toHaveCount(0)
  284. })
  285. test('已配置的平台 LOGO 保持透明且不显示边框', async ({ page }) => {
  286. const mock = new SystemConfigurationMock()
  287. Object.assign(mock.state, {
  288. logoConfigured: true,
  289. logoUrl: '/api/auth/v1/system-config/assets/logo?v=1',
  290. logoMediaType: 'image/png',
  291. logoOriginalName: 'brand-logo.png',
  292. logoSize: PNG_BYTES.length,
  293. logoSha256: 'mock-logo-sha256',
  294. logoDataVersion: 1,
  295. })
  296. await mock.install(page)
  297. await page.goto('/system/config')
  298. await expect(page.getByTestId('system-config-page')).toHaveAttribute('data-ready', 'true')
  299. const configuredBrandMark = configuredBrandImage(page).locator('..')
  300. await expect(configuredBrandMark).toHaveCSS('border-top-width', '0px')
  301. await expect(configuredBrandMark).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
  302. await expect(configuredBrandMark).toHaveCSS('box-shadow', 'none')
  303. })
  304. test('管理员可从菜单进入并保存、清空名称以及上传、移除 PNG 品牌资源', async ({ page }, testInfo) => {
  305. const mock = new SystemConfigurationMock()
  306. await mock.install(page)
  307. await page.setViewportSize({ width: 1920, height: 1080 })
  308. await page.goto('/system/config')
  309. await expect(page.getByTestId('system-config-page')).toHaveAttribute('data-ready', 'true')
  310. await expect(page).toHaveURL(/\/system\/config(?:\?|$)/)
  311. await expect(page.locator('.current-group-navigation')).toContainText('系统配置')
  312. await expect(page.getByRole('link', { name: '系统配置' })).toHaveClass(/active/)
  313. await expect(page.getByTestId('system-config-form')).toBeVisible()
  314. await expect(page.locator('.config-navigation')).toHaveCount(0)
  315. await expect(page.locator('.system-config-form-card')).toHaveCount(1)
  316. await expect(page.locator('.system-config-form-row')).toHaveCount(7)
  317. const pageBox = await page.getByTestId('system-config-page').boundingBox()
  318. const formBox = await page.getByTestId('system-config-form').boundingBox()
  319. expect(pageBox).not.toBeNull()
  320. expect(formBox).not.toBeNull()
  321. expect(formBox!.width / pageBox!.width).toBeGreaterThan(0.95)
  322. const nameInput = page.getByTestId('system-config-name')
  323. await nameInput.fill('装备维修教学测试平台')
  324. await page.getByTestId('system-config-save-name').click()
  325. await expect(page.locator('.platform-brand')).toContainText('装备维修教学测试平台')
  326. await expect(page).toHaveTitle('系统配置 - 装备维修教学测试平台')
  327. await page.getByTestId('system-config-clear-name').click()
  328. const restoreNameDialog = page.locator('.el-message-box:visible')
  329. await restoreNameDialog.getByRole('button', { name: '恢复默认' }).click()
  330. await expect(page.locator('.platform-brand')).toContainText(DEFAULT_SYSTEM_NAME)
  331. await expect(page).toHaveTitle(`系统配置 - ${DEFAULT_SYSTEM_NAME}`)
  332. await page.getByTestId('system-config-default-theme').getByRole('button', { name: /科技蓝/ }).click()
  333. await page.getByTestId('system-config-save-default-theme').click()
  334. await expect(page.locator('html')).toHaveAttribute('data-color-theme', 'technology')
  335. await expect(page.locator('.el-message')).toHaveCount(0, { timeout: 10_000 })
  336. await page.getByTestId('system-config-open-widget-drawer').click()
  337. await expect(page.getByTestId('system-config-widget-drawer')).toBeVisible()
  338. await page.getByTestId('system-config-widget-code').fill('这不是悬浮数字人代码')
  339. await page.getByTestId('system-config-parse-widget').click()
  340. await expect(page.getByText('不是数字人系统生成的有效悬浮图标代码', { exact: false })).toBeVisible()
  341. await page.getByTestId('system-config-widget-code').fill(`
  342. <script>
  343. (function () {
  344. var BASE = "https://human.example.test";
  345. var AGENT = "dh-global-demo";
  346. var POSITION = "bottom-right";
  347. var LABEL = "问数字教员";
  348. var frame = document.createElement('iframe');
  349. frame.id = 'virtual-instructor-widget';
  350. frame.src = BASE + '/embed/' + AGENT;
  351. window.__unsafePastedScriptWasExecuted = true;
  352. })();
  353. <\/script>
  354. `)
  355. await page.getByTestId('system-config-parse-widget').click()
  356. await expect(page.getByText('解析成功,请确认接入信息')).toBeVisible()
  357. const widgetPreviewFrame = page.getByTestId('system-config-widget-preview').locator('iframe')
  358. await expect(widgetPreviewFrame).toHaveAttribute('src', /human\.example\.test\/embed\/dh-global-demo\?.*open=1/)
  359. expect(await page.evaluate(() => (window as Window & { __unsafePastedScriptWasExecuted?: boolean }).__unsafePastedScriptWasExecuted)).toBeUndefined()
  360. await captureScreenshot(page, testInfo, 'system-config-widget-preview')
  361. await page.getByTestId('system-config-save-widget').click()
  362. await expect(page.getByTestId('system-config-widget-drawer')).toBeHidden()
  363. await expect(page.getByTestId('system-config-digital-human-widget-card')).toContainText('已接入数字教员')
  364. await expect(page.getByTestId('global-digital-human-widget')).toHaveAttribute('src', /human\.example\.test\/embed\/dh-global-demo/)
  365. await page.getByTestId('system-config-remove-widget').click()
  366. await page.locator('.el-message-box:visible').getByRole('button', { name: '确认移除' }).click()
  367. await expect(page.getByTestId('global-digital-human-widget')).toHaveCount(0)
  368. const logoCard = page.getByTestId('system-config-logo-card')
  369. await logoCard.locator('input[type="file"]').setInputFiles({
  370. name: 'brand-logo.png',
  371. mimeType: 'image/png',
  372. buffer: PNG_BYTES,
  373. })
  374. const logoDialog = page.getByTestId('system-config-upload-dialog')
  375. await expect(logoDialog).toBeVisible()
  376. await logoDialog.getByRole('button', { name: '确认上传' }).click()
  377. await expect(logoCard).toContainText('brand-logo.png')
  378. await expect(configuredBrandImage(page)).toHaveAttribute('src', /\/api\/auth\/v1\/system-config\/assets\/logo\?v=1$/)
  379. await page.getByTestId('system-config-remove-logo').click()
  380. await page.locator('.el-message-box:visible').getByRole('button', { name: '确认移除' }).click()
  381. await expect(configuredBrandImage(page)).toHaveCount(0)
  382. await expect(logoCard).toContainText('使用系统内置 LOGO')
  383. const faviconCard = page.getByTestId('system-config-favicon-card')
  384. await faviconCard.locator('input[type="file"]').setInputFiles({
  385. name: 'site-icon.png',
  386. mimeType: 'image/png',
  387. buffer: PNG_BYTES,
  388. })
  389. const faviconDialog = page.getByTestId('system-config-upload-dialog')
  390. await faviconDialog.getByRole('button', { name: '确认上传' }).click()
  391. await expect(faviconCard).toContainText('site-icon.png')
  392. await expect(faviconLink(page)).toHaveAttribute('type', 'image/png')
  393. await expect(faviconLink(page)).toHaveAttribute('href', /\/api\/auth\/v1\/system-config\/assets\/favicon\?v=1$/)
  394. await page.getByTestId('system-config-remove-favicon').click()
  395. await page.locator('.el-message-box:visible').getByRole('button', { name: '确认移除' }).click()
  396. await expect(faviconLink(page)).toHaveAttribute('type', 'image/svg+xml')
  397. await expect(faviconLink(page)).toHaveAttribute('href', '/favicon.svg')
  398. await expect(faviconCard).toContainText('使用系统内置网站图标')
  399. expect(mock.mutations).toEqual([
  400. 'name', 'name', 'default-theme', 'digital-human-widget', 'remove-digital-human-widget',
  401. 'upload-logo', 'remove-logo', 'upload-favicon', 'remove-favicon',
  402. ])
  403. await expect(page.locator('.el-message')).toHaveCount(0, { timeout: 10_000 })
  404. await captureScreenshot(page, testInfo, 'system-config-defaults-restored')
  405. })
  406. test('保存遇到 409 时刷新服务端配置并提示重新确认', async ({ page }) => {
  407. const mock = new SystemConfigurationMock()
  408. mock.conflictNextNameSave = true
  409. await mock.install(page)
  410. await page.goto('/system/config')
  411. await expect(page.getByTestId('system-config-page')).toHaveAttribute('data-ready', 'true')
  412. const readsBeforeSave = mock.managementReadCount
  413. await page.getByTestId('system-config-name').fill('本次输入会冲突')
  414. await page.getByTestId('system-config-save-name').click()
  415. await expect(page.getByText('配置已被其他管理员修改,页面已刷新,请确认后重新操作', { exact: true })).toBeVisible()
  416. await expect(page.getByTestId('system-config-name')).toHaveValue('其他管理员刚保存的名称')
  417. await expect(page.locator('.platform-brand')).toContainText('其他管理员刚保存的名称')
  418. await expect(page).toHaveTitle('系统配置 - 其他管理员刚保存的名称')
  419. expect(mock.managementReadCount).toBeGreaterThan(readsBeforeSave)
  420. })
  421. test('只有查看权限时页面为只读且不暴露更新操作', async ({ page }, testInfo) => {
  422. const mock = new SystemConfigurationMock(false)
  423. await mock.install(page)
  424. await page.goto('/system/config')
  425. await expect(page.getByTestId('system-config-page')).toHaveAttribute('data-ready', 'true')
  426. await expect(page.getByRole('link', { name: '系统配置' })).toBeVisible()
  427. await expect(page.getByTestId('system-config-name')).toBeDisabled()
  428. await expect(page.getByTestId('system-config-save-name')).toHaveCount(0)
  429. await expect(page.getByTestId('system-config-clear-name')).toHaveCount(0)
  430. await expect(page.getByTestId('system-config-save-default-theme')).toHaveCount(0)
  431. await expect(page.getByTestId('system-config-open-widget-drawer')).toHaveCount(0)
  432. await expect(page.getByTestId('system-config-upload-logo')).toHaveCount(0)
  433. await expect(page.getByTestId('system-config-upload-favicon')).toHaveCount(0)
  434. expect(mock.mutations).toEqual([])
  435. await captureScreenshot(page, testInfo, 'system-config-read-only')
  436. })
  437. test('简化表单在移动端暗色模式下无横向溢出', async ({ page }, testInfo) => {
  438. const mock = new SystemConfigurationMock()
  439. await mock.install(page)
  440. await page.addInitScript(() => {
  441. localStorage.setItem('unreal-tran:web:preferences:v1', JSON.stringify({
  442. navigationMode: 'top-side',
  443. themeMode: 'dark',
  444. sidebarCollapsed: false,
  445. }))
  446. })
  447. await page.setViewportSize({ width: 375, height: 812 })
  448. await page.goto('/system/config')
  449. await expect(page.getByTestId('system-config-page')).toHaveAttribute('data-ready', 'true')
  450. await expect(page.locator('html')).toHaveAttribute('data-theme', 'dark')
  451. await expect(page.getByTestId('system-config-form')).toBeVisible()
  452. await expect(page.locator('.config-navigation')).toHaveCount(0)
  453. expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true)
  454. await captureScreenshot(page, testInfo, 'system-config-mobile-dark')
  455. })
  456. })