Get a specified state for page. A mode operator must be prepended.

Hierarchy

  • Question<boolean>
    • Screen

Properties

Accessors

Methods - Factory

Methods - Other

Methods - called internally

Methods - mode operators

Properties

abilityAlias?: string
callStack?: CallStackInfo[]

Accessors

  • get not(): this
  • make the Question check for the negative.

    Returns this

    new Screen instance

    Example: Verify with Element class.

    actor.asks(
    Screen.does.not.haveURL("https://example.com")
    );
  • get does(): Screen
  • make the verifying for the positive.

    Returns Screen

    new Screen instance

    Example: Verify with Screen class.

    actor.asks(
    Screen.does.haveUrl("https://example.com")
    );

Methods - Factory

Methods - Other

  • Parameters

    • entry: CallStackInfo

    Returns void

  • Parameters

    • calledWith: CallStackCalledWith

    Returns void

  • Set the alias which is used for an underlying ability

    Parameters

    • alias: undefined | string

      with which an ability was initialized

    Returns this

    current action

Methods - called internally

  • Verifies if an element.

    Parameters

    • actor: Actor

      the actor

    Returns Promise<boolean>

    true if the element has the specified state, false otherwise.

Methods - mode operators

  • Verifies if the page has URL.

    Parameters

    • name: string | string[]

      the screenshot name.

    • Optional options: {
          timeout?: number;
      }

      the timeout in milliseconds.

      • Optional timeout?: number

    Returns Screen

    this Screen instance

    Example

    simple call with just locator

    Screen.toHaveScreenshot('example.png');
    

    with options

    Screen.not.toHaveScreenshot(
    'example.png',
    { timeout: 1000 }
    );
  • Verifies if the page has URL.

    Parameters

    • title: string | RegExp
    • Optional options: {
          timeout?: number;
      }

      the timeout in milliseconds.

      • Optional timeout?: number

    Returns Screen

    this Screen instance

    Example

    simple call with just locator

    Screen.toHaveTitle('Title');
    

    with options

    Screen.not.toHaveTitle(
    'Title',
    { timeout: 1000 }
    );
  • Verifies if the page has URL.

    Parameters

    • url: string | RegExp

      the expected URL.

    • Optional options: {
          timeout?: number;
      }

      the timeout in milliseconds.

      • Optional timeout?: number

    Returns Screen

    this Screen instance

    Example

    simple call with just locator

    Screen.toHaveUrl('https://www.example.com');
    

    with options

    Screen.not.toHaveUrl('https://www.example.com', { timeout: 1000 });
    

Generated using TypeDoc