Options
All
  • Public
  • Public/Protected
  • All
Menu

Module toHaveValue

Index

Functions

Functions

toHaveValue

  • toHaveValue(element: UIElement, expectedValue: string, options?: Options): Promise<SyncExpectationResult>
  • 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>
    await expect(page.$('input')).toHaveValue('user');
    
    // or with ElementHandle
    const toastElement = await page.$('input);
    await expect(toastElement).toHaveValue('user');
    
    // or using an array of page and selector
    await expect([page, 'input']).toHaveValue('user');
    
    // also you can check value ignoring case sensitive
    await expect(page.$('input')).toHaveValue('USER', {ignoreCase: true})
    

    Parameters

    • element: UIElement
    • expectedValue: string
    • Optional options: Options

    Returns Promise<SyncExpectationResult>

Generated using TypeDoc