优化文件路径

This commit is contained in:
dengqichen 2025-03-06 13:21:02 +08:00
parent 6e36aa1cd3
commit 3571f5fb0f

View File

@ -341,7 +341,7 @@ class LongiMainPage extends BasePage {
* @returns {Promise<Array>} 三级菜单项数组 * @returns {Promise<Array>} 三级菜单项数组
* @private * @private
*/ */
async getThirdLevelMenus(parentMenu) { async findThirdLevelMenus(parentMenu) {
// 检查三级菜单是否存在 // 检查三级菜单是否存在
const elements = await this.page.locator('.el-popper.is-light.el-popover .menuTitle.canClick').all(); const elements = await this.page.locator('.el-popper.is-light.el-popover .menuTitle.canClick').all();
if (elements.length === 0) { if (elements.length === 0) {
@ -379,7 +379,7 @@ class LongiMainPage extends BasePage {
await this.page.waitForTimeout(500); await this.page.waitForTimeout(500);
// 2. 获取三级菜单列表 // 2. 获取三级菜单列表
const thirdMenus = await this.getThirdLevelMenus(menu); const thirdMenus = await this.findThirdLevelMenus(menu);
if (thirdMenus.length === 0) { if (thirdMenus.length === 0) {
console.log(`未找到三级菜单项`); console.log(`未找到三级菜单项`);
return; return;
@ -455,7 +455,7 @@ class LongiMainPage extends BasePage {
} }
console.log(`📑 ${menu.text} 找到 ${tabs.length} 个TAB页`); console.log(`📑 ${menu.text} 找到 ${tabs.length} 个TAB页`);
const tabInfos = await this.getTabInfos(tabs); const tabInfos = await this.findTabInfos(tabs);
for (const tabInfo of tabInfos) { for (const tabInfo of tabInfos) {
if (!tabInfo.isActive) { if (!tabInfo.isActive) {
@ -475,7 +475,7 @@ class LongiMainPage extends BasePage {
* @returns {Promise<Array>} TAB页信息数组 * @returns {Promise<Array>} TAB页信息数组
* @private * @private
*/ */
async getTabInfos(tabs) { async findTabInfos(tabs) {
return Promise.all( return Promise.all(
tabs.map(async element => ({ tabs.map(async element => ({
text: await this.getTextByElement(element), text: await this.getTextByElement(element),