develop #3
@@ -239,10 +239,23 @@ async function captureStep(page, stepName) {
|
|||||||
console.log('=====================================');
|
console.log('=====================================');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 首先展开系统管理菜单(如果是折叠状态)
|
||||||
|
const systemMenuSelector = '.el-sub-menu:has-text("系统管理")';
|
||||||
|
const systemMenuElement = page.locator(systemMenuSelector).first();
|
||||||
|
|
||||||
|
if (await systemMenuElement.count() > 0) {
|
||||||
|
// 点击展开系统管理菜单
|
||||||
|
await systemMenuElement.click();
|
||||||
|
await page.waitForTimeout(500);
|
||||||
|
|
||||||
|
// 然后点击参数配置菜单项
|
||||||
const configMenuSelectors = [
|
const configMenuSelectors = [
|
||||||
|
'.el-menu-item:has-text("参数配置")',
|
||||||
|
'.el-menu-item:has-text("系统配置")',
|
||||||
|
'.el-menu-item:has-text("配置管理")',
|
||||||
|
'text=参数配置',
|
||||||
'text=系统配置',
|
'text=系统配置',
|
||||||
'text=配置管理',
|
'text=配置管理',
|
||||||
'text=配置',
|
|
||||||
'[data-menu="config"]',
|
'[data-menu="config"]',
|
||||||
'a[href*="config"]'
|
'a[href*="config"]'
|
||||||
];
|
];
|
||||||
@@ -264,6 +277,9 @@ async function captureStep(page, stepName) {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error('未找到系统配置菜单');
|
throw new Error('未找到系统配置菜单');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new Error('未找到系统管理菜单');
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logTest('导航到系统配置页面', false, error.message);
|
logTest('导航到系统配置页面', false, error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user