Debug <Values>
Hierarchy
- Interaction
- Debug
Index
Methods
staticvalues
Instructs the actor to evaluate the provided
values
, log the results, and then pass them to yourdebuggerFunction
.To use this interaction, run your test scenario in the Node.js debugger and set a breakpoint inside the
debuggerFunction
.Type parameters
- Values: unknown[]
Parameters
debuggerFunction: (results: { [ Index in string | number | symbol ]: DebuggingResult<Values[Index]> }, ...answers: { [ Index in string | number | symbol ]: Answered<Values[Index]> }) => void | Promise<void>
rest...values: Values
Returns Interaction
instantiationLocation
Returns the location where this Activity was instantiated.
Returns FileSystemLocation
toString
Generates a human-friendly description to be used when reporting this Activity.
Note: When this activity is reported, token
#actor
in the description will be replaced with the name of the actor performing this Activity.For example,
#actor clicks on a button
becomesWendy clicks on a button
.Returns string
performAs
Instructs the provided Actor to perform this Interaction.
Learn more
Parameters
actor: UsesAbilities & AnswersQuestions & CollectsArtifacts
Returns Promise<void>
Instructs the actor to evaluate and log the provided Answerable values.
Since this interaction accepts a callback function that receives the evaluated results, the best way to use it is while running the test scenario via a Node.js debugger. See the links below to learn how to do it in popular IDEs.
Debugging Answerable values
Debug.values accepts a callback function that receives an array of DebuggingResult objects, as well as the result of evaluating each provided answerable with Actor.answer.
Accessing Playwright Page
Playwright Test for VSCode provides features that allow for experimenting with web UI locators while the test is paused at breakpoint.
Since this functionality is specific to Playwright, you can use it by passing
PlaywrightPage.current().nativePage()
to Serenity/JS Debug.values. Also make sure to name the evaluated valuepage
, as this is the variable name that the Playwright VSCode extension expects.Learn more