question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get the current TurnContext out of DialogTestClient

See original GitHub issue

Is your feature request related to a problem? Please describe. I want to get the values of a new ConversationState(new MemoryStorage()) while testing a dialog. I would like to check if the dialog saves specific properties in the MemoryStorage.

Describe the solution you’d like Expose the TurnContext of the current turn in the test so I can access the data in the conversationState.

Describe alternatives you’ve considered

  1. Find the saved Values directly out of the MemoryStorage -> I can’t find the values that are saved there.
  2. I tried to get the values with statePropertyAccessor.get(client.dialogContext.context);. The client is the DialogTestClient. I get the following error: image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MatthiasGwiozdacommented, Oct 7, 2020

Understood! Thank you for your time. I think we have to switch to TestFlow as it gives us more flexibility.

Everything we can do with DialogTestClient, TestFlow can do it aswell. And even more.

0reactions
v-kydelacommented, Oct 7, 2020

@MatthiasGwiozda - While I have spent some time trying to figure out the unique purpose of DialogTestClient, it’s still a mystery to me. My best guess is that while TestFlow is used to test dialogs from the bot’s perspective, DialogTestClient is used to test dialogs from the client’s perspective. That is to say, a client won’t know what’s going on inside a bot with its turn context and all that, and will just see the bot’s outgoing activities. In the end, a dialog test client will end up just giving you less information so it’s still hard to see why that would be preferred over TestFlow. A dialog test client uses a test adapter internally anyway.

It’s possible that these two overlapping classes were just a result of multiple teams working on the SDK simultaneously and coming up with their own ways of doing things.

Does this resolve your issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DialogTestLogger class - Microsoft Learn
Example: let client = new DialogTestClient(DIALOG, OPTIONS, [new DialogTestLogger()]); ... TurnContext) for current turn of conversation with the user.
Read more >
How to Access User & Conversation Data in Test Functions for ...
My question that I would like to get data of "UserProfile" after I apply AutoSaveStateMiddleware in my test. Setting up AutoSaveStateMiddleware ...
Read more >
Integration Testing with Adaptive Dialogs in Bot Framework v4
In this article we get started with Adaptive Dialogs, setting a focus on integration testing. This is so, because integration testing can ...
Read more >
Working with Turn Context and State - Creating a Chatbot ...
Working with Turn Context and State - Creating a Chatbot Using the Azure Bot Framework SDK course from Cloud Academy. Start learning today...
Read more >
integración de ecommerce en chatbot vía API REST
Precisely among these uses, chatbots are present in ecommerce platforms to support users ... Get the state properties from the turn context.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found