问题描述
我正在使用 codeceptJS 和 Playwright 构建一个框架。由于我需要编写更复杂的步骤,例如导航栏导航等,我计划在自定义帮助程序中编写这些功能 例如:-
navigatetoPage = (...items: string[]) => {
const { page } = this.helpers.Playwright;
items.forEach((item,index) => {
const navBarItem =
index === 0
? '//div[@class="topbar-items-container"]//*[contains(@class,"primary-title")]//*[normalize-space(text())="' + item + '"]'
: '//div[@class="topbar-items-container"]//ul//*[normalize-space(text())="' + item + '"]';
page.click();
// this.mouseHover(navBarItem);
// index === items.length - 1 && navBarItem.click();
});
};
在这里使用“页面”时,我没有自动完成。我们怎样才能使它成为可能 注意:我的自定义助手是一个 .ts 文件
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)