Use toHaveValue function when you want to check that an element's value is equal to the expected value
example
// could be used with Promise<ElementHandle>awaitexpect(page.$('input')).toHaveValue('user');// or with ElementHandleconsttoastElement = awaitpage.$('input);awaitexpect(toastElement).toHaveValue('user');// or using an array of page and selectorawaitexpect([page, 'input']).toHaveValue('user');// also you can check value ignoring case sensitiveawaitexpect(page.$('input')).toHaveValue('USER', {ignoreCase:true})
Use
toHaveValue
function when you want to check that an element's value is equal to the expected value