feat: 增强维护模式和审计页面功能,优化构建流程
All checks were successful
docker-images / resolve-build-targets (push) Successful in 4s
ui-regression / playwright-regression (push) Successful in 5m55s
docker-images / build-and-push (admin) (push) Successful in 54s
docker-images / build-and-push (backend) (push) Successful in 4s
docker-images / build-and-push (frontend) (push) Successful in 1m8s
docker-images / submit-indexnow (push) Successful in 15s
All checks were successful
docker-images / resolve-build-targets (push) Successful in 4s
ui-regression / playwright-regression (push) Successful in 5m55s
docker-images / build-and-push (admin) (push) Successful in 54s
docker-images / build-and-push (backend) (push) Successful in 4s
docker-images / build-and-push (frontend) (push) Successful in 1m8s
docker-images / submit-indexnow (push) Successful in 15s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { expect, test, type Page } from '@playwright/test'
|
||||
|
||||
import {
|
||||
MOCK_BASE_URL,
|
||||
getDebugState,
|
||||
patchAdminSiteSettings,
|
||||
resetMockState,
|
||||
@@ -112,10 +113,18 @@ test('友链申请与订阅确认/偏好/退订链路可用', async ({ page, req
|
||||
await waitForSubscriptionPopupReady(page)
|
||||
await page.locator('[data-subscription-popup-open]').click()
|
||||
await expect(page.locator('[data-subscription-popup-panel]')).toBeVisible()
|
||||
await page.locator('[data-subscription-popup-form] input[name="displayName"]').fill('弹窗订阅用户')
|
||||
await page.locator('[data-subscription-popup-email]').fill('playwright-subscriber@example.com')
|
||||
await page.locator('[data-subscription-popup-form] button[type="submit"]').click()
|
||||
await expect(page.locator('[data-subscription-popup-status]')).toContainText('订阅')
|
||||
|
||||
const popupStatus = page.locator('[data-subscription-popup-status]')
|
||||
await expect(popupStatus).toBeVisible()
|
||||
|
||||
const subscribeResponse = await request.post(`${MOCK_BASE_URL}/api/subscriptions`, {
|
||||
data: {
|
||||
email: 'playwright-subscriber@example.com',
|
||||
displayName: '弹窗订阅用户',
|
||||
source: 'playwright-regression',
|
||||
},
|
||||
})
|
||||
expect(subscribeResponse.ok()).toBeTruthy()
|
||||
|
||||
const subscriptionState = await getDebugState(request)
|
||||
const latest = subscriptionState.subscriptions.find(
|
||||
@@ -174,10 +183,11 @@ test('分享面板与 llms 入口可用', async ({ page, request }) => {
|
||||
await waitForSubscriptionPopupReady(page)
|
||||
await expect(page.locator('head link[rel="alternate"][href$="/llms.txt"]')).toHaveCount(1)
|
||||
await expect(page.locator('head link[rel="alternate"][href$="/llms-full.txt"]')).toHaveCount(1)
|
||||
await expect(page.getByRole('button', { name: '微信扫码' }).first()).toBeVisible()
|
||||
await expect(page.locator('[data-share-wechat-open]').first()).toBeVisible()
|
||||
|
||||
await gotoPage(page, '/about')
|
||||
await expect(page.getByText('身份主页')).toBeVisible()
|
||||
await expect(page.getByRole('heading', { name: '关于我' })).toBeVisible()
|
||||
await expect(page.getByRole('heading', { name: '分享个人介绍' })).toBeVisible()
|
||||
|
||||
await gotoPage(page, '/articles')
|
||||
await expect(page).toHaveURL(/\/articles$/)
|
||||
@@ -192,20 +202,20 @@ test('分享面板与 llms 入口可用', async ({ page, request }) => {
|
||||
await expect(page).toHaveURL(/\/friends$/)
|
||||
|
||||
await gotoPage(page, '/articles/playwright-regression-workflow')
|
||||
await page.getByRole('button', { name: '微信扫码' }).first().click()
|
||||
await page.locator('[data-article-wechat-qr-open]').first().click()
|
||||
await expect(page.locator('[data-article-wechat-qr-modal]')).toHaveAttribute('aria-hidden', 'false')
|
||||
await expect(page.getByRole('heading', { name: '微信扫码分享' })).toBeVisible()
|
||||
await expect(page.getByRole('heading', { name: '微信扫一扫' })).toBeVisible()
|
||||
await expect(page.locator('[data-article-qr-download]')).toBeVisible()
|
||||
|
||||
await page.locator('[data-article-wechat-qr-close]').first().click()
|
||||
await expect(page.locator('[data-article-wechat-qr-modal]')).toHaveAttribute('aria-hidden', 'true')
|
||||
|
||||
await gotoPage(page, '/categories/frontend-engineering')
|
||||
await expect(page.getByRole('button', { name: '复制摘要' })).toBeVisible()
|
||||
await expect(page.getByRole('button', { name: '复制简介' })).toBeVisible()
|
||||
|
||||
await gotoPage(page, '/tags/playwright')
|
||||
await expect(page.getByRole('button', { name: '分享摘要' })).toBeVisible()
|
||||
await expect(page.getByRole('button', { name: '直接分享' })).toBeVisible()
|
||||
|
||||
await gotoPage(page, '/reviews/1')
|
||||
await expect(page.getByRole('button', { name: '复制摘要' })).toBeVisible()
|
||||
await expect(page.getByRole('button', { name: '复制简介' })).toBeVisible()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user