我正在尝试运行它
await hoverElement.hover();
这样鼠标将悬停在有问题的元素上
我收到一条错误提示 TypeError: hoverElement.hover is not a function
我正在阅读剧作家 API 文档https://playwright.dev/#version=v1.5.2&path=docs%2Fapi.md&q=elementhandlehoveroptions
我究竟做错了什么?
test('Selection using hover Speak', async () => {
if (EnableTests.run_hover_speak === "true") {
const expectedResult = TestPage.Div2_Expected_Result;
const hoverElement = TestPage.Div2_css;
await test_functions._hoverSpeak(page);
await hoverElement.hover();
const highlightedText = await test_functions._hiliteSelection(page);
const actual = JSON.stringify(highlightedText); console.log("ACTUAL RESPONSE " + actual);
const expected = JSON.stringify(expectedResult); console.log("EXPECTED RESPONSE " + expected);
assert(expected === actual);
};
});