I'm getting the error from the title for this function:
it('should change comment status to SOLVED',
async function() {
await page.click("#view_replies3");
await change_comment_status(page, 5, 'SOLVED');
}).timeout(0);
After debugging I have figured out that the problem is in the function "change_comment_status()":
async function change_comment_status(page, comment_id, status) {
const selector = "input.custom-control-input[name='" +
comment_id.toString() + "']";
page.waitForSelector(selector);
await page.evaluate(selector => {
let element = document.querySelector(selector);
element.click();
}, selector);
}
the variable 'element' is null after the call
all the elements appear correctly in the page and the page looks like is fully loaded during the test running
Thanks, guys!