You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/addARMServiceConnection.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,18 @@ Go to [Service connections](https://docs.microsoft.com/en-us/azure/devops/pipeli
9
9
## Requirements
10
10
11
11
- An [Azure DevOps Organization](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops).
12
+
- An [Azure AD application and Service Principal](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal) (*).
12
13
- Access to an active [Azure Resource Manager](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/overview).
13
14
15
+
(*) The Service Principal needs to have a `Contributor` role in the suscription to be able to create resource groups.
16
+
14
17
## Steps
15
18
16
19
- From your Azure DevOps project, go to `Project settings -> Service Connections -> New Service connection`.
- Select `Azure Resource Manager -> Service principal (manual)` and fill out the form. Check the `Grant access permission to all pipelines` option. The name you use for the Subscription Name field will be your `AzureSubscription` variable in the pipelines.
23
+
- Select `Azure Resource Manager -> Service principal (manual)` and fill out the form. Check the `Grant access permission to all pipelines` option. The name you use for the Subscription Name field will be your `AzureSubscription` variable in the pipelines.[More Info](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-with-an-existing-service-principal).
The following steps will guide you on how to manually set up App Registrations.
4
4
By default, App Registrations are created and used automatically across the [pipelines](./pipelines.md), but the possibility of setting them up manually is available.
@@ -16,12 +16,12 @@ To skip stages, simple click on Stages to run, deselect them, and click Use sele
16
16
17
17
## Create App Registrations
18
18
19
-
App Registration credentials must be created for each bot to be deployed and tested (there are fourteen currently, but the number is expected to increase in the future).
19
+
App Registration credentials must be created for each bot to be deployed and tested (see [Available Bots](./availableBotsList.md)).
20
20
To do this, you could head to [App Registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) on Azure and create them one by one, but we created a PowerShell script to create registration batches automatically. The only requirement to run it is to have access to an active Azure account.
21
21
22
22
Click [here](./media/CreateAppRegistrations.ps1) to go to the script.
23
23
24
-
Executing it will prompt you to log into your account with your default browser, then to define a prefix for the registration names, and finally for the amount of registrations to create. Both have default values (triggered by pressing Enter) to accommodate for the creation of fourteen credentials with generic names.
24
+
Executing the script will prompt you to log into your account with your default browser, then to define a prefix for the registration names, and finally for the amount of registrations to create. Both have default values (triggered by pressing Enter) to accommodate for the creation of eighteen credentials with generic names.
25
25
The creation process will start, displaying each registration's name, ID, and password created while running.
The following list contains all current variable names to be created, each credential pair can be populated with any of the ones created in the [Create App Registrations](#create-app-registrations) step.
44
-
43
+
You must create a pair of variables for each bot in the [list of available bots](./availableBotsList.md) adding `AppId` and `AppSecret` to the bot's name.
44
+
For example:
45
45
- BffnEchoSkillBotComposerDotNetAppId
46
46
- BffnEchoSkillBotComposerDotNetAppSecret
47
-
- BffnEchoSkillBotDotNet21AppId
48
-
- BffnEchoSkillBotDotNet21AppSecret
49
-
- BffnEchoSkillBotDotNetAppId
50
-
- BffnEchoSkillBotDotNetAppSecret
51
-
- BffnEchoSkillBotDotNetV3AppId
52
-
- BffnEchoSkillBotDotNetV3AppSecret
53
-
- BffnEchoSkillBotJSAppId
54
-
- BffnEchoSkillBotJSAppSecret
55
-
- BffnEchoSkillBotJSV3AppId
56
-
- BffnEchoSkillBotJSV3AppSecret
57
-
- BffnEchoSkillBotPythonAppId
58
-
- BffnEchoSkillBotPythonAppSecret
59
-
- BffnSimpleHostBotComposerDotNetAppId
60
-
- BffnSimpleHostBotComposerDotNetAppSecret
61
-
- BffnSimpleHostBotDotNet21AppId
62
-
- BffnSimpleHostBotDotNet21AppSecret
63
-
- BffnSimpleHostBotDotNetAppId
64
-
- BffnSimpleHostBotDotNetAppSecret
65
-
- BffnSimpleHostBotJSAppId
66
-
- BffnSimpleHostBotJSAppSecret
67
-
- BffnSimpleHostBotPythonAppId
68
-
- BffnSimpleHostBotPythonAppSecret
69
-
- BffnWaterfallHostBotDotNetAppId
70
-
- BffnWaterfallHostBotDotNetAppSecret
71
-
- BffnWaterfallSkillBotDotNetAppId
72
-
- BffnWaterfallSkillBotDotNetAppSecret
47
+
48
+
Each credential pair can be populated with any of the ones created in the [Create App Registrations](#create-app-registrations) step.
73
49
74
50
Don't forget to click on SAVE once you've finished setting up every variable.
Lastly, you'll have to create new variables for the [Run Test Scenarios](../build/yaml/testScenarios/runTestScenarios.yml), same steps apply.
79
-
This pipeline requires only the App Registration IDs of the skill bots, so the list is shorter. Just be sure to use the same IDs as with the [Deploy Bot Resources](../build/yaml/deployBotResources/deployBotResources.yml) pipeline.
80
-
55
+
This pipeline requires only the App Registration IDs of the skill bots, so the list is shorter.
56
+
For example:
81
57
- BffnEchoSkillBotComposerDotnetAppId
82
-
- BffnEchoSkillBotDotNet21AppId
83
-
- BffnEchoSkillBotDotNetAppId
84
-
- BffnEchoSkillBotDotNetV3AppId
85
-
- BffnEchoSkillBotJSAppId
86
-
- BffnEchoSkillBotJSV3AppId
87
-
- BffnEchoSkillBotPythonAppId
88
-
- BffnWaterfallSkillBotDotNetAppId
58
+
59
+
Just be sure to use the same IDs as with the [Deploy Bot Resources](../build/yaml/deployBotResources/deployBotResources.yml) pipeline.
Transcript Converter is a command line tool to convert `.transcript` files from different channels (BotFramework-Emulator, Teams, Slack, etc.)* into a test script used to replicate the messages sent by the user and evaluate the answers from the bot.
6
+
This test script is the input for the [Transcript Test Runner](../TranscriptTestRunner/TranscriptTestRunner.csproj).
7
+
8
+
(*) _This first version supports BotFramework-Emulator transcript files. Stay tuned for the next features._
9
+
10
+
## The Test Script
11
+
A Test Script is basically a JSON file with an array of [TestScriptItem](TestScriptItem.cs) that will be used by the `TranscriptTestRunner` as a test input.
12
+
13
+
You can also create a test script file using this [JSON schema](../TranscriptTestRunner/testscript.schema).
14
+
```json
15
+
[
16
+
{
17
+
"type": "conversationUpdate",
18
+
"role": "user"
19
+
},
20
+
{
21
+
"type": "message",
22
+
"role": "bot",
23
+
"text": "Hello and welcome!",
24
+
"assertions": [
25
+
"type == 'message'",
26
+
"from.role == 'bot'",
27
+
"recipient.role == 'user'",
28
+
"text == 'Hello and welcome!'",
29
+
"inputHint == 'acceptingInput'"
30
+
]
31
+
},
32
+
{
33
+
"type": "message",
34
+
"role": "user",
35
+
"text": "Hi"
36
+
}
37
+
]
38
+
```
39
+
> **Note:** The JSON Schema is still a work in progress.
40
+
41
+
## User Step-by-step Guide
42
+
This step-by-step guide shows how to convert a BotFramework-Emulator transcript file into a test script.
43
+
44
+
1- After installing the tool open a terminal and execute the following command:
- The first argument is the absolute or relative path to the transcript file.
50
+
To create a transcript file, follow [these steps](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-debug-transcript?view=azure-bot-service-4.0#creatingstoring-a-bot-transcript-file).
51
+
52
+
- The second argument is optional, and sets the path to the folder where the test script will be created. If not provided, the test script will have the same name and location that the transcript.
53
+
54
+
2- Once the Test Script file is created, store it in a folder on your test project and pass it to the _RunTestAsync_ method of the `TestRunner` to execute the test.
Copy file name to clipboardExpand all lines: Libraries/TranscriptTestRunner/README.md
+29-59
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,15 @@
3
3
## Summary
4
4
5
5
Transcript Test Runner aims to simplify complex conversation scenarios against bots.
6
-
Starting from a transcript file containing the user-bot interactions to be tested, the Transcript Test Runner converts the transcript into a test script used to replicate the messages sent by the user and evaluate the answers from the bot.
6
+
Starting from a [test script](testscript.schema)file containing the user-bot interactions to be tested, the Transcript Test Runner replicates the messages sent by the user and evaluates the answers from the bot.
7
7
8
-
The Transcript Test Runner also offers the possibility of running the tests directly from a [test script](testscript.schema), adding flexibility to the assertions for the bot's messages.
9
-
10
-
The Test Runner supports different formats of transcript files (Emulator, Teams, Slack, etc.) and
11
-
can be connected to the bots using different channels (*):
12
-
- DirectLineClient
13
-
- TeamsClient
14
-
- SlackClient
15
-
- FacebookClient
16
-
17
-
(*) _This first version implements the DirectLineClient and uses Emulator transcript files. Stay tuned for the next features._
8
+
A Test Script is basically a JSON file with an array of [TestScriptItem](TestScriptItem.cs) that will be used by the `TestRunner` as a test input.
18
9
19
10
## User Step-by-step Guide
20
-
This step-by-step guide shows how to run a test with the `TestRunner` configuring a `DirectLine` client to communicate with the bots, and starting from an Emulator transcript file.
11
+
This step-by-step guide shows how to run a test with the `TestRunner` configuring a `DirectLine` client to communicate with the bots.
12
+
13
+
### Creating the Test Script file
14
+
You can convert a transcript file into a test script using the [Transcript Converter](../TranscriptConverter/TranscriptConverter.csproj) tool or create one manually using this [JSON schema](testscript.schema).
21
15
22
16
### Using the TestRunner
23
17
1- Open your test project and install the `TranscriptTestRunner` package.
@@ -32,65 +26,37 @@ This step-by-step guide shows how to run a test with the `TestRunner` configurin
32
26
33
27
> **Note:** For more information on how to obtain the bot `DIRECTLINE` secret key, follow [this guide](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directline).
34
28
35
-
3- Add the `Emulator Transcript` file in a folder on your test project. To create a transcript file, follow [these steps](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-debug-transcript?view=azure-bot-service-4.0#creatingstoring-a-bot-transcript-file).
29
+
3- Add the `Test Script` file in a folder on your test project.
// Instantiate the TestRunner and set up the DirectLine client.
44
41
varrunner=newTestRunner(directLineClient);
45
42
46
-
// Run the test recorded in the transcript file.
47
-
awaitrunner.RunTestAsync("<path to the transcript file>");
48
-
```
49
-
The `TestRunner` will convert the transcript file into a Test Script with the messages the user sends to the bot and the assertions that should be made to the bot's answers.
50
-
51
-
The `TestRunner` also allows you to run the test from a custom Test Script file.
52
-
53
-
### Using a Test Script file
54
-
A Test Script is basically a JSON file with an array of [TestScriptItem](TestScriptItem.cs) that will be used by the `TestRunner` as a test input.
55
-
56
-
Create a test script file using this [JSON schema](testscript.schema).
57
-
```json
58
-
[
59
-
{
60
-
"type": "conversationUpdate",
61
-
"role": "user"
62
-
},
63
-
{
64
-
"type": "message",
65
-
"role": "bot",
66
-
"text": "Hello and welcome!",
67
-
"assertions": [
68
-
"type == 'message'",
69
-
"from.role == 'bot'",
70
-
"recipient.role == 'user'",
71
-
"text == 'Hello and welcome!'",
72
-
"inputHint == 'acceptingInput'"
73
-
]
74
-
},
75
-
{
76
-
"type": "message",
77
-
"role": "user",
78
-
"text": "Hi"
79
-
}
80
-
]
43
+
// Run the test recorded in the test script file.
44
+
awaitrunner.RunTestAsync("<path to the test script file>");
81
45
```
82
-
> **Note:** The JSON Schema is still a work in progress.
46
+
The `TestRunner` will execute test script sending the user messages to the bot performing the assertions over the bot's answers.
83
47
84
-
Once the Test Script file is created, store it in a folder on your test project and pass it to the _RunTestAsync_ method of the TestRunner instead of the transcript file.
85
48
86
49
### Creating tests programmatically
87
-
The `TestRunner` allows you to run tests in a programmatic way, sending Activities to the bot and Assert its reply.
50
+
The `TestRunner` allows you to run tests in a programmatic way, sending Activities to the bot and asserting its reply.
88
51
89
52
The following sample shows how to create a simple test programmatically.
0 commit comments