Get the current TurnContext out of DialogTestClient
See original GitHub issueIs 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
- Find the saved Values directly out of the MemoryStorage -> I can’t find the values that are saved there.
- I tried to get the values with
statePropertyAccessor.get(client.dialogContext.context);
. Theclient
is the DialogTestClient. I get the following error:
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@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 whileTestFlow
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 overTestFlow
. 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?