From 9307f09ec0db3aa823d166de4b865a2769015933 Mon Sep 17 00:00:00 2001 From: LingandRX Date: Thu, 6 Mar 2025 21:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Playwright=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E8=87=B3=201.50.1=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E4=B8=AD=E7=9A=84=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=8F=90=E9=AB=98=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7=E5=92=8C=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- tests/zhb/setup/zhb.setup.js | 6 ++---- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index b9a0069..68b12a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@faker-js/faker": "^9.0.3", - "@playwright/test": "^1.48.1", + "@playwright/test": "^1.50.1", "@types/node": "^22.7.5", "dotenv": "^16.4.5" } @@ -36,13 +36,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.48.1", - "resolved": "https://registry.npmmirror.com/@playwright/test/-/test-1.48.1.tgz", - "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==", + "version": "1.50.1", + "resolved": "https://registry.npmmirror.com/@playwright/test/-/test-1.50.1.tgz", + "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.48.1" + "playwright": "1.50.1" }, "bin": { "playwright": "cli.js" @@ -96,13 +96,13 @@ } }, "node_modules/playwright": { - "version": "1.48.1", - "resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.48.1.tgz", - "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==", + "version": "1.50.1", + "resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.50.1.tgz", + "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.48.1" + "playwright-core": "1.50.1" }, "bin": { "playwright": "cli.js" @@ -115,9 +115,9 @@ } }, "node_modules/playwright-core": { - "version": "1.48.1", - "resolved": "https://registry.npmmirror.com/playwright-core/-/playwright-core-1.48.1.tgz", - "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==", + "version": "1.50.1", + "resolved": "https://registry.npmmirror.com/playwright-core/-/playwright-core-1.50.1.tgz", + "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 9a8748a..49328ed 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "description": "", "devDependencies": { "@faker-js/faker": "^9.0.3", - "@playwright/test": "^1.48.1", + "@playwright/test": "^1.50.1", "@types/node": "^22.7.5", "dotenv": "^16.4.5" }, diff --git a/tests/zhb/setup/zhb.setup.js b/tests/zhb/setup/zhb.setup.js index 30d11c0..b87c451 100644 --- a/tests/zhb/setup/zhb.setup.js +++ b/tests/zhb/setup/zhb.setup.js @@ -7,14 +7,12 @@ setup('zhb总部管理员登录', async ({ page, baseURL }) => { const password = process.env.ZHB_PASSWORD; await page.goto(baseURL); - await page.getByText('账号登录').click(); + await expect(page.getByText('登录', { exact: true })).toBeEnabled(); await page.getByPlaceholder('用户名').fill(account); await page.getByPlaceholder('密码', { exact: true }).fill(password); await page.getByText('登录', { exact: true }).click(); await expect(page.getByText('演示一店')).toBeVisible(); - await expect(page.getByText('演示二店')).toBeVisible(); - - await page.getByText('演示一店').click(); + await page.getByText('演示一店', { exact: true }).click(); await expect(page.locator('#tab_main li').filter({ hasText: '营业' })).toBeVisible(); await page.context().storageState({ path: zhbAuthFile }); });