Options
All
  • Public
  • Public/Protected
  • All
Menu

Module toContainValue

Index

Functions

Functions

toContainValue

  • toContainValue(element: UIElement, expectedValue: string, options?: Options): Promise<SyncExpectationResult>
  • Use toContainValue function when you want to check that an element's value contains the expected string or substring

    example
    // could be used with Promise<ElementHandle>
    await expect(page.$('input')).toContainValue('A123');
    
    // or with ElementHandle
    const toastElement = await page.$('input);
    await expect(toastElement).toContainValue('A123');
    
    // or using an array of page and selector
    await expect([page, 'input']).toContainValue('A123');
    
    // also you can check value ignoring case sensitive
    await expect(page.$('input')).toContainValue('a123', {ignoreCase: true})
    

    Parameters

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

    Returns Promise<SyncExpectationResult>

Generated using TypeDoc