Skip to main content

externalPerformActivities

An Ability that enables an Actor to perform a given Activity.

PerformActivities is used internally by Actor.attemptsTo, and it is unlikely you'll ever need to use it directly in your code. That is, unless you're building a custom Serenity/JS extension and want to override the default behaviour of the framework, in which case you should check out the Contributor's Guide.

Hierarchy

Index

Constructors

externalconstructor

Methods

externaltoJSON

  • Returns a JSON representation of the ability and its current state, if available. The purpose of this method is to enable reporting the state of the ability in a human-readable format, rather than to serialise and deserialise the ability itself.


    Returns SerialisedAbility

externalabilityType

  • Returns the most abstract type of this Ability instance, specifically the first class in the inheritance hierarchy that directly extends the Ability class.

    import { Ability } from '@serenity-js/core';

    class MyAbility extends Ability {}
    class MySpecialisedAbility extends MyAbility {}

    new MyAbility().abilityType(); // returns MyAbility
    new MySpecialisedAbility().abilityType(); // returns MyAbility

    Returns AbilityType<Ability>

externalperform

  • perform(activity: Activity): Promise<void>
  • Parameters

    Returns Promise<void>