I've been struggling with this code and can't seem to get it to click the element or stop throwing errors. Can someone please help me correct this code?
async testMethod() {
let button = element( by.cssContainingText('span.mat-button-wrapper','abc'));
await browser.wait(until.visibilityOf(button), this.DEFAULT_WAIT_TIME_SECONDS * 1000, 'failed to click the button!');
button.getText().then((text)=>{
console.log('Get the text of the ele: ' + text.toUpperCase());
expect(text.toUpperCase()).toEqual(expectedValue);
});
await browser.manage().window().setSize(1000, 1000);
await browser.executeScript('window.scrollTo(0,document.body.scrollHeight)').then(()=>{
browser.actions().mouseMove(button).perform();
browser.sleep(10000);
});
/* await browser.executeScript("arguments[0].style.visibility = 'visible';",
"arguments[0].style.display = 'block';",
"arguments[0].scrollIntoView();",
button.getWebElement());
*/
browser.actions().mouseMove(button).perform();
browser.sleep(5000);
}