Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PageObjectBuilder

Contains all important interfaces to generate page-objects.

export
class

PageObjectBuilder

module

HVSTRCorePublicApi

Hierarchy

  • PageObjectBuilder

Index

Constructors

constructor

Properties

customSnippets

customSnippets: CustomSnippets

See CustomSnippets.

type

{CustomSnippets}

memberof

PageObjectBuilder

historyUidCounter

historyUidCounter: number

packagePath

packagePath: ProjectPathUtil

Methods

addFillForm

  • Adds two methods to the page-object, fillForm and clearForm. For each input element found on the page, the two methods will provide the following functionality.

    function description
    fillForm(data) The fillForm method will fill out any input element with the provided data. The data is provided by the data attribute, which requires a customized interface, according to all found inputs. Each inputs id will be a parameter for the function, in camelCase.
    clearForm() clears all content from all inputs.
    memberof

    PageObjectBuilder

    Parameters

    Returns Promise<IPageObjectInFabrication>

    the async method returns a Promise of IPageObjectInFabrication. See IPageObjectInFabrication for detailed information.

addNavigateTo

  • Adds a navigateTo function and a entity route to the page-object. The route entity is of type string and contains the route at the active browser state. The navigateTo method lets you navigate to the route.

    memberof

    PageObjectBuilder

    Parameters

    • scope: IPageObjectInFabrication

      The original page-object, which the navigateTo method and route entity will be added to.

    Returns Promise<IPageObjectInFabrication>

    the async method returns a Promise of IPageObjectInFabrication. See IPageObjectInFabrication for detailed information.

append

appendChild

  • Appends a page-object as child object to a parent page-object. The child-page-object will be composited as a entity to the parent page-object. When a new instance of the parent page-object is created, all child page-objects will be instantiated to.

    memberof

    PageObjectBuilder

    Parameters

    Returns Promise<IPageObjectInFabrication>

    the async method returns a Promise of IPageObjectInFabrication. The returned page-object is the parent page-object, containing the new child page-object. See IPageObjectInFabrication for detailed information.

Private executeByPreparer

generate

  • Generates a new page-object.

    memberof

    PageObjectBuilder

    throws

    When no name for the page-object, was contained in the passed instruct, an Error will be thrown.

    Parameters

    • instruct: IGenerationInstruction

      The Instruct parameter passes an object, which defines how the page-object should be generated. See more at IGenerationInstruction. The entity name is mandatory.

    • Optional origin: IPageObjectInFabrication

    Returns Promise<IPageObjectInFabrication>

    the async method returns a Promise of IPageObjectInFabrication. See IPageObjectInFabrication for detailed information.

Private getEmptyInstructFromOrigin

Private openAndGeneratePageObject

Private writePageObject

  • writePageObject(code: string, path: Path, overwrite?: boolean): void
  • should not be used, is not declared as private in code, for testing capability.

    Parameters

    • code: string
    • path: Path
    • Default value overwrite: boolean = true

    Returns void

Object literals

Private options

options: object

awaiter

awaiter: (Anonymous function) = (async () => { })

codeBuilder

codeBuilder: QueuedCodeBuilder = new QueuedCodeBuilder(' ')

doNotCreateDirectories

doNotCreateDirectories: false = false

e2eTestPath

e2eTestPath: string = "/e2e"

enableCustomBrowser

enableCustomBrowser: false = false

logger

logger: DefaultLogger = new DefaultLogger()

pageLoadTimeOut

pageLoadTimeOut: number = 0

waitForAngularEnabled

waitForAngularEnabled: true = true

Generated using TypeDoc