lundi 2 novembre 2020

Playwright - TypeError: hoverElement.hover is not a function

I am trying to run this

await hoverElement.hover();

so that the mouse will hover over the element in question

I get an error saying TypeError: hoverElement.hover is not a function

I am reading from the playwright API documentation https://playwright.dev/#version=v1.5.2&path=docs%2Fapi.md&q=elementhandlehoveroptions

What am I doing wrong?

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);

};

});

Aucun commentaire:

Enregistrer un commentaire