robotframework-odoofx 0.1.0__tar.gz → 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 (24) hide show
  1. robotframework_odoofx-0.2.0/PKG-INFO +236 -0
  2. robotframework_odoofx-0.2.0/README.md +198 -0
  3. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/pyproject.toml +3 -3
  4. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/OdooFxLibrary/__init__.py +2 -2
  5. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/OdooFxLibrary/odoo_library.py +196 -32
  6. robotframework_odoofx-0.2.0/src/OdooFxLibrary/orm.py +161 -0
  7. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/OdooFxLibrary/rpc.py +11 -0
  8. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web.py +485 -0
  9. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web_buttons.py +90 -0
  10. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web_choices.py +80 -0
  11. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web_client.py +386 -0
  12. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web_form.py +398 -0
  13. robotframework_odoofx-0.2.0/src/OdooFxLibrary/web_lines.py +115 -0
  14. robotframework_odoofx-0.2.0/src/robotframework_odoofx.egg-info/PKG-INFO +236 -0
  15. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/robotframework_odoofx.egg-info/SOURCES.txt +7 -0
  16. robotframework_odoofx-0.1.0/PKG-INFO +0 -139
  17. robotframework_odoofx-0.1.0/README.md +0 -101
  18. robotframework_odoofx-0.1.0/src/robotframework_odoofx.egg-info/PKG-INFO +0 -139
  19. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/LICENSE +0 -0
  20. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/NOTICE +0 -0
  21. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/setup.cfg +0 -0
  22. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/robotframework_odoofx.egg-info/dependency_links.txt +0 -0
  23. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/robotframework_odoofx.egg-info/requires.txt +0 -0
  24. {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.2.0}/src/robotframework_odoofx.egg-info/top_level.txt +0 -0
@@ -0,0 +1,236 @@
1
+ Metadata-Version: 2.4
2
+ Name: robotframework-odoofx
3
+ Version: 0.2.0
4
+ Summary: ODOOFX: Robot Framework library for testing Odoo through its web client (Browser library) and its external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19), with opt-in journaled writes.
5
+ Author-email: Cyril Montiel <cyril@montiel.me>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/CyrilM29/robotframework-odoofx
8
+ Project-URL: Documentation, https://cyrilm29.github.io/robotframework-odoofx/
9
+ Project-URL: Repository, https://github.com/CyrilM29/robotframework-odoofx
10
+ Project-URL: Issue Tracker, https://github.com/CyrilM29/robotframework-odoofx/issues
11
+ Keywords: robotframework,robot-framework,test-automation,testing,qa,odoo,erp,orm,rpc,xml-rpc,json-2,web-testing,playwright
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: Framework :: Robot Framework
16
+ Classifier: Framework :: Robot Framework :: Library
17
+ Classifier: Topic :: Software Development :: Testing
18
+ Classifier: Topic :: Software Development :: Testing :: Acceptance
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Operating System :: OS Independent
27
+ Requires-Python: >=3.10
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ License-File: NOTICE
31
+ Requires-Dist: robotframework>=7.4
32
+ Requires-Dist: requests>=2.28.0
33
+ Provides-Extra: web
34
+ Requires-Dist: robotframework-browser<21,>=20.0; extra == "web"
35
+ Provides-Extra: all
36
+ Requires-Dist: robotframework-odoofx[web]; extra == "all"
37
+ Dynamic: license-file
38
+
39
+ # ODOOFX: Odoo library for Robot Framework
40
+
41
+ [![PyPI](https://img.shields.io/pypi/v/robotframework-odoofx)](https://pypi.org/project/robotframework-odoofx/)
42
+ [![Python](https://img.shields.io/pypi/pyversions/robotframework-odoofx)](https://pypi.org/project/robotframework-odoofx/)
43
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/CyrilM29/robotframework-odoofx/blob/main/LICENSE)
44
+
45
+ ```bash
46
+ pip install robotframework-odoofx
47
+ ```
48
+
49
+ `OdooFxLibrary` brings Odoo test automation to Robot Framework through **two
50
+ channels under one keyword vocabulary**: the Odoo web client, driven through
51
+ the [Browser](https://robotframework-browser.org/) library, and Odoo's
52
+ external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19). A suite can cross
53
+ them: prepare or check data over the API, drive the screen for what you
54
+ actually test. It targets Odoo Community and Enterprise, and is **proven live
55
+ on Odoo 16 and Odoo 19 Community** (it is designed for Odoo 14 and later; 14,
56
+ 15, 17 and 18 are not measured yet).
57
+
58
+ > **Status: alpha.** Both channels work and are proven live on Odoo 16 and 19.
59
+ > Not covered yet: buttons that open a wizard, section and note lines, line
60
+ > deletion. Signatures may still change before 1.0.
61
+
62
+ ## Install
63
+
64
+ Requirements: Python 3.10 or later, Robot Framework 7.4 or later, and an Odoo
65
+ instance reachable over HTTP. The RPC channel needs nothing more. The `web`
66
+ extra (`pip install "robotframework-odoofx[web]"`, then `rfbrowser init` once
67
+ for the Playwright browsers) brings the Browser library the web channel is
68
+ built on; `all` installs every extra.
69
+
70
+ Keyword documentation:
71
+ [cyrilm29.github.io/robotframework-odoofx](https://cyrilm29.github.io/robotframework-odoofx/).
72
+
73
+ ## Quick start
74
+
75
+ Over the API, reading a quotation's state:
76
+
77
+ ```robotframework
78
+ *** Settings ***
79
+ Library OdooFxLibrary
80
+
81
+ *** Test Cases ***
82
+ Read A Quotation State
83
+ Connect To Odoo http://localhost:8069 my_database admin ${PASSWORD} channel=xmlrpc
84
+ Assert Quotation Status Is sale S00004
85
+ [Teardown] Disconnect From Odoo
86
+ ```
87
+
88
+ On screen, entering a contact in the web client and reading it back
89
+ independently:
90
+
91
+ ```robotframework
92
+ *** Settings ***
93
+ Library Browser
94
+ Library OdooFxLibrary
95
+
96
+ *** Test Cases ***
97
+ Enter A Company Contact
98
+ ${marker}= New Odoo Run Marker prefix=DEMO
99
+ New Browser chromium headless=${TRUE}
100
+ New Page about:blank
101
+ Log In To Odoo Web Client http://localhost:8069 my_database admin ${PASSWORD}
102
+ ... expected_series=19 allow_write=${TRUE}
103
+ Navigate To Menu contacts.menu_contacts
104
+ Open New Odoo Web Form
105
+ Fill Odoo Web Field company_type company
106
+ Fill Odoo Web Field name ${marker} Company
107
+ ${contact_id}= Save Odoo Web Record
108
+ ${found}= Search Read Odoo Records Through Web Session res.partner
109
+ ... ${{[["id", "=", $contact_id]]}} fields=${{["name"]}}
110
+ Should Be Equal ${found}[0][name] ${marker} Company
111
+ [Teardown] Run Keywords Run Keyword And Ignore Error Discard Odoo Web Changes
112
+ ... AND Close Browser
113
+ ```
114
+
115
+ Credentials never live in a suite: pass them on the command line
116
+ (`robot -v "PASSWORD: Secret:..." suite.robot`, the Robot Framework 7.4 typed
117
+ variable keeps them out of the logs) or through the environment.
118
+
119
+ ## How it behaves
120
+
121
+ - **The target is proven first.** `Get Odoo Server Version` needs no session;
122
+ `Connect To Odoo` and `Log In To Odoo Web Client` check the database and the
123
+ Odoo series, and `expected_series` refuses another Odoo version before
124
+ anything happens (two Odoo versions often run side by side).
125
+ - **Technical names and codes, never labels.** Labels are translated and change
126
+ between versions. Menus are opened by external id (`sale.sale_menu_root`),
127
+ fields are named by technical name, a radio or selection option is given by
128
+ its code (`one`, not its label), states are compared by code (`draft`,
129
+ `sent`, `sale`, `cancel`). A label fails an assertion as "not a state code".
130
+ - **Writes are off unless you opt in** (`allow_write`), on both channels, and
131
+ every write is journaled with its phase: `planned`, `done`, `failed` or
132
+ `unknown`. An `unknown` write (the answer was lost) is read back and
133
+ reconciled, never sent again.
134
+ - **A value is read back as it is typed.** A field the web client did not take
135
+ fails the keyword at once. Relational values are picked among the client's
136
+ proposals, never through Create or Search more, which would write or open a
137
+ dialog.
138
+ - **A form left half-typed is never saved by accident.** Odoo saves a form it
139
+ leaves, so `Navigate To Menu`, `Go Back Through Odoo Web Breadcrumb` and
140
+ `Log Out Of Odoo Web Client` refuse to leave one with unsaved changes (save
141
+ or discard first): a failed test never writes what it left behind.
142
+
143
+ ## Keywords
144
+
145
+ **Connection, reads and state codes** (RPC channel):
146
+
147
+ | Keyword | Purpose |
148
+ | --- | --- |
149
+ | `Connect To Odoo` | Prove the target (URL, database, version) and open the RPC connection; `channel=auto` picks JSON-2 from Odoo 19, XML-RPC before; `allow_write` opts in to writes, `expected_series` refuses another Odoo version |
150
+ | `Get Odoo Connection Info` | The proven target of the current connection, never the secret |
151
+ | `Count Odoo Records` | Count the records of a model matching a domain |
152
+ | `Search Read Odoo Records` | Read the records of a model matching a domain |
153
+ | `Get Odoo Record` | One identified record, whole or by fields |
154
+ | `Odoo Record Exists` | Whether a record exists (archived ones count) |
155
+ | `Odoo Record Should Exist`, `Odoo Record Should Not Exist` | Prove a presence or a removal on the identified record |
156
+ | `Get Field Selection Values` | The technical codes of a selection field |
157
+ | `Count Odoo Records By State` | Record count per state code |
158
+ | `Get Odoo Record State` | The state code of one identified record |
159
+ | `Odoo Record State Should Be` | Fail unless the identified record is in the expected state code |
160
+ | `Assert Quotation Status Is` | Check a quotation's state code, by order reference or id |
161
+ | `Get Odoo Config Parameter` | A system parameter such as `web.base.url` (administrator) |
162
+ | `Odoo User Should Be In Group`, `Odoo User Should Not Be In Group` | Group membership of a user, the group named by its external id |
163
+ | `Resolve Odoo External Id` | The database id behind an external id such as `product.product_product_1`, proved to be of the expected model |
164
+ | `Get Odoo Server Time` | The server's clock (UTC, one second), to bracket what a run created |
165
+ | `New Odoo Run Marker` | A unique label to put in a free-text field of the records a run creates, to find them again |
166
+ | `Disconnect From Odoo` | Close the connection |
167
+
168
+ **Writes and their journal** (both channels journal):
169
+
170
+ | Keyword | Purpose |
171
+ | --- | --- |
172
+ | `Create Odoo Record`, `Update Odoo Record`, `Delete Odoo Record` | Write a record (needs `allow_write`) |
173
+ | `Call Odoo Record Method` | Call a model method such as `action_confirm` or `action_cancel` (needs `allow_write`) |
174
+ | `Get Odoo Write Journal` | Every write (after entry `since`) with its phase: `planned`, `done`, `failed` or `unknown` (to read back, never to resend) |
175
+ | `Odoo Write Journal Should Hold No Unknown Outcome`, `Odoo Last Write Should Be` | Assert on the journal: no write of unknown effect, the last write in a given phase |
176
+ | `Reconcile Odoo Write` | Settle a `planned` or `unknown` journal entry after reading the record back |
177
+
178
+ **Structure of the database** (RPC channel):
179
+
180
+ | Keyword | Purpose |
181
+ | --- | --- |
182
+ | `Get Odoo Model Fields`, `Get Odoo Field Definition`, `Odoo Field Exists` | The fields of a model with their type, relation and inverse; one field, or whether it exists (fields come and go between versions) |
183
+ | `Get Odoo Model Relations` | The many2one, one2many and many2many fields of a model, with the model they point at |
184
+ | `Search Odoo Models` | The models whose technical name contains a text, wizards told apart |
185
+ | `Get Odoo Module State`, `Odoo Module Should Be Installed` | The state code of a module; fail unless installed |
186
+ | `Call Odoo Model Method` | Call a method that needs no record (`name_search`, `search_count`...); a method that may write needs `allow_write` and is journaled |
187
+
188
+ **Web client: session, navigation and reads** (built on the Browser library,
189
+ which opens the browser, the context and the page):
190
+
191
+ | Keyword | Purpose |
192
+ | --- | --- |
193
+ | `Get Odoo Server Version` | The server's version and series, without session nor secret: the proof a suite opens with |
194
+ | `Log In To Odoo Web Client` | Log in through the login page of a named database; `expected_series` refuses another Odoo version before the page opens; the session's database and series are proven, the secret is never logged; `allow_write` opts in to screen writes |
195
+ | `Get Odoo Web Session Info`, `Odoo Web Session Is Open`, `Odoo Web Client Is Shown` | The target of the open web session; whether the session and the web client are still there |
196
+ | `Navigate To Menu` | Open an application, then its menus, by external ids (`sale.sale_menu_root`), never by label; waits for the view that replaces the one shown |
197
+ | `Get Odoo Web View`, `Get Odoo Web Current App` | The view shown (model, view type, action, record id) and the application of the menu bar |
198
+ | `Count Odoo Web View Records`, `Get Odoo Web Pager Total`, `Count Odoo Web Search Facets` | What the list or kanban shows: records (ghost cards excluded), the pager's total, the search facets |
199
+ | `Open Odoo Web Record`, `Get Odoo Web List Cell Text`, `Get Odoo Web Breadcrumb Depth`, `Go Back Through Odoo Web Breadcrumb` | Open a shown record in its form (by the cell of a named field), read a list cell, read and walk back the breadcrumb |
200
+ | `Get Odoo Web Statusbar Value`, `Odoo Web Form Should Be Saved` | The technical code of the form's current step; no pending change |
201
+ | `Count Odoo Records Through Web Session`, `Search Read Odoo Records Through Web Session` | Reads with the page's session cookie, on the same route from Odoo 16 to 19 |
202
+ | `Log Out Of Odoo Web Client` | Log out through the user menu |
203
+
204
+ **Web client: form entry** (screen writes need `allow_write` at the login and
205
+ are journaled):
206
+
207
+ | Keyword | Purpose |
208
+ | --- | --- |
209
+ | `Open New Odoo Web Form`, `Select Odoo Web Form Tab` | Open the form of a new record from a list or kanban; show a notebook page by its name |
210
+ | `Fill Odoo Web Field`, `Get Odoo Web Field Value` | Enter a value and read it back on the screen at once: text, dates (given as ISO, typed in the user's format), radio option and selection by code, checkbox, many2one and tags by exact name or by id; read what the form shows |
211
+ | `Save Odoo Web Record`, `Discard Odoo Web Changes`, `Get Odoo Web Invalid Fields`, `Odoo Web Form Is Unsaved` | Save and get the record id, or a refusal naming its cause; drop pending changes; the fields marked invalid; whether the form holds unsaved changes |
212
+ | `Add Odoo Web Line`, `Fill Odoo Web Line Field`, `Get Odoo Web Lines` | Add a line to a one2many field (the lines of a sales order), fill a field of the line in edition, read the lines once shown as stored |
213
+ | `Click Odoo Web Form Button` | Press a button that calls a method of the record (`action_confirm`), by its technical name; waits until Odoo answered and reloaded the record; needs `allow_write`, journaled |
214
+
215
+ `Create New Quotation` is a skeleton that only warns: do not rely on it.
216
+
217
+ ## Layout
218
+
219
+ ```text
220
+ src/OdooFxLibrary/ the library
221
+ ```
222
+
223
+ ## Issues
224
+
225
+ Bug reports and suggestions are welcome as
226
+ [GitHub issues](https://github.com/CyrilM29/robotframework-odoofx/issues).
227
+
228
+ ## License
229
+
230
+ Apache 2.0. See [LICENSE](https://github.com/CyrilM29/robotframework-odoofx/blob/main/LICENSE) and [NOTICE](https://github.com/CyrilM29/robotframework-odoofx/blob/main/NOTICE).
231
+
232
+ ## Trademarks
233
+
234
+ Odoo is a trademark of Odoo S.A. Robot Framework is a trademark of the Robot
235
+ Framework Foundation. ODOOFX is an independent project, not affiliated with,
236
+ sponsored or endorsed by Odoo S.A. or the Robot Framework Foundation.
@@ -0,0 +1,198 @@
1
+ # ODOOFX: Odoo library for Robot Framework
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/robotframework-odoofx)](https://pypi.org/project/robotframework-odoofx/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/robotframework-odoofx)](https://pypi.org/project/robotframework-odoofx/)
5
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/CyrilM29/robotframework-odoofx/blob/main/LICENSE)
6
+
7
+ ```bash
8
+ pip install robotframework-odoofx
9
+ ```
10
+
11
+ `OdooFxLibrary` brings Odoo test automation to Robot Framework through **two
12
+ channels under one keyword vocabulary**: the Odoo web client, driven through
13
+ the [Browser](https://robotframework-browser.org/) library, and Odoo's
14
+ external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19). A suite can cross
15
+ them: prepare or check data over the API, drive the screen for what you
16
+ actually test. It targets Odoo Community and Enterprise, and is **proven live
17
+ on Odoo 16 and Odoo 19 Community** (it is designed for Odoo 14 and later; 14,
18
+ 15, 17 and 18 are not measured yet).
19
+
20
+ > **Status: alpha.** Both channels work and are proven live on Odoo 16 and 19.
21
+ > Not covered yet: buttons that open a wizard, section and note lines, line
22
+ > deletion. Signatures may still change before 1.0.
23
+
24
+ ## Install
25
+
26
+ Requirements: Python 3.10 or later, Robot Framework 7.4 or later, and an Odoo
27
+ instance reachable over HTTP. The RPC channel needs nothing more. The `web`
28
+ extra (`pip install "robotframework-odoofx[web]"`, then `rfbrowser init` once
29
+ for the Playwright browsers) brings the Browser library the web channel is
30
+ built on; `all` installs every extra.
31
+
32
+ Keyword documentation:
33
+ [cyrilm29.github.io/robotframework-odoofx](https://cyrilm29.github.io/robotframework-odoofx/).
34
+
35
+ ## Quick start
36
+
37
+ Over the API, reading a quotation's state:
38
+
39
+ ```robotframework
40
+ *** Settings ***
41
+ Library OdooFxLibrary
42
+
43
+ *** Test Cases ***
44
+ Read A Quotation State
45
+ Connect To Odoo http://localhost:8069 my_database admin ${PASSWORD} channel=xmlrpc
46
+ Assert Quotation Status Is sale S00004
47
+ [Teardown] Disconnect From Odoo
48
+ ```
49
+
50
+ On screen, entering a contact in the web client and reading it back
51
+ independently:
52
+
53
+ ```robotframework
54
+ *** Settings ***
55
+ Library Browser
56
+ Library OdooFxLibrary
57
+
58
+ *** Test Cases ***
59
+ Enter A Company Contact
60
+ ${marker}= New Odoo Run Marker prefix=DEMO
61
+ New Browser chromium headless=${TRUE}
62
+ New Page about:blank
63
+ Log In To Odoo Web Client http://localhost:8069 my_database admin ${PASSWORD}
64
+ ... expected_series=19 allow_write=${TRUE}
65
+ Navigate To Menu contacts.menu_contacts
66
+ Open New Odoo Web Form
67
+ Fill Odoo Web Field company_type company
68
+ Fill Odoo Web Field name ${marker} Company
69
+ ${contact_id}= Save Odoo Web Record
70
+ ${found}= Search Read Odoo Records Through Web Session res.partner
71
+ ... ${{[["id", "=", $contact_id]]}} fields=${{["name"]}}
72
+ Should Be Equal ${found}[0][name] ${marker} Company
73
+ [Teardown] Run Keywords Run Keyword And Ignore Error Discard Odoo Web Changes
74
+ ... AND Close Browser
75
+ ```
76
+
77
+ Credentials never live in a suite: pass them on the command line
78
+ (`robot -v "PASSWORD: Secret:..." suite.robot`, the Robot Framework 7.4 typed
79
+ variable keeps them out of the logs) or through the environment.
80
+
81
+ ## How it behaves
82
+
83
+ - **The target is proven first.** `Get Odoo Server Version` needs no session;
84
+ `Connect To Odoo` and `Log In To Odoo Web Client` check the database and the
85
+ Odoo series, and `expected_series` refuses another Odoo version before
86
+ anything happens (two Odoo versions often run side by side).
87
+ - **Technical names and codes, never labels.** Labels are translated and change
88
+ between versions. Menus are opened by external id (`sale.sale_menu_root`),
89
+ fields are named by technical name, a radio or selection option is given by
90
+ its code (`one`, not its label), states are compared by code (`draft`,
91
+ `sent`, `sale`, `cancel`). A label fails an assertion as "not a state code".
92
+ - **Writes are off unless you opt in** (`allow_write`), on both channels, and
93
+ every write is journaled with its phase: `planned`, `done`, `failed` or
94
+ `unknown`. An `unknown` write (the answer was lost) is read back and
95
+ reconciled, never sent again.
96
+ - **A value is read back as it is typed.** A field the web client did not take
97
+ fails the keyword at once. Relational values are picked among the client's
98
+ proposals, never through Create or Search more, which would write or open a
99
+ dialog.
100
+ - **A form left half-typed is never saved by accident.** Odoo saves a form it
101
+ leaves, so `Navigate To Menu`, `Go Back Through Odoo Web Breadcrumb` and
102
+ `Log Out Of Odoo Web Client` refuse to leave one with unsaved changes (save
103
+ or discard first): a failed test never writes what it left behind.
104
+
105
+ ## Keywords
106
+
107
+ **Connection, reads and state codes** (RPC channel):
108
+
109
+ | Keyword | Purpose |
110
+ | --- | --- |
111
+ | `Connect To Odoo` | Prove the target (URL, database, version) and open the RPC connection; `channel=auto` picks JSON-2 from Odoo 19, XML-RPC before; `allow_write` opts in to writes, `expected_series` refuses another Odoo version |
112
+ | `Get Odoo Connection Info` | The proven target of the current connection, never the secret |
113
+ | `Count Odoo Records` | Count the records of a model matching a domain |
114
+ | `Search Read Odoo Records` | Read the records of a model matching a domain |
115
+ | `Get Odoo Record` | One identified record, whole or by fields |
116
+ | `Odoo Record Exists` | Whether a record exists (archived ones count) |
117
+ | `Odoo Record Should Exist`, `Odoo Record Should Not Exist` | Prove a presence or a removal on the identified record |
118
+ | `Get Field Selection Values` | The technical codes of a selection field |
119
+ | `Count Odoo Records By State` | Record count per state code |
120
+ | `Get Odoo Record State` | The state code of one identified record |
121
+ | `Odoo Record State Should Be` | Fail unless the identified record is in the expected state code |
122
+ | `Assert Quotation Status Is` | Check a quotation's state code, by order reference or id |
123
+ | `Get Odoo Config Parameter` | A system parameter such as `web.base.url` (administrator) |
124
+ | `Odoo User Should Be In Group`, `Odoo User Should Not Be In Group` | Group membership of a user, the group named by its external id |
125
+ | `Resolve Odoo External Id` | The database id behind an external id such as `product.product_product_1`, proved to be of the expected model |
126
+ | `Get Odoo Server Time` | The server's clock (UTC, one second), to bracket what a run created |
127
+ | `New Odoo Run Marker` | A unique label to put in a free-text field of the records a run creates, to find them again |
128
+ | `Disconnect From Odoo` | Close the connection |
129
+
130
+ **Writes and their journal** (both channels journal):
131
+
132
+ | Keyword | Purpose |
133
+ | --- | --- |
134
+ | `Create Odoo Record`, `Update Odoo Record`, `Delete Odoo Record` | Write a record (needs `allow_write`) |
135
+ | `Call Odoo Record Method` | Call a model method such as `action_confirm` or `action_cancel` (needs `allow_write`) |
136
+ | `Get Odoo Write Journal` | Every write (after entry `since`) with its phase: `planned`, `done`, `failed` or `unknown` (to read back, never to resend) |
137
+ | `Odoo Write Journal Should Hold No Unknown Outcome`, `Odoo Last Write Should Be` | Assert on the journal: no write of unknown effect, the last write in a given phase |
138
+ | `Reconcile Odoo Write` | Settle a `planned` or `unknown` journal entry after reading the record back |
139
+
140
+ **Structure of the database** (RPC channel):
141
+
142
+ | Keyword | Purpose |
143
+ | --- | --- |
144
+ | `Get Odoo Model Fields`, `Get Odoo Field Definition`, `Odoo Field Exists` | The fields of a model with their type, relation and inverse; one field, or whether it exists (fields come and go between versions) |
145
+ | `Get Odoo Model Relations` | The many2one, one2many and many2many fields of a model, with the model they point at |
146
+ | `Search Odoo Models` | The models whose technical name contains a text, wizards told apart |
147
+ | `Get Odoo Module State`, `Odoo Module Should Be Installed` | The state code of a module; fail unless installed |
148
+ | `Call Odoo Model Method` | Call a method that needs no record (`name_search`, `search_count`...); a method that may write needs `allow_write` and is journaled |
149
+
150
+ **Web client: session, navigation and reads** (built on the Browser library,
151
+ which opens the browser, the context and the page):
152
+
153
+ | Keyword | Purpose |
154
+ | --- | --- |
155
+ | `Get Odoo Server Version` | The server's version and series, without session nor secret: the proof a suite opens with |
156
+ | `Log In To Odoo Web Client` | Log in through the login page of a named database; `expected_series` refuses another Odoo version before the page opens; the session's database and series are proven, the secret is never logged; `allow_write` opts in to screen writes |
157
+ | `Get Odoo Web Session Info`, `Odoo Web Session Is Open`, `Odoo Web Client Is Shown` | The target of the open web session; whether the session and the web client are still there |
158
+ | `Navigate To Menu` | Open an application, then its menus, by external ids (`sale.sale_menu_root`), never by label; waits for the view that replaces the one shown |
159
+ | `Get Odoo Web View`, `Get Odoo Web Current App` | The view shown (model, view type, action, record id) and the application of the menu bar |
160
+ | `Count Odoo Web View Records`, `Get Odoo Web Pager Total`, `Count Odoo Web Search Facets` | What the list or kanban shows: records (ghost cards excluded), the pager's total, the search facets |
161
+ | `Open Odoo Web Record`, `Get Odoo Web List Cell Text`, `Get Odoo Web Breadcrumb Depth`, `Go Back Through Odoo Web Breadcrumb` | Open a shown record in its form (by the cell of a named field), read a list cell, read and walk back the breadcrumb |
162
+ | `Get Odoo Web Statusbar Value`, `Odoo Web Form Should Be Saved` | The technical code of the form's current step; no pending change |
163
+ | `Count Odoo Records Through Web Session`, `Search Read Odoo Records Through Web Session` | Reads with the page's session cookie, on the same route from Odoo 16 to 19 |
164
+ | `Log Out Of Odoo Web Client` | Log out through the user menu |
165
+
166
+ **Web client: form entry** (screen writes need `allow_write` at the login and
167
+ are journaled):
168
+
169
+ | Keyword | Purpose |
170
+ | --- | --- |
171
+ | `Open New Odoo Web Form`, `Select Odoo Web Form Tab` | Open the form of a new record from a list or kanban; show a notebook page by its name |
172
+ | `Fill Odoo Web Field`, `Get Odoo Web Field Value` | Enter a value and read it back on the screen at once: text, dates (given as ISO, typed in the user's format), radio option and selection by code, checkbox, many2one and tags by exact name or by id; read what the form shows |
173
+ | `Save Odoo Web Record`, `Discard Odoo Web Changes`, `Get Odoo Web Invalid Fields`, `Odoo Web Form Is Unsaved` | Save and get the record id, or a refusal naming its cause; drop pending changes; the fields marked invalid; whether the form holds unsaved changes |
174
+ | `Add Odoo Web Line`, `Fill Odoo Web Line Field`, `Get Odoo Web Lines` | Add a line to a one2many field (the lines of a sales order), fill a field of the line in edition, read the lines once shown as stored |
175
+ | `Click Odoo Web Form Button` | Press a button that calls a method of the record (`action_confirm`), by its technical name; waits until Odoo answered and reloaded the record; needs `allow_write`, journaled |
176
+
177
+ `Create New Quotation` is a skeleton that only warns: do not rely on it.
178
+
179
+ ## Layout
180
+
181
+ ```text
182
+ src/OdooFxLibrary/ the library
183
+ ```
184
+
185
+ ## Issues
186
+
187
+ Bug reports and suggestions are welcome as
188
+ [GitHub issues](https://github.com/CyrilM29/robotframework-odoofx/issues).
189
+
190
+ ## License
191
+
192
+ Apache 2.0. See [LICENSE](https://github.com/CyrilM29/robotframework-odoofx/blob/main/LICENSE) and [NOTICE](https://github.com/CyrilM29/robotframework-odoofx/blob/main/NOTICE).
193
+
194
+ ## Trademarks
195
+
196
+ Odoo is a trademark of Odoo S.A. Robot Framework is a trademark of the Robot
197
+ Framework Foundation. ODOOFX is an independent project, not affiliated with,
198
+ sponsored or endorsed by Odoo S.A. or the Robot Framework Foundation.
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "robotframework-odoofx"
7
- version = "0.1.0"
8
- description = "ODOOFX: Robot Framework library for testing Odoo over its external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19), with opt-in journaled writes. Web channel in bootstrap."
7
+ version = "0.2.0"
8
+ description = "ODOOFX: Robot Framework library for testing Odoo through its web client (Browser library) and its external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19), with opt-in journaled writes."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = "Apache-2.0"
@@ -13,7 +13,7 @@ license-files = ["LICENSE", "NOTICE"]
13
13
  authors = [{ name = "Cyril Montiel", email = "cyril@montiel.me" }]
14
14
  keywords = [
15
15
  "robotframework", "robot-framework", "test-automation", "testing", "qa",
16
- "odoo", "erp", "orm", "rpc", "xml-rpc", "json-2",
16
+ "odoo", "erp", "orm", "rpc", "xml-rpc", "json-2", "web-testing", "playwright",
17
17
  ]
18
18
  classifiers = [
19
19
  "Development Status :: 3 - Alpha",
@@ -1,10 +1,10 @@
1
1
  """
2
2
  ODOOFX - Odoo test automation for Robot Framework.
3
3
 
4
- ORM, RPC/XML-RPC, UI web (Playwright), workflows.
4
+ ORM, RPC/XML-RPC, UI web (Browser library), workflows.
5
5
  """
6
6
 
7
- __version__ = "0.1.0"
7
+ __version__ = "0.2.0"
8
8
  __author__ = "Cyril Montiel"
9
9
  __email__ = "cyril@montiel.me"
10
10
  __license__ = "Apache-2.0"