Skip to content

DCR: As a developer I would like to have a test client that would allow me to write unit tests for dialogs in isolation #5416

@gabog

Description

@gabog

Issue

TestFlow doesn't provide an easy way of write and debug tests for dialogs. Debugging step by step is cumbersome and the stack traces for test failures are hard to track.

Proposed change

Create a DialogTestClient that would allow developers to write unit tests for dialogs and use standard unit testing tools and frameworks.

The new testing client should be hosted in a separate package "Microsoft.Bot.Builder.Testing" that will host this class and the test framework for bots.

This package will be extended over time to include other testing classes and helpers.

Component Impact

  • Create new Microsoft.Bot.Builder.Testing to host the classes
  • Create new Microsoft.Bot.Builder.Testing.Tests to unit test the new classes

Implementation notes

  • 3rd party frameworks to adopt for each platform are:
  • Provide parity for SendActivity operations for test flow
  • Use TestAdapter if possible but also provide the ability to pass a custom adapter and a custom callback if needed
  • Provide the ability to pass a ChannelId to test different rendering conditions (right now TestAdapter passes ChannelId == "tests" which doesn't really allow the dev to test response rendering for different channels)

Customer Impact

NA: new feature

Tracking Status

Dotnet SDK (Tracked by 2028)

  • PR
  • Merged

Javascript SDK (Tracked by 969)

  • PR
  • Merged

Python SDK (Tracked by 198)

  • PR
  • Merged

[dcr]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions