robotframework-dialogsplus 0.1.0__tar.gz → 0.2.1__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 (22) hide show
  1. robotframework_dialogsplus-0.2.1/CLAUDE.md +45 -0
  2. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/PKG-INFO +14 -3
  3. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/README.md +12 -1
  4. robotframework_dialogsplus-0.2.1/atests/testing.robot +215 -0
  5. robotframework_dialogsplus-0.2.1/docs/DialogsPlus.html +410 -0
  6. robotframework_dialogsplus-0.2.1/docs/HowTo.md +150 -0
  7. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/pyproject.toml +32 -31
  8. robotframework_dialogsplus-0.2.1/src/DialogsPlus/dialogsplus.py +382 -0
  9. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/utils/config.py +1 -1
  10. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/widgets/base.py +34 -7
  11. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/widgets/styling.py +157 -5
  12. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/widgets/wrappers.py +64 -15
  13. robotframework_dialogsplus-0.2.1/uv.lock +432 -0
  14. robotframework_dialogsplus-0.1.0/atests/testing.robot +0 -87
  15. robotframework_dialogsplus-0.1.0/src/DialogsPlus/dialogsplus.py +0 -90
  16. robotframework_dialogsplus-0.1.0/uv.lock +0 -291
  17. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/.gitignore +0 -0
  18. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/.python-version +0 -0
  19. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/atests/config.yaml +0 -0
  20. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/__init__.py +0 -0
  21. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/py.typed +0 -0
  22. {robotframework_dialogsplus-0.1.0 → robotframework_dialogsplus-0.2.1}/src/DialogsPlus/widgets/assets/robot.ico +0 -0
@@ -0,0 +1,45 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project
6
+
7
+ `robotframework-dialogsplus` — a Robot Framework library providing modern, styled GUI dialogs (built on `customtkinter`) as a drop-in enhancement to Robot Framework's built-in `Dialogs` library. It only works with a real desktop (GUI dialogs require an interactive display), so it cannot run in headless CI/CD environments.
8
+
9
+ ## Commands
10
+
11
+ Package management is via `uv` (see `uv.lock`).
12
+
13
+ ```bash
14
+ uv sync # install dependencies into .venv
15
+ uv run robot atests/ # run the acceptance tests (opens real GUI dialogs — requires manual interaction)
16
+ uv run robot atests/testing.robot -t "Get Confirmation Returns Boolean" # run a single test case by name
17
+ uv run robotidy src atests # format Robot Framework files (robotframework-tidy, a dev dependency)
18
+ uv run ruff check . # lint Python source
19
+ uv build # build the wheel/sdist (hatchling backend)
20
+ ```
21
+
22
+ There is no Python unit test suite — correctness is verified only through the `.robot` acceptance tests in `atests/`, which pop up real dialog windows and require a human (or scripted UI automation) to click through them. They cannot run in headless/CI environments.
23
+
24
+ Keyword documentation (`docs/DialogsPlus.html`) is generated from the library's docstrings via Robot Framework's Libdoc, e.g.:
25
+
26
+ ```bash
27
+ uv run python -m robot.libdoc src/DialogsPlus/dialogsplus.py docs/DialogsPlus.html
28
+ ```
29
+
30
+ ## Architecture
31
+
32
+ The library follows a three-layer structure, all under `src/DialogsPlus/`:
33
+
34
+ 1. **`dialogsplus.py`** — the Robot Framework library class (`DialogsPlus`, `ROBOT_LIBRARY_SCOPE = 'SUITE'`). Each public method is decorated `@keyword` and becomes a Robot Framework keyword (e.g. `get_value_from_user_input` → `Get Value From User Input`). This layer only handles keyword argument parsing/validation, dynamic size calculations (e.g. dialog height/width scaled by number of fields/options in `get_multi_value` and `select_options_with_checkboxes`), and delegates the actual dialog logic to `widgets/wrappers.py`. The class constructor optionally loads a `DialogConfig` from a YAML file (`Library DialogsPlus config=path/to/config.yaml`).
35
+
36
+ 2. **`widgets/wrappers.py`** — one static-method "runner" class per keyword (e.g. `GetValueFromUserDialog`, `MultiValueInput`, `ChooseFromFileDialog`). Each wrapper instantiates the corresponding dialog class from `widgets/styling.py`, calls `.show()`, logs via `robot.api.logger`, and translates the raw dialog result dict into the keyword's return value (e.g. mapping a `status` of `"yes"/"no"/"cancel"` to `True/False/None`). `ExecuteManualStepDialog` also raises `robot.errors.ExecutionFailed` when the user fails a manual step, prompting for a failure reason via a nested `InputDialog`.
37
+
38
+ 3. **`widgets/styling.py`** — the actual `customtkinter`-based dialog implementations (`InputDialog`, `ManualStepDialog`, `CountdownDialog`, `ConfirmationDialog`, `MultiValueInputDialog`, `FileDialog`, `FolderDialog`, `CheckboxConfirmationDialog`, `MultiCheckboxDialog`, `PauseDialog`). Each subclasses `BaseDialog` from `widgets/base.py` and implements `build_ui(app)`, populating `self.result` and calling `app.quit()` on submit/cancel.
39
+
40
+ Supporting modules:
41
+
42
+ - **`widgets/base.py`** — `BaseDialogRunner` creates/centers/tears down the `ctk.CTk()` app window (sets appearance mode/theme once globally on first use, sets the window icon from `widgets/assets/robot.ico`, and runs `app.mainloop()`), and `BaseDialog` provides the styled widget factory methods (`create_button`, `create_label`, `create_entry`, `create_frame`, `create_progress_bar`, `create_checkbox`) that all dialogs use, plus the generic `show()` → `build_ui()` → return `self.result` flow.
43
+ - **`utils/config.py`** — `DialogConfig` holds all visual/layout settings (theme, fonts, colors, sizes, spacing) with defaults, and `DialogConfig.from_yaml(path)` loads overrides from a user-supplied YAML config file (see `atests/config.yaml` for the shape).
44
+
45
+ When adding a new keyword: add a `@keyword`-decorated method to `dialogsplus.py`, a runner class (or static method) in `wrappers.py`, and a new `BaseDialog` subclass in `styling.py` — following the existing pattern rather than putting UI logic directly in `dialogsplus.py`.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: robotframework-dialogsplus
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: A drop-in enhancement for Robot Framework's Dialogs library with modern UI and extended user interaction keywords.
5
5
  Author-email: Alpha-Centauri-00 <Alpha@Centauri.c0m>
6
6
  License-Expression: MIT
@@ -31,7 +31,18 @@ A drop-in enhancement for Robot Framework's Dialogs library with modern UI and e
31
31
  - Supports dynamic sizing based on input fields or options
32
32
 
33
33
  ---
34
+ ## Installation
34
35
 
36
+ ```bach
37
+ pip install robotframework-dialogsplus
38
+ ```
35
39
 
36
40
 
37
- Pull requests are welcome! More info coming soon.
41
+ ## 📚 Keyword Documentation
42
+
43
+ 👉 View DialogsPlus Keyword [Docs](https://alpha-centauri-00.github.io/DialogsPlus/DialogsPlus.html)
44
+
45
+ 👉 More Example of [HowTo](https://github.com/Alpha-Centauri-00/DialogsPlus/blob/main/docs/HowTo.md)
46
+
47
+
48
+ Pull requests are welcome! More info coming soon.
@@ -19,7 +19,18 @@ A drop-in enhancement for Robot Framework's Dialogs library with modern UI and e
19
19
  - Supports dynamic sizing based on input fields or options
20
20
 
21
21
  ---
22
+ ## Installation
22
23
 
24
+ ```bach
25
+ pip install robotframework-dialogsplus
26
+ ```
23
27
 
24
28
 
25
- Pull requests are welcome! More info coming soon.
29
+ ## 📚 Keyword Documentation
30
+
31
+ 👉 View DialogsPlus Keyword [Docs](https://alpha-centauri-00.github.io/DialogsPlus/DialogsPlus.html)
32
+
33
+ 👉 More Example of [HowTo](https://github.com/Alpha-Centauri-00/DialogsPlus/blob/main/docs/HowTo.md)
34
+
35
+
36
+ Pull requests are welcome! More info coming soon.
@@ -0,0 +1,215 @@
1
+ *** Settings ***
2
+ Library DialogsPlus #config=D:/robotframework-dialogsplus/atests/config.yaml
3
+ Library OperatingSystem
4
+
5
+ # Suite Setup Set Log Level level=TRACE
6
+ # Test Setup Log Test Case Name
7
+
8
+
9
+ *** Keywords ***
10
+ Log Test Case Name
11
+ [Tags] robot:flatten
12
+ Log <p style="background-color: #06bdb1; font-weight: bold; display: inline-block; padding: 4px;">*** Running Test: ${TEST NAME} ***</p> html=${True}
13
+
14
+ log Hello
15
+ Log Hello level=WARN
16
+
17
+ *** Variables ***
18
+
19
+ @{fields_val} username password email phone
20
+ @{fields} username password
21
+ &{default_val} username=admin password=P@55 phone=1234567
22
+ &{default} username=user1 password=P@55
23
+
24
+ *** Test Cases ***
25
+
26
+ Get Value From User Default
27
+ ${result} Get Value From User Input
28
+ ... prompt=Enter your name:
29
+ ... default=Robot framework
30
+
31
+ Should Be Equal ${result} Robot framework
32
+
33
+ Run Manual Steps Executes
34
+ VAR @{steps}
35
+ ... Open the app
36
+ ... Click Start button
37
+ ... Verify status
38
+
39
+ Run Manual Steps ${steps}
40
+ Log Manual steps executed successfully
41
+
42
+ Run Manual Steps Executes With Plain Args
43
+ Run Manual Steps
44
+ ... open github
45
+ ... add username
46
+ ... add password
47
+ ... press login
48
+
49
+ Log Manual steps executed successfully
50
+
51
+ Count Down Runs
52
+ Count Down 3
53
+ Log Countdown executed for 3 seconds
54
+
55
+ Get Confirmation Returns Boolean
56
+ ${result} Get Confirmation Are you sure?
57
+ Should Be True isinstance(${result}, bool)
58
+
59
+ Get Multi Value
60
+ ${result} Get Multi Value ${fields} default=${default}
61
+ Should Be Equal ${result}[username] user1
62
+
63
+
64
+ Get Multi Value Multiple Fields
65
+ ${result} Get Multi Value ${fields_val} default=${default_val}
66
+ Should Be Equal ${result}[password] P@55
67
+ Should Be Equal ${result}[phone] 1234567
68
+
69
+ Choose Single XML File
70
+ ${XML_FILETYPES} Evaluate [("xml files", "*.xml")]
71
+ ${result}= Choose File
72
+ ... message=Select Single XML File
73
+ ... filetypes=${XML_FILETYPES}
74
+
75
+ Should Contain ${result} .xml
76
+
77
+ Choose Multiple HTML Files
78
+ ${HTML_FILETYPES} Evaluate [("HTML", "*.html")]
79
+ ${result}= Choose File
80
+ ... message=Select Multiple HTML Files
81
+ ... filetypes=${HTML_FILETYPES} multiple=True
82
+
83
+ Should Contain ${result}[0] .html
84
+
85
+ Choose Folder Test
86
+ ${result}= Choose Folder message=Select Any Directory
87
+ Directory Should Exist ${result}
88
+
89
+ Single Ceckbox Test
90
+ ${r} Confirm With Checkbox
91
+ ... message=Do you accept the terms?
92
+ ... checkbox_text=I accept, no matter what!
93
+
94
+ Should Be True ${r}
95
+
96
+ Select Many Checkbox Test
97
+ ${r} Select Options With Checkboxes
98
+ ... message=Select as much as you want
99
+ ... options=${fields_val}
100
+
101
+ Should Not Be True ${r}[username]
102
+ Should Not Be True ${r}[password]
103
+ Should Not Be True ${r}[email]
104
+ Should Not Be True ${r}[phone]
105
+
106
+ Select Many Checkbox With Defaults Test
107
+ @{Contacts} Create List Email SMS Phone Slack Discord
108
+ @{Selected_Defaults} Create List Email SMS
109
+ ${selected}= Select Options With Checkboxes
110
+ ... message=Choose your preferences
111
+ ... options=${Contacts}
112
+ ... defaults=@{Selected_Defaults} # Default Selected!
113
+
114
+ Should Be True ${selected}[Email]
115
+ Should Be True ${selected}[SMS]
116
+ Should Not Be True ${selected}[Phone]
117
+ Should Not Be True ${selected}[Slack]
118
+ Should Not Be True ${selected}[Discord]
119
+
120
+ Pause The Test
121
+ Pause Test Execution message=Check If System Is Running!
122
+
123
+ Pause The Test With Command
124
+ Pause Test Execution message=Check If System Is Running! command=log Hello
125
+
126
+ Pause The Test With Command That Opens A Dialog
127
+ @{args} Create List 2
128
+ Pause Test Execution
129
+ ... message=Check If System Is Running!
130
+ ... command=Count Down
131
+ ... command_args=${args}
132
+
133
+ Pause The Test With Command That Fails
134
+ TRY
135
+ Pause Test Execution message=Click Run, then Continue command=Not Exist Keyword
136
+ EXCEPT AS ${error}
137
+ Log Caught expected failure: ${error}
138
+ END
139
+
140
+ Create Dialog With Text Box And Checkbox
141
+ Create Dialog title=Login Form
142
+ Add Text Box name=username label=Username default=admin
143
+ Add Checkbox name=remember_me label=Remember Me
144
+ Add Button text=OK
145
+ Add Button text=Cancel
146
+ ${result} Show Dialog
147
+ Log Button clicked: ${result}[button]
148
+ Log Username: ${result}[username]
149
+ Log Remember me: ${result}[remember_me]
150
+
151
+
152
+ Create Dialog With Side Command Button
153
+ Create Dialog title=Diagnostics
154
+ Add Label text=Run diagnostics before continuing if you like.
155
+ Add Button text=Run Diagnostics command=log Hello closes_dialog=False
156
+ Add Button text=OK
157
+ ${result} Show Dialog
158
+ Should Be Equal ${result}[button] OK
159
+
160
+ Add Text Box Fails Without Create Dialog First
161
+ TRY
162
+ Add Text Box name=orphan
163
+ EXCEPT AS ${error}
164
+ Log Caught expected failure: ${error}
165
+ END
166
+
167
+ Create Dialog Fails Without A Closing Button
168
+ Create Dialog title=No Closing Button
169
+ Add Label text=This has no OK/Cancel button
170
+ TRY
171
+ Show Dialog
172
+ EXCEPT AS ${error}
173
+ Log Caught expected failure: ${error}
174
+ END
175
+
176
+ Create Dialog With Masked Text Box
177
+ Create Dialog title=Login Form
178
+ Add Text Box name=username label=Username default=admin
179
+ Add Text Box name=password label=Password mask=True
180
+ Add Button text=OK
181
+ ${result} Show Dialog
182
+
183
+ Create Dialog With Radio Group
184
+ Create Dialog title=Test Result
185
+ Add Radio Group name=verdict label=Verdict options=Pass|Fail|Blocked default=Pass
186
+ Add Button text=OK
187
+ ${result} Show Dialog
188
+ Should Contain ${{['Pass', 'Fail', 'Blocked']}} ${result}[verdict]
189
+ Log Verdict selected: ${result}[verdict]
190
+
191
+ Add Radio Group Fail and Pass
192
+ Create Dialog title=Verdict
193
+ Add Radio Group name=verdict options=Pass|Fail default=Pass
194
+ Add Button text=OK
195
+ ${result} Show Dialog
196
+ Should Be Equal ${result}[verdict] Pass
197
+
198
+ Create Dialog With Dropdown
199
+ Create Dialog title=Browser Selection
200
+ Add Dropdown name=browser label=Browser options=Chrome|Firefox|Edge default=Firefox
201
+ Add Button text=OK
202
+ ${result} Show Dialog
203
+ Log Browser selected: ${result}[browser]
204
+
205
+ Add Dropdown Fails With Bad Default
206
+ Create Dialog title=Bad Dropdown Default
207
+ TRY
208
+ Add Dropdown name=browser options=Chrome|Firefox default=Safari
209
+ EXCEPT AS ${error}
210
+ Log Caught expected failure: ${error}
211
+ END
212
+ Add Dropdown name=browser options=Chrome|Firefox default=Chrome
213
+ Add Button text=OK
214
+ ${result} Show Dialog
215
+ Should Be Equal ${result}[browser] Chrome