From 4365f3318b75c248b44e7eea9dfbcd2708518cf4 Mon Sep 17 00:00:00 2001 From: Gaubee Date: Fri, 16 Jan 2026 10:55:44 +0800 Subject: [PATCH] fix(e2e): update tests to use TransferPreviewJob selectors - Replace confirm-transfer-button with confirm-preview-button - Replace cancel-transfer-button with cancel-preview-button - Update comments to reflect new TransferPreviewJob flow --- e2e/bioforest-full-flow.spec.ts | 4 ++-- e2e/bioforest-real-transfer.spec.ts | 2 +- e2e/bioforest-transfer.spec.ts | 4 ++-- e2e/send-transaction.mock.spec.ts | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e/bioforest-full-flow.spec.ts b/e2e/bioforest-full-flow.spec.ts index 4cf50f639..05ce11b3a 100644 --- a/e2e/bioforest-full-flow.spec.ts +++ b/e2e/bioforest-full-flow.spec.ts @@ -268,8 +268,8 @@ async function performTransfer( await continueBtn.click() await page.waitForTimeout(500) - // 点击确认转账 - const confirmBtn = page.locator(`[data-testid="confirm-transfer-button"], button:has-text("${UI_TEXT.confirm.source}")`).first() + // 点击确认转账 (TransferPreviewJob) + const confirmBtn = page.locator(`[data-testid="confirm-preview-button"], button:has-text("${UI_TEXT.confirm.source}")`).first() await expect(confirmBtn).toBeVisible({ timeout: 5000 }) await confirmBtn.click() await page.waitForTimeout(500) diff --git a/e2e/bioforest-real-transfer.spec.ts b/e2e/bioforest-real-transfer.spec.ts index 9752e413f..1a9b4c9e3 100644 --- a/e2e/bioforest-real-transfer.spec.ts +++ b/e2e/bioforest-real-transfer.spec.ts @@ -178,7 +178,7 @@ async function doTransfer(page: Page, toAddress: string, amount: string, needPay await expect(continueBtn).toBeEnabled({ timeout: 15000 }) await continueBtn.click() - await page.locator('[data-testid="confirm-transfer-button"]').click() + await page.locator('[data-testid="confirm-preview-button"]').click() // 验证钱包锁 const patternInput = page.locator('[data-testid="wallet-pattern-input"]') diff --git a/e2e/bioforest-transfer.spec.ts b/e2e/bioforest-transfer.spec.ts index b79f2961c..8a4793e4a 100644 --- a/e2e/bioforest-transfer.spec.ts +++ b/e2e/bioforest-transfer.spec.ts @@ -201,9 +201,9 @@ describeOrSkip('BioForest 转账测试', () => { await continueBtn.click() console.log(' ✅ 继续到确认页') - // 7. 确认转账 + // 7. 确认转账(TransferPreviewJob) console.log('7. 确认转账...') - const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]') + const confirmBtn = page.locator('[data-testid="confirm-preview-button"]') await expect(confirmBtn).toBeVisible({ timeout: 5000 }) await confirmBtn.click() console.log(' ✅ 点击确认') diff --git a/e2e/send-transaction.mock.spec.ts b/e2e/send-transaction.mock.spec.ts index c56109e18..6ec52f51f 100644 --- a/e2e/send-transaction.mock.spec.ts +++ b/e2e/send-transaction.mock.spec.ts @@ -344,14 +344,14 @@ test.describe('发送交易 - Job 弹窗流程', () => { await page.waitForTimeout(500) // 检查确认弹窗内容 - const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]') - const cancelBtn = page.locator('[data-testid="cancel-transfer-button"]') + const confirmBtn = page.locator('[data-testid="confirm-preview-button"]') + const cancelBtn = page.locator('[data-testid="cancel-preview-button"]') // 至少一个按钮应该可见(确认或取消) const hasConfirmUI = await confirmBtn.isVisible() || await cancelBtn.isVisible() if (hasConfirmUI) { - console.log('TransferConfirmJob opened successfully') + console.log('TransferPreviewJob opened successfully') // 截图 await expect(page).toHaveScreenshot('send-confirm-job.png') @@ -365,7 +365,7 @@ test.describe('发送交易 - Job 弹窗流程', () => { await expect(page.locator('[data-testid="send-continue-button"]')).toBeVisible() } } else { - console.log('TransferConfirmJob may not have opened - check mock configuration') + console.log('TransferPreviewJob may not have opened - check mock configuration') } } else { console.log('Continue button not enabled - mock service may not be configured correctly') @@ -390,7 +390,7 @@ test.describe('发送交易 - Job 弹窗流程', () => { await continueBtn.click() await page.waitForTimeout(500) - const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]') + const confirmBtn = page.locator('[data-testid="confirm-preview-button"]') if (await confirmBtn.isVisible()) { await confirmBtn.click()