Options
All
  • Public
  • Public/Protected
  • All
Menu

Module __global

Index

Functions

Feature

  • Feature(description: string, metadata: IFeatureMetadata, bodyFunc: function): void
  • A Feature in wdio-workflo represents a collection of related Stories.

    Parameters

    • description: string

      the name or a short description of the Feature

    • metadata: IFeatureMetadata

      the metadata of the Feature

    • bodyFunc: function

      Define all Stories that belong to this Feature in the body of this function.

        • (): void
        • Returns void

    Returns void

Given

  • Given(description: string, bodyFunc?: function): ISpecGiven
  • Given describes an initial state of a Story.

    To join multiple initial states sequentially, you can either chain them together by appending .And to the end of this function or you can nest another Given inside the bodyFunc to express diverging "Story lines".

    Once you finished describing all initial states, you can invoke a state change by calling When inside the bodyFunc of this Given function.

    To validate an initial state with acceptance criteria, use Then inside the bodyFunc of Given.

    Parameters

    • description: string

      a short description of an initial state

    • Optional bodyFunc: function

      Use the body of this function to define acceptance criteria, nested initial states or state changes.

        • (): void
        • Returns void

    Returns ISpecGiven

Story

  • Story(id: string, description: string, metadata: IStoryMetaData, bodyFunc: function): void
  • A Story describes functional requirements of the tested application as a series of application states and state changes triggered by a user or a system. It contains acceptance criteria that validate the state following a state change to check if the functional requirements are met.

    Wdio-workflo evaluates all acceptance criteria defined within a Story and sets their result status accordingly.

    States, state changes and acceptance criteria can be implemented using the following functions:

    • Given to describe the initial state
    • When for state changes
    • Then to define acceptance criteria

    Parameters

    • id: string

      a unique id that identifies a Story (1.1, 2.4.5 etc...)

    • description: string

      the name or a short description of the Story

    • metadata: IStoryMetaData

      the metadata of the Story

    • bodyFunc: function

      Define all states, state changes and acceptance criteria of a Story in the body of this function.

        • (): void
        • Returns void

    Returns void

Then

  • Then(id: number, description: string): void
  • Then represents an acceptance criteria that validates an application state to check if a functional requirement was fulfilled.

    An acceptance criteria needs to be uniquely identifiable by a combination of its surrounding Story's id and its own id (eg. 2.4.5 [1], 2.4.5 [2], 1.1 [1]). The resulting id can be used to reference an acceptance criteria in a testcase's validate function.

    Wdio-workflo evaluates all validations defined inside testcases that reference an acceptance criteria and sets the result of the acceptance criteria accordingly:

    • Only if all validations for an acceptance criteria were successful, the criteria is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the criteria is marked as "failed".
    • If runtime errors occurred within at least one validation, the criteria is marked as "broken".
    • If an acceptance criteria is not referenced by any validation, the criteria is marked as "unvalidated".

    Parameters

    • id: number

      the id of an acceptance criteria which must be unique within its surrounding Story

    • description: string

      a short description of the expected state under validation

    Returns void

When

  • When(description: string, bodyFunc?: function): ISpecWhen
  • When describes a state change inside a Story that is triggered either by a user or by a system.

    To join multiple state changes sequentially, you can either chain them together by appending .And to the end of this function or you can nest another When inside the bodyFunc to express diverging "Story lines".

    To validate the state following a state change with acceptance criteria, use Then inside the bodyFunc of When.

    Parameters

    • description: string

      a short description of who did what to trigger a state change

    • Optional bodyFunc: function

      Use the body of this function to define acceptance criteria or nested state changes.

        • (): void
        • Returns void

    Returns ISpecWhen

expectElement

  • expectElement<Store, PageElementType, ValueType>(element: PageElementType): PageElementType extends infer ElementType ? ElementType extends ValuePageElement<Store, ValueType> ? IValueElementMatchers<ReturnType<ElementType["getValue"]>> : IElementMatchers : IElementMatchers
  • This function provides expectation matchers for PageElements or ValuePageElements.

    All template type parameters can be inferred automatically.

    template

    Store type of PageNodeStore used by the passed element

    template

    PageElementType type of the passed element

    template

    ValueType If the passed element is an instance of ValuePageElement, this is the type of the values handled in element's xxxValue functions.

    Type parameters

    Parameters

    • element: PageElementType

      an instance of PageElement or an instance of ValuePageElement

    Returns PageElementType extends infer ElementType ? ElementType extends ValuePageElement<Store, ValueType> ? IValueElementMatchers<ReturnType<ElementType["getValue"]>> : IElementMatchers : IElementMatchers

    the expectation matchers for PageElement or ValuePageElement

expectGroup

  • expectGroup<Store, Content, PageElementGroupType>(group: PageElementGroupType): PageElementGroupType extends infer GroupType ? GroupType extends ValuePageElementGroup<Store, Content> ? IValueGroupMatchers<PageElementGroupType["$"]> : IGroupMatchers<PageElementGroupType["$"]> : IGroupMatchers<...>
  • This function provides expectation matchers for PageElementGroups or ValuePageElementGroups.

    All template type parameters can be inferred automatically.

    template

    Store type of PageNodeStore used by the passed group

    template

    Content type of the content managed by the passed group

    template

    PageElementGroupType type of the passed group

    Type parameters

    Parameters

    • group: PageElementGroupType

      an instance of PageElementGroup or an instance of ValuePageElementGroup

    Returns PageElementGroupType extends infer GroupType ? GroupType extends ValuePageElementGroup<Store, Content> ? IValueGroupMatchers<PageElementGroupType["$"]> : IGroupMatchers<PageElementGroupType["$"]> : IGroupMatchers<...>

    the expectation matchers for PageElementGroup or ValuePageElementGroup

expectList

  • expectList<Store, PageElementType, PageElementOptions, PageElementListType, ValueType>(list: PageElementListType): PageElementListType extends infer ListType ? ListType extends ValuePageElementList<Store, ValuePageElement<Store, ValueType>, PageElementOptions, ValueType> ? IValueListMatchers<ReturnType<ListType["getValue"]>> : IListMatchers : IListMatchers
  • This function provides expectation matchers for PageElementLists or ValuePageElementLists.

    All template type parameters can be inferred automatically.

    template

    Store type of PageNodeStore used by the passed list and its elements

    template

    PageElementType type of the element's handled by the passed list

    template

    PageElementOptions options type of the element's handled by the passed list

    template

    PageElementListType type of the passed list

    template

    ValueType If the passed list is an instance of ValuePageElementList, this is the type of the values handled in the xxxValue functions of the elements managed by the list.

    Type parameters

    Parameters

    • list: PageElementListType

      an instance of PageElementList or an instance of ValuePageElementList

    Returns PageElementListType extends infer ListType ? ListType extends ValuePageElementList<Store, ValuePageElement<Store, ValueType>, PageElementOptions, ValueType> ? IValueListMatchers<ReturnType<ListType["getValue"]>> : IListMatchers : IListMatchers

    the expectation matchers for PageElementList or ValuePageElementList

expectMap

  • expectMap<Store, K, PageElementType, PageElementOptions, PageElementMapType, ValueType>(map: PageElementMapType): PageElementMapType extends infer MapType ? MapType extends ValuePageElementMap<Store, K, ValuePageElement<Store, ValueType>, PageElementOptions, any> ? IValueMapMatchers<Extract<keyof PageElementMapType["$"], string>, ReturnType<...>[keyof PageElementMapType["$"]]> : IMapMatchers<...> : IMapMatchers<...>
  • This function provides expectation matchers for PageElementMaps or ValuePageElementMaps.

    All template type parameters can be inferred automatically.

    template

    Store type of PageNodeStore used by the passed map and its elements

    template

    K the names of the elements stored in the map (the map's keys) as string literals

    template

    PageElementType type of the element's handled by the passed map

    template

    PageElementOptions options type of the element's handled by the passed map

    template

    PageElementMapType type of the passed map

    template

    ValueType If the passed map is an instance of ValuePageElementMap, this is the type of the values handled in the xxxValue functions of the elements managed by the map.

    Type parameters

    Parameters

    • map: PageElementMapType

      an instance of PageElementMap or an instance of ValuePageElementMap

    Returns PageElementMapType extends infer MapType ? MapType extends ValuePageElementMap<Store, K, ValuePageElement<Store, ValueType>, PageElementOptions, any> ? IValueMapMatchers<Extract<keyof PageElementMapType["$"], string>, ReturnType<...>[keyof PageElementMapType["$"]]> : IMapMatchers<...> : IMapMatchers<...>

    the expectation matchers for PageElementMap or ValuePageElementMap

expectPage

  • expectPage<Store, PageType, IsOpenOpts, IsClosedOpts>(page: PageType): IPageMatchers<IsOpenOpts, IsClosedOpts>
  • This function provides expectation matchers for Pages.

    All template type parameters can be inferred automatically.

    template

    Store type of PageNodeStore used by the passed element

    template

    PageElementType type of the passed element

    template

    ValueType If the passed element is an instance of ValuePageElement, this is the type of the values handled in element's xxxValue functions.

    Type parameters

    • Store: PageNodeStore

    • PageType: Page<Store, IsOpenOpts, IsClosedOpts>

    • IsOpenOpts: __type

    • IsClosedOpts: __type

    Parameters

    • page: PageType

    Returns IPageMatchers<IsOpenOpts, IsClosedOpts>

    the expectation matchers for PageElement or ValuePageElement

fFeature

  • fFeature(description: string, metadata: IFeatureMetadata, bodyFunc: function): void
  • If one or more Features in a scope (usually a .spec.ts file) are marked as "fFeature", the test runner will execute only these Features and ignore all other Features defined in the same scope.

    A Feature in wdio-workflo represents a collection of related Stories.

    Parameters

    • description: string

      the name or a short description of the Feature

    • metadata: IFeatureMetadata

      the metadata of the Feature

    • bodyFunc: function

      Define all Stories that belong to this Feature in the body of this function.

        • (): void
        • Returns void

    Returns void

fStory

  • fStory(id: string, description: string, metadata: IStoryMetaData, bodyFunc: function): void
  • If one or more Stories in a Feature are marked as "fStory", the test runner will execute only these Stories and ignore all other Stories defined in the same Feature.

    A Story describes functional requirements of the tested application as a series of application states and state changes triggered by a user or a system. It contains acceptance criteria that validate the state following a state change to check if the functional requirements are met.

    Wdio-workflo evaluates all acceptance criteria defined within a Story and sets their result status accordingly.

    States, state changes and acceptance criteria can be implemented using the following functions:

    • Given to describe the initial state
    • When for state changes
    • Then to define acceptance criteria

    Parameters

    • id: string

      a unique id that identifies a Story (1.1, 2.4.5 etc...)

    • description: string

      the name or a short description of the Story

    • metadata: IStoryMetaData

      the metadata of the Story

    • bodyFunc: function

      Define all states, state changes and acceptance criteria of a Story in the body of this function.

        • (): void
        • Returns void

    Returns void

fThen

  • fThen(id: number, description: string): void
  • If one or more acceptance criteria in a Story are marked as "fThen", the test runner will execute only these acceptance criteria and ignore all others defined in the same Story.

    Then represents an acceptance criteria that validates an application state to check if a functional requirement was fulfilled.

    An acceptance criteria needs to be uniquely identifiable by a combination of its surrounding Story's id and its own id (eg. 2.4.5 [1], 2.4.5 [2], 1.1 [1]). The resulting id can be used to reference an acceptance criteria in a testcase's validate function.

    Wdio-workflo evaluates all validations defined inside testcases that reference an acceptance criteria and sets the result of the acceptance criteria accordingly:

    • Only if all validations for an acceptance criteria were successful, the criteria is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the criteria is marked as "failed".
    • If runtime errors occurred within at least one validation, the criteria is marked as "broken".
    • If an acceptance criteria is not referenced by any validation, the criteria is marked as "unvalidated".

    Parameters

    • id: number

      the id of an acceptance criteria which must be unique within its surrounding Story

    • description: string

      a short description of the expected state under validation

    Returns void

fsuite

  • fsuite(description: string, metadata: ISuiteMetadata, bodyFunc: function): void
  • If one or more suites in a scope (usually a .tc.ts file) are marked as "fsuite", the test runner will execute only these suites and ignore all others defined in the same scope.

    A suite is a collection of related testcases.

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ISuiteMetadata

      the metadata of the suite

    • bodyFunc: function

      define all testcases for this suite inside the body of this function

        • (): void
        • Returns void

    Returns void

ftestcase

  • ftestcase(description: string, metadata: ITestcaseMetadata, bodyFunc: function): void
  • If one or testcases in a suite are marked as "fTestcase", the test runner will execute only testcases and ignore all others defined in the same suite.

    A testcase is composed of a sequence of steps.

    Each step represents a single or multiple interactions with the tested application and allows you to pass a step callback in order to perform validations of the application state right after the step was performed.

    Wdio-workflo evaluates all validations defined within a testcase and sets the testcase status accordingly:

    • Only if all validations defined within a testcase were successful, the testcase is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the testcase is marked as "failed".
    • If runtime errors occurred anywhere inside a testcase, the testcase is marked as "broken".
    • A testcase can also be marked as "pending" if it was not executed because it was marked with "xtestcase" or because a bail option was specified and the bail limit was already reached.

    Steps and validations can be implemented using the following functions:

    • given to establish the initial state
    • when to describe changes of the application state
    • validate to perform validations of the application state inside a step callback

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ITestcaseMetadata

      the metadata of the testcase

    • bodyFunc: function

      define all steps for this testcase inside the body of this function

        • (): void
        • Returns void

    Returns void

getUid

  • getUid(str: string): string
  • Returns a unique id by concatenating the passed string and a counter value that is incremented on each invocation of the function with the same passed string.

    Pairs of each passed string and the latest value of its respective counter are stored in the file uidStore.json and will be preserved for the next test run. To reset a single counter value, you can edit this file. To reset all counter values, you can delete it.

    Parameters

    • str: string

      a string for which to create a unique id

    Returns string

    the generated unique id

given

  • The given function establishes the initial state of a tested application by executing the passed step.

    You can also chain together multiple given statements to create the initial state by appending .and to the end of this function.

    Once you finished establishing the initial state(s), you can trigger a state change by appending a .when step to the end of the given function/chain. State change steps can also be chained together sequentially by appending .and to the end of the step chain.

    Parameters

    • step: IStep

      a step that establishes the initial state

    Returns ITCGiven

suite

  • suite(description: string, metadata: ISuiteMetadata, bodyFunc: function): void
  • A suite is a collection of related testcases.

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ISuiteMetadata

      the metadata of the suite

    • bodyFunc: function

      define all testcases for this suite inside the body of this function

        • (): void
        • Returns void

    Returns void

testcase

  • testcase(description: string, metadata: ITestcaseMetadata, bodyFunc: function): void
  • A testcase is composed of a sequence of steps strung together in a step chain.

    Each step represents a single or multiple interactions with the tested application and allows you to pass a step callback in order to perform validations of the application state right after the step was performed.

    Wdio-workflo evaluates all validations defined within a testcase and sets the testcase status accordingly:

    • Only if all validations defined within a testcase were successful, the testcase is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the testcase is marked as "failed".
    • If runtime errors occurred anywhere inside a testcase, the testcase is marked as "broken".
    • A testcase can also be marked as "pending" if it was not executed because it was marked with "xtestcase" or because a bail option was specified and the bail limit was already reached.

    Steps and validations can be implemented using the following functions:

    • given to establish the initial state
    • when to describe changes of the application state
    • validate to perform validations of the application state inside a step callback

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ITestcaseMetadata

      the metadata of the testcase

    • bodyFunc: function

      define all steps for this testcase inside the body of this function

        • (): void
        • Returns void

    Returns void

validate

  • The validate function provides the means to validate an application state. It MUST BE PLACED INSIDE A STEP CALLBACK, otherwise validations will not function properly.

    Validations can reference a single or more acceptance criteria in one or more Stories:

    In order for wdio-workflo to know which specs (Features, Stories, acceptance criteria) should be validated by this function, you need to pass a validateObject as first parameter. This object's keys are the ids of the validated Stories (eg."2.4.5") and its values are either a single id (eg. 3) or an ids array (eg. [3, 4, 5]) of acceptance criteria defined within the associated Story.

    The result status of a validation is determined by the results of all expectation matchers (eg. expect(1).toBe(2)) defined within its validationFunc:

    • If all expectation matchers pass, the validation is marked as 'passed'.
    • If one or more expectation matchers failed (actual value did not match expected value), the validation is marked as 'failed'.
    • If a runtime error occurred inside the validationFunc, the validation is marked as 'broken'.

    Parameters

    • validateObject: IValidateSpecObject

      an object whose keys represent the ids of Stories to be validated and whose values are either a single id or an array of ids of validated acceptance criteria

    • validationFunc: function

      Define all expectation matchers that together determine the result of this validation inside the body of this function.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

xFeature

  • xFeature(description: string, metadata: IFeatureMetadata, bodyFunc: function): void
  • All Features marked as "xFeature" will not be executed by the test runner.

    A Feature in wdio-workflo represents a collection of related Stories.

    Parameters

    • description: string

      the name or a short description of the Feature

    • metadata: IFeatureMetadata

      the metadata of the Feature

    • bodyFunc: function

      Define all Stories that belong to this Feature in the body of this function.

        • (): void
        • Returns void

    Returns void

xStory

  • xStory(id: string, description: string, metadata: IStoryMetaData, bodyFunc: function): void
  • All Stories marked as "xStory" will not be executed by the test runner.

    A Story describes functional requirements of the tested application as a series of application states and state changes triggered by a user or a system. It contains acceptance criteria that validate the state following a state change to check if the functional requirements are met.

    Wdio-workflo evaluates all acceptance criteria defined within a Story and sets their result status accordingly.

    States, state changes and acceptance criteria can be implemented using the following functions:

    • Given to describe the initial state
    • When for state changes
    • Then to define acceptance criteria

    Parameters

    • id: string

      a unique id that identifies a Story (1.1, 2.4.5 etc...)

    • description: string

      the name or a short description of the Story

    • metadata: IStoryMetaData

      the metadata of the Story

    • bodyFunc: function

      Define all states, state changes and acceptance criteria of a Story in the body of this function.

        • (): void
        • Returns void

    Returns void

xThen

  • xThen(id: number, description: string): void
  • All acceptance criteria marked as "xThen" will not be executed by the test runner.

    Then represents an acceptance criteria that validates an application state to check if a functional requirement was fulfilled.

    An acceptance criteria needs to be uniquely identifiable by a combination of its surrounding Story's id and its own id (eg. 2.4.5 [1], 2.4.5 [2], 1.1 [1]). The resulting id can be used to reference an acceptance criteria in a testcase's validate function.

    Wdio-workflo evaluates all validations defined inside testcases that reference an acceptance criteria and sets the result of the acceptance criteria accordingly:

    • Only if all validations for an acceptance criteria were successful, the criteria is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the criteria is marked as "failed".
    • If runtime errors occurred within at least one validation, the criteria is marked as "broken".
    • If an acceptance criteria is not referenced by any validation, the criteria is marked as "unvalidated".

    Parameters

    • id: number

      the id of an acceptance criteria which must be unique within its surrounding Story

    • description: string

      a short description of the expected state under validation

    Returns void

xpath

  • Returns an instance of XPathBuilder to create XPath expressions using functions instead of writing the whole XPath as a raw string.

    Using XPathBuilder can help to reduce the number of errors originating from a wrong usage of the sometimes quite complex syntax of XPath.

    Parameters

    • selector: string

      the initial XPath selector (eg. "//div", "/span")

    Returns XPathBuilder

    an instance of XPathBuilder

xsuite

  • xsuite(description: string, metadata: ISuiteMetadata, bodyFunc: function): void
  • All suites marked as "xsuite" will not be executed by the test runner.

    A suite is a collection of related testcases.

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ISuiteMetadata

      the metadata of the suite

    • bodyFunc: function

      define all testcases for this suite inside the body of this function

        • (): void
        • Returns void

    Returns void

xtestcase

  • xtestcase(description: string, metadata: ITestcaseMetadata, bodyFunc: function): void
  • All testcases criteria marked as "xtestcase" will not be executed by the test runner.

    A testcase is composed of a sequence of steps.

    Each step represents a single or multiple interactions with the tested application and allows you to pass a step callback in order to perform validations of the application state right after the step was performed.

    Wdio-workflo evaluates all validations defined within a testcase and sets the testcase status accordingly:

    • Only if all validations defined within a testcase were successful, the testcase is marked as "passed".
    • If one or more validations were unsuccessful (the actual value did not match the expected value), the testcase is marked as "failed".
    • If runtime errors occurred anywhere inside a testcase, the testcase is marked as "broken".
    • A testcase can also be marked as "pending" if it was not executed because it was marked with "xtestcase" or because a bail option was specified and the bail limit was already reached.

    Steps and validations can be implemented using the following functions:

    • given to establish the initial state
    • when to describe changes of the application state
    • validate to perform validations of the application state inside a step callback

    Parameters

    • description: string

      the name or a short description of the suite

    • metadata: ITestcaseMetadata

      the metadata of the testcase

    • bodyFunc: function

      define all steps for this testcase inside the body of this function

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc