robotframework-webdialogs 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. robotframework_webdialogs-0.2.0/LICENSE +201 -0
  2. robotframework_webdialogs-0.2.0/MANIFEST.in +4 -0
  3. robotframework_webdialogs-0.2.0/PKG-INFO +218 -0
  4. robotframework_webdialogs-0.2.0/README.md +178 -0
  5. robotframework_webdialogs-0.2.0/requirements.txt +3 -0
  6. robotframework_webdialogs-0.2.0/setup.cfg +4 -0
  7. robotframework_webdialogs-0.2.0/setup.py +50 -0
  8. robotframework_webdialogs-0.2.0/src/WebDialogs/__init__.py +3 -0
  9. robotframework_webdialogs-0.2.0/src/WebDialogs/client/__init__.py +0 -0
  10. robotframework_webdialogs-0.2.0/src/WebDialogs/client/backend_controller.py +75 -0
  11. robotframework_webdialogs-0.2.0/src/WebDialogs/client/webdialogs_keywords.py +56 -0
  12. robotframework_webdialogs-0.2.0/src/WebDialogs/server/__init__.py +0 -0
  13. robotframework_webdialogs-0.2.0/src/WebDialogs/server/app.py +14 -0
  14. robotframework_webdialogs-0.2.0/src/WebDialogs/server/blueprints/__init__.py +0 -0
  15. robotframework_webdialogs-0.2.0/src/WebDialogs/server/blueprints/api.py +48 -0
  16. robotframework_webdialogs-0.2.0/src/WebDialogs/server/blueprints/dialog.py +32 -0
  17. robotframework_webdialogs-0.2.0/src/WebDialogs/server/run.py +16 -0
  18. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/__init__.py +5 -0
  19. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/dialogs/__init__.py +0 -0
  20. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/dialogs/base.py +52 -0
  21. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/dialogs/builder.py +26 -0
  22. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/dialogs/manager.py +36 -0
  23. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/test_manager.py +24 -0
  24. robotframework_webdialogs-0.2.0/src/WebDialogs/server/services/utils.py +8 -0
  25. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/dialog_execute_manual_step.html +18 -0
  26. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/dialog_get_selection_from_user.html +17 -0
  27. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/dialog_get_selections_from_user.html +20 -0
  28. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/dialog_get_value_from_user.html +12 -0
  29. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/dialog_pause_execution.html +10 -0
  30. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/dialogs/layout.html +4 -0
  31. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/home.html +53 -0
  32. robotframework_webdialogs-0.2.0/src/WebDialogs/server/templates/layout.html +25 -0
  33. robotframework_webdialogs-0.2.0/src/robotframework_webdialogs.egg-info/PKG-INFO +218 -0
  34. robotframework_webdialogs-0.2.0/src/robotframework_webdialogs.egg-info/SOURCES.txt +35 -0
  35. robotframework_webdialogs-0.2.0/src/robotframework_webdialogs.egg-info/dependency_links.txt +1 -0
  36. robotframework_webdialogs-0.2.0/src/robotframework_webdialogs.egg-info/requires.txt +3 -0
  37. robotframework_webdialogs-0.2.0/src/robotframework_webdialogs.egg-info/top_level.txt +1 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include requirements.txt
4
+ recursive-include src/WebDialogs/server/templates *
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: robotframework-webdialogs
3
+ Version: 0.2.0
4
+ Summary: Interactive web dialogs and custom Jinja2 forms for Robot Framework tests
5
+ Home-page: https://github.com/Ymil/robotframework-webdialogs
6
+ Author: Lautaro Linquimán
7
+ Author-email: lylinquiman@gmail.com
8
+ License: Apache License 2.0
9
+ Keywords: robotframework testing dialogs web flask jinja2
10
+ Platform: any
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Topic :: Software Development :: Testing
19
+ Classifier: Framework :: Robot Framework
20
+ Classifier: Framework :: Robot Framework :: Library
21
+ Requires-Python: >=3.8, <3.14
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: flask
25
+ Requires-Dist: robotframework
26
+ Requires-Dist: requests
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license
35
+ Dynamic: license-file
36
+ Dynamic: platform
37
+ Dynamic: requires-dist
38
+ Dynamic: requires-python
39
+ Dynamic: summary
40
+
41
+ # RobotFramework - WebDialogs
42
+
43
+ WebDialogs is a Robot Framework library that allows you to run interactive dialogs in a web browser instead of the console or native GUI windows.
44
+ It is designed to be compatible with the official Robot Framework Dialog library, making migration or coexistence seamless.
45
+ Additionally, it supports creating more complex dialogs using HTML templates written with Jinja2, providing flexible and customizable interfaces.
46
+ Features
47
+
48
+ - Full support for dialogs compatible with Robot Framework's built-in Dialog library.
49
+ - Simple, responsive web interaction using Bootstrap.
50
+ - Embedded Flask web server, running alongside your tests.
51
+ - Support for dialogs with buttons, inputs, and selections.
52
+ - Ability to create custom HTML dialog templates with Jinja2.
53
+ - Ability to pass Robot Framework data into custom templates.
54
+ - Architecture based on Robot Framework client + Flask server for maximum flexibility.
55
+
56
+ ![ezgif-3341d1f635d951](https://github.com/user-attachments/assets/6be4c67d-66ac-4227-b1da-f346b55fea88)
57
+
58
+ ## Installation
59
+
60
+ pip install robotframework-webdialogs
61
+
62
+ ## Basic Usage
63
+
64
+ ```robotframework
65
+ *** Settings ***
66
+ Library WebDialogs
67
+
68
+ *** Tasks ***
69
+ Pause Execution
70
+ Pause Execution Connect the cables and press continue
71
+ ```
72
+ The test will pause and open a dialog in the browser.
73
+ To view it, open:
74
+
75
+ http://localhost:5000
76
+
77
+ ## Examples
78
+
79
+ ### Dialogs.Get Value From User
80
+
81
+ ```robotframework
82
+ Get User Personal Information
83
+ [Documentation] Collects basic personal information through dialogs
84
+ ${name}= Dialogs.Get Value From User Please enter your first name:
85
+ Log To Console \nUser provided name: ${name}
86
+ ```
87
+
88
+ ![](assets/Get%20Value%20From%20User.png)
89
+
90
+ ### Dialogs.Get Selection From User
91
+
92
+ ```robotframework
93
+ Select Gender From Options
94
+ [Documentation] Demonstrates single-selection dialog
95
+ @{genders}= Create List Male Female Non-binary Prefer not to say
96
+ ${gender}= Dialogs.Get Selection From User
97
+ ... Please select your gender:
98
+ ... options=${genders}
99
+ Log To Console \nSelected gender: ${gender}
100
+ ```
101
+
102
+ ![](assets/Get%20Selection%20From%20User.png)
103
+
104
+
105
+ ### Dialogs.Get Selections From User
106
+
107
+ ```robotframework
108
+ Select Multiple Favorite Animals
109
+ [Documentation] Demonstrates multi-selection dialog with validation
110
+ @{animals}= Create List Cats Dogs Horses Birds Fish
111
+ ${selected_animals}= Dialogs.Get Selections From User
112
+ ... Select your favorite animals:
113
+ ... options=${animals}
114
+
115
+ Should Not Be Empty ${selected_animals} No animals selected
116
+ Log To Console \nFavorite animals: ${selected_animals}
117
+ ```
118
+
119
+ ![](assets/Get%20Selections%20From%20User.png)
120
+
121
+ ### Dialogs.Pause Execution
122
+
123
+ ```robotframework
124
+ Pause Execution
125
+ [Documentation] Pauses test execution and opens a dialog
126
+ Dialogs.Pause Execution Connect the cables and press continue
127
+ ```
128
+
129
+ ![](assets/Pause%20Execution.png)
130
+
131
+ ### Dialogs.Execute Manual Step
132
+
133
+ ```robotframework
134
+ Manual Verification Step
135
+ [Documentation] Requires manual user verification
136
+ ${verification_result}= Dialogs.Execute Manual Step
137
+ ... Please verify the device connection
138
+ Log To Console \nVerification result: ${verification_result}
139
+ ```
140
+
141
+ ![](assets/Execute%20Manual%20Step.png)
142
+
143
+ ### Dialogs.Execute Custom Step
144
+
145
+ ```robotframework
146
+ Process Complex Form Submission
147
+ [Documentation] Tests custom form handling
148
+ ${form_response}= Dialogs.Execute Custom Step
149
+ ... step=complexform
150
+
151
+ Should Contain ${form_response} input Form submission failed
152
+ Log To Console \nForm processing result: ${form_response}
153
+ ```
154
+
155
+ You can also pass data into the custom template:
156
+
157
+ ```robotframework
158
+ Process Data-Driven Complex Form Submission
159
+ [Documentation] Tests custom form handling with data passed to the template
160
+ VAR &{testdata}
161
+ ... data1=value1
162
+ ... data2=${EMPTY}
163
+
164
+ ${form_response}= Dialogs.Execute Custom Step
165
+ ... step=data_driven_form
166
+ ... data=${testdata}
167
+
168
+ Should Contain ${form_response} data1 Form submission failed
169
+ Should Contain ${form_response} data2 Form submission failed
170
+ Log To Console \nData-driven form processing result: ${form_response}
171
+ ```
172
+
173
+ ![](assets/Execute%20Custom%20Step.png)
174
+
175
+
176
+ ## Advanced Usage: Custom HTML Dialogs
177
+
178
+ You can create HTML dialog templates with Jinja2 for complex interfaces.
179
+
180
+ Use keyword `Execute Custom Step step=complexform` to open the custom dialog.
181
+ Create the dialog template in a file named `complexform.html` in the `templates/` folder in your root project.
182
+
183
+ When using `Execute Custom Step` with the optional `data` argument, the values are available in the Jinja2 template through the `data` variable:
184
+
185
+ ```html
186
+ {% for key, value in data.items() %}
187
+ <label>{{ key }}</label>
188
+ <input name="{{ key }}" value="{{ value }}">
189
+ {% endfor %}
190
+ ```
191
+
192
+ The submitted form values are returned to Robot Framework as the custom step response.
193
+
194
+ ## Complete Example
195
+
196
+ A fully working example is available in the example folder of the repository, which includes:
197
+ - Robot Framework test code
198
+ - Flask server code
199
+ - HTML templates
200
+ - Setup and run instructions
201
+
202
+ ## Architecture
203
+ - Robot Framework Client: sends dialog requests to the server.
204
+ - Flask Server: exposes a web interface where users respond to dialogs.
205
+ - Asynchronous communication with blocking waits on the Robot side until user response.
206
+
207
+ ## Requirements
208
+
209
+ - Python 3.9+
210
+ - Robot Framework 7.0+
211
+ - Modern web browser (Chrome, Firefox, Edge)
212
+
213
+ ## Roadmap
214
+
215
+ - [ ] Add test to the library.
216
+ - [ ] Documentation on creating and using custom Jinja2 templates.
217
+ - [ ] CI/CD integration examples.
218
+ - [ ] Improved error handling and support for concurrent sessions.
@@ -0,0 +1,178 @@
1
+ # RobotFramework - WebDialogs
2
+
3
+ WebDialogs is a Robot Framework library that allows you to run interactive dialogs in a web browser instead of the console or native GUI windows.
4
+ It is designed to be compatible with the official Robot Framework Dialog library, making migration or coexistence seamless.
5
+ Additionally, it supports creating more complex dialogs using HTML templates written with Jinja2, providing flexible and customizable interfaces.
6
+ Features
7
+
8
+ - Full support for dialogs compatible with Robot Framework's built-in Dialog library.
9
+ - Simple, responsive web interaction using Bootstrap.
10
+ - Embedded Flask web server, running alongside your tests.
11
+ - Support for dialogs with buttons, inputs, and selections.
12
+ - Ability to create custom HTML dialog templates with Jinja2.
13
+ - Ability to pass Robot Framework data into custom templates.
14
+ - Architecture based on Robot Framework client + Flask server for maximum flexibility.
15
+
16
+ ![ezgif-3341d1f635d951](https://github.com/user-attachments/assets/6be4c67d-66ac-4227-b1da-f346b55fea88)
17
+
18
+ ## Installation
19
+
20
+ pip install robotframework-webdialogs
21
+
22
+ ## Basic Usage
23
+
24
+ ```robotframework
25
+ *** Settings ***
26
+ Library WebDialogs
27
+
28
+ *** Tasks ***
29
+ Pause Execution
30
+ Pause Execution Connect the cables and press continue
31
+ ```
32
+ The test will pause and open a dialog in the browser.
33
+ To view it, open:
34
+
35
+ http://localhost:5000
36
+
37
+ ## Examples
38
+
39
+ ### Dialogs.Get Value From User
40
+
41
+ ```robotframework
42
+ Get User Personal Information
43
+ [Documentation] Collects basic personal information through dialogs
44
+ ${name}= Dialogs.Get Value From User Please enter your first name:
45
+ Log To Console \nUser provided name: ${name}
46
+ ```
47
+
48
+ ![](assets/Get%20Value%20From%20User.png)
49
+
50
+ ### Dialogs.Get Selection From User
51
+
52
+ ```robotframework
53
+ Select Gender From Options
54
+ [Documentation] Demonstrates single-selection dialog
55
+ @{genders}= Create List Male Female Non-binary Prefer not to say
56
+ ${gender}= Dialogs.Get Selection From User
57
+ ... Please select your gender:
58
+ ... options=${genders}
59
+ Log To Console \nSelected gender: ${gender}
60
+ ```
61
+
62
+ ![](assets/Get%20Selection%20From%20User.png)
63
+
64
+
65
+ ### Dialogs.Get Selections From User
66
+
67
+ ```robotframework
68
+ Select Multiple Favorite Animals
69
+ [Documentation] Demonstrates multi-selection dialog with validation
70
+ @{animals}= Create List Cats Dogs Horses Birds Fish
71
+ ${selected_animals}= Dialogs.Get Selections From User
72
+ ... Select your favorite animals:
73
+ ... options=${animals}
74
+
75
+ Should Not Be Empty ${selected_animals} No animals selected
76
+ Log To Console \nFavorite animals: ${selected_animals}
77
+ ```
78
+
79
+ ![](assets/Get%20Selections%20From%20User.png)
80
+
81
+ ### Dialogs.Pause Execution
82
+
83
+ ```robotframework
84
+ Pause Execution
85
+ [Documentation] Pauses test execution and opens a dialog
86
+ Dialogs.Pause Execution Connect the cables and press continue
87
+ ```
88
+
89
+ ![](assets/Pause%20Execution.png)
90
+
91
+ ### Dialogs.Execute Manual Step
92
+
93
+ ```robotframework
94
+ Manual Verification Step
95
+ [Documentation] Requires manual user verification
96
+ ${verification_result}= Dialogs.Execute Manual Step
97
+ ... Please verify the device connection
98
+ Log To Console \nVerification result: ${verification_result}
99
+ ```
100
+
101
+ ![](assets/Execute%20Manual%20Step.png)
102
+
103
+ ### Dialogs.Execute Custom Step
104
+
105
+ ```robotframework
106
+ Process Complex Form Submission
107
+ [Documentation] Tests custom form handling
108
+ ${form_response}= Dialogs.Execute Custom Step
109
+ ... step=complexform
110
+
111
+ Should Contain ${form_response} input Form submission failed
112
+ Log To Console \nForm processing result: ${form_response}
113
+ ```
114
+
115
+ You can also pass data into the custom template:
116
+
117
+ ```robotframework
118
+ Process Data-Driven Complex Form Submission
119
+ [Documentation] Tests custom form handling with data passed to the template
120
+ VAR &{testdata}
121
+ ... data1=value1
122
+ ... data2=${EMPTY}
123
+
124
+ ${form_response}= Dialogs.Execute Custom Step
125
+ ... step=data_driven_form
126
+ ... data=${testdata}
127
+
128
+ Should Contain ${form_response} data1 Form submission failed
129
+ Should Contain ${form_response} data2 Form submission failed
130
+ Log To Console \nData-driven form processing result: ${form_response}
131
+ ```
132
+
133
+ ![](assets/Execute%20Custom%20Step.png)
134
+
135
+
136
+ ## Advanced Usage: Custom HTML Dialogs
137
+
138
+ You can create HTML dialog templates with Jinja2 for complex interfaces.
139
+
140
+ Use keyword `Execute Custom Step step=complexform` to open the custom dialog.
141
+ Create the dialog template in a file named `complexform.html` in the `templates/` folder in your root project.
142
+
143
+ When using `Execute Custom Step` with the optional `data` argument, the values are available in the Jinja2 template through the `data` variable:
144
+
145
+ ```html
146
+ {% for key, value in data.items() %}
147
+ <label>{{ key }}</label>
148
+ <input name="{{ key }}" value="{{ value }}">
149
+ {% endfor %}
150
+ ```
151
+
152
+ The submitted form values are returned to Robot Framework as the custom step response.
153
+
154
+ ## Complete Example
155
+
156
+ A fully working example is available in the example folder of the repository, which includes:
157
+ - Robot Framework test code
158
+ - Flask server code
159
+ - HTML templates
160
+ - Setup and run instructions
161
+
162
+ ## Architecture
163
+ - Robot Framework Client: sends dialog requests to the server.
164
+ - Flask Server: exposes a web interface where users respond to dialogs.
165
+ - Asynchronous communication with blocking waits on the Robot side until user response.
166
+
167
+ ## Requirements
168
+
169
+ - Python 3.9+
170
+ - Robot Framework 7.0+
171
+ - Modern web browser (Chrome, Firefox, Edge)
172
+
173
+ ## Roadmap
174
+
175
+ - [ ] Add test to the library.
176
+ - [ ] Documentation on creating and using custom Jinja2 templates.
177
+ - [ ] CI/CD integration examples.
178
+ - [ ] Improved error handling and support for concurrent sessions.
@@ -0,0 +1,3 @@
1
+ flask
2
+ robotframework
3
+ requests
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env python
2
+
3
+ import re
4
+ from os.path import abspath, dirname, join
5
+
6
+ from setuptools import find_packages, setup
7
+
8
+ CURDIR = dirname(abspath(__file__))
9
+
10
+ CLASSIFIERS = """
11
+ License :: OSI Approved :: Apache Software License
12
+ Operating System :: OS Independent
13
+ Programming Language :: Python
14
+ Programming Language :: Python :: 3.11
15
+ Programming Language :: Python :: 3.12
16
+ Programming Language :: Python :: 3.13
17
+ Programming Language :: Python :: 3 :: Only
18
+ Topic :: Software Development :: Testing
19
+ Framework :: Robot Framework
20
+ Framework :: Robot Framework :: Library
21
+ """.strip().splitlines()
22
+
23
+ with open(join(CURDIR, "src", "WebDialogs", "__init__.py")) as f:
24
+ VERSION = re.search('__version__ = "(.*)"', f.read()).group(1)
25
+
26
+ with open(join(CURDIR, "README.md")) as f:
27
+ DESCRIPTION = f.read()
28
+
29
+ with open(join(CURDIR, "requirements.txt")) as f:
30
+ REQUIREMENTS = f.read().splitlines()
31
+
32
+ setup(
33
+ name="robotframework-webdialogs",
34
+ version=VERSION,
35
+ description="Interactive web dialogs and custom Jinja2 forms for Robot Framework tests",
36
+ long_description=DESCRIPTION,
37
+ long_description_content_type="text/markdown",
38
+ author="Lautaro Linquimán",
39
+ author_email="lylinquiman@gmail.com",
40
+ url="https://github.com/Ymil/robotframework-webdialogs",
41
+ license="Apache License 2.0",
42
+ keywords="robotframework testing dialogs web flask jinja2",
43
+ platforms="any",
44
+ classifiers=CLASSIFIERS,
45
+ python_requires=">=3.8, <3.14",
46
+ install_requires=REQUIREMENTS,
47
+ package_dir={"": "src"},
48
+ packages=find_packages("src"),
49
+ include_package_data=True
50
+ )
@@ -0,0 +1,3 @@
1
+ __version__ = "0.2.0"
2
+
3
+ from .client.webdialogs_keywords import WebDialogs # noqa