From 6ae57a324993569d5d0800a6c25fe65218fd10e4 Mon Sep 17 00:00:00 2001 From: wuyiping0628 <42107997+wuyiping0628@users.noreply.github.com> Date: Fri, 1 Mar 2024 00:27:22 -0800 Subject: [PATCH] test(dept): [dept] Fix test cases (#1452) * test(dept): [dept] Fix test cases * test(dept): [dept] Fix test cases --- .../demos/pc/app/dept/custom-service.spec.ts | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/sites/demos/pc/app/dept/custom-service.spec.ts b/examples/sites/demos/pc/app/dept/custom-service.spec.ts index e5a9b7027..37139bec1 100644 --- a/examples/sites/demos/pc/app/dept/custom-service.spec.ts +++ b/examples/sites/demos/pc/app/dept/custom-service.spec.ts @@ -5,13 +5,25 @@ test('自定义服务数据', async ({ page }) => { await page.goto('dept#custom-service') const iconBox = page.locator('.tiny-input__suffix-inner svg') await iconBox.first().click() - await page.getByPlaceholder('可输入部门编码或名称').click() + await page.getByPlaceholder('可输入部门编码或名称').first().click() await page.getByText('无线网络业务架构与设计部').click() - await page.locator('.col-xs-9 > .tiny-select > div > .tiny-input > .tiny-input__inner').first().click() + await page + .locator('div') + .filter({ hasText: /^公司SZ技术SZ海洋网络天闻数媒贝托SZ鼎桥通信$/ }) + .getByRole('textbox') + .click() await page.getByRole('listitem').filter({ hasText: 'SZ技术' }).click() - await page.locator('div:nth-child(3) > .col-xs-9 > .tiny-select > div > .tiny-input > .tiny-input__inner').click() + await page + .locator('div') + .filter({ hasText: /^一级部门测试数据室XX中国XX测试数据部测试数据XX管理部$/ }) + .getByRole('textbox') + .click() await page.getByRole('listitem').filter({ hasText: '测试数据室XX' }).click() - await page.locator('div:nth-child(7) > .col-xs-9 > .tiny-select > div > .tiny-input > .tiny-input__inner').click() + await page + .locator('div') + .filter({ hasText: /^五级部门测试数据室XX中国XX测试数据部测试数据XX管理部$/ }) + .getByRole('textbox') + .click() await page.getByRole('listitem').filter({ hasText: '测试数据室XX' }).click() await page.waitForTimeout(500) await page.getByRole('button', { name: '确定' }).click()