Last modified by Erik Bakker on 2023/01/24 15:14

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2
3 In this microlearning, we will focus on the creation of test messages which you can use while configuring and executing flow tests. Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
4
5 == 1. Prerequisites ==
6
7 * Basic knowledge of the eMagiz platform
8 * Understanding of the Flow testing concept
9
10 == 2. Key concepts ==
11
12 This microlearning centers around the creation of test messages for flow testing.
13 With flow testing, we mean: Testing each separate component (unit) within the context of a flow based on a supplied input (and an expected outcome).
14
15 To create test messages you can use for flow testing in eMagiz we provide you with four options:
16
17 * Create a message from scratch
18 * Create a message based on an example message
19 * Create message based on eMagiz definition
20 * Create a message based on an external definition
21
22 By choosing one of these options as your starting point you can easily create a test message.
23
24 Next, we will explain how you can best use each of these methods to your advantage
25
26
27
28 == 3. Creating Test Messages for Test Cases ==
29
30 To create a test message you navigate to the Create phase of eMagiz. Within the Create phase of eMagiz, you open the flow you want to flow test.
31 After you have opened the flow you should press the button on the bottom bar called Configure tests. This will lead you to the following canvas:
32
33 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--configure-test-overview.png]]
34
35 As we learned from our previous microlearning we first need to add (or edit) an test case. While in edit mode on the configure tests canvas you have the option to create messages that can be used within the context of the test case. eMagiz provides you with four distinct options to add/create test messages based on certain elements within or outside the portal. Each of these options is discussed in detail below:
36
37 * Create a message from scratch
38 * Create a message based on an example message
39 * Create message based on eMagiz definition
40 * Create a message based on an external definition
41
42 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-testmessage-overview.png]]
43
44 === 3.1 From scratch ===
45
46 In some cases, you have no information to go on when you want to flow test your flow. In these cases, you can use the option called Empty message.
47 With this option, you can create a message from scratch.
48
49 This means that you have the option to copy-paste or write out your message by hand.
50
51 Simply select the option Empty message and press Create. In the pop-up that follows you have to fill in a name (make it clear what the message is about) and fill in the content of the message
52
53 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-testmessage-from-scratch.png]]
54
55 When you are satisfied press Save. If you have doubts about the choice you made press back. If you made a mistake and want to start over again completely press Cancel.
56
57 === 3.2 Based on an example message ===
58
59 Ideally, example messages are known in advance and part of the Discovery.
60 In eMagiz, there is a centralized place where you store all relevant files and data belonging to integration and that is Capture.
61 You can also use this place to store example messages you have received from an external source
62
63 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--capture-testmessages.png]]
64
65 If you have added example messages in Capture or if there are existing messages in Create already you can now use these messages to create test messages for your flow test.
66 First, select the option From the existing file. Secondly, you have to choose whether you want your input message from Capture or Create
67
68 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--select-from-capture.png]]
69
70 If you choose Capture you can select all example messages you have added to this flow in Capture.
71 If you choose to Create you can select either all existing test messages attached to the current flow or select existing test messages within your project.
72 Remember our definition of what a flow test is. Based on that definition it is logical to choose the option Capture.
73
74 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--select-from-create.png]]
75
76 Regardless of the chosen option, the moment you are satisfied with your choice you should select the message and press Select. After you have selected one specific message you press Create.
77 eMagiz will now create a new test message based on your selection. In the pop-up that follows verify the name (make it clear what the message is about) and check the content.
78
79 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-from-example-message.png]]
80
81 When you are satisfied press Save. If you have doubts about the choice you made press back. If you made a mistake and want to start over again completely press Cancel.
82
83 === 3.3. Based on eMagiz definition ===
84
85 If you have used the eMagiz tooling in Design you have yet another choice to base your test messages on. This option is the option to create a message based on an eMagiz definition.
86 To start things off let us select the option eMagiz definition.
87 Within this context, we have to choose whether we want to use an eMagiz definition linked to this flow or one that is linked to the project as a whole.
88 Remember our definition of what a flow test is. Based on that definition it is logical to choose the option Current flow.
89
90 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--select-from-emagiz-definition.png]]
91
92 Furthermore, you have to select the correct message format (XML or JSON) and make a choice between Minimal or Complete.
93
94 By selecting Complete you get an example message based on all elements and attributes.
95 If you choose the option called Minimal you get an example message based on all required elements and attributes.
96
97 Regardless of the chosen options, the moment you are satisfied with your choice you should select the message and press Select. After you have selected one specific message you press Create.
98 eMagiz will now create a new test message based on your selection. In the pop-up that follows verify the name (make it clear what the message is about) and check the content.
99
100 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-from-emagiz-definition-minimal.png]]
101
102 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-from-emagiz-definition-complete.png]]
103
104 When you are satisfied press Save. If you have doubts about the choice you made press back. If you made a mistake and want to start over again completely press Cancel.
105
106 === 3.4 Based on external definition ===
107
108 If you have an external definition (.XSD) that is not yet attached to Capture nor the basis of an eMagiz definition you have the option to manually upload this definition so it can be the basis of your test message.
109 To do so you have to select the option External definition.
110
111 Just as with the previous option you have two choices to make before (or after) you upload the XSD. These choices are:
112
113 * Defining the message format (XML or JSON)
114 * Defining whether the example message will only hold the minimal set of required entities and attributes (Minimal) or all entities and attributes (Complete)
115
116 Regardless of the chosen options, within this context, you have to press the Upload button and select the file you want to Upload.
117
118 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--select-from-external-definition.png]]
119
120 After you have successfully uploaded the file you can either view the message so you can verify that you have uploaded the correct definition or press Create
121
122 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--selected-from-external-definition.png]]
123
124 After you press Create eMagiz will create a new test message based on your selection. In the pop-up that follows verify the name (make it clear what the message is about) and check the content.
125
126 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-creating-test-messages--create-from-external-definition.png]]
127
128 When you are satisfied press Save. If you have doubts about the choice you made press back. If you made a mistake and want to start over again completely press Cancel.
129
130 == 4. Key takeaways ==
131
132 * To create test messages you can use for flow testing in eMagiz we provide you with four options:
133 ** Create a message from scratch
134 ** Create a message based on an example message
135 ** Create message based on eMagiz definition
136 ** Create a message based on an external definition
137 * By choosing one of these options as your starting point you can easily create a test message.
138
139 == 5. Suggested additional readings ==
140
141 If you are interested in this topic and want more information on it please read the help text provided by eMagiz when executing these actions.
142 )))((({{toc/}}))){{/container}}{{/container}}