robotframework-odoofx 0.1.0__tar.gz → 0.3.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.
- robotframework_odoofx-0.3.0/NOTICE +88 -0
- robotframework_odoofx-0.3.0/PKG-INFO +278 -0
- robotframework_odoofx-0.3.0/README.md +235 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/pyproject.toml +6 -3
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/OdooFxLibrary/__init__.py +2 -2
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_authenticated_sessions.py +160 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_keywords.py +15 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_log.py +163 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_odoo_session.py +99 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_odoo_write_guard.py +247 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_requests.py +389 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_requests_without_session.py +121 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_sessions.py +243 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/http_status_assertions.py +69 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/OdooFxLibrary/odoo_library.py +159 -161
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/orm.py +161 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/pdf_text.py +119 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/record_writes.py +206 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/report_pdf.py +209 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/OdooFxLibrary/rpc.py +50 -26
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/session_context.py +169 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web.py +494 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_buttons.py +212 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_channel.py +22 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_choices.py +80 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_client.py +492 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_dialog.py +208 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_form.py +493 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_lines.py +280 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_numbers.py +70 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_record_actions.py +347 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_records.py +80 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_search.py +433 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_sections.py +136 -0
- robotframework_odoofx-0.3.0/src/OdooFxLibrary/web_views.py +57 -0
- robotframework_odoofx-0.3.0/src/robotframework_odoofx.egg-info/PKG-INFO +278 -0
- robotframework_odoofx-0.3.0/src/robotframework_odoofx.egg-info/SOURCES.txt +40 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/robotframework_odoofx.egg-info/requires.txt +7 -0
- robotframework_odoofx-0.1.0/NOTICE +0 -43
- robotframework_odoofx-0.1.0/PKG-INFO +0 -139
- robotframework_odoofx-0.1.0/README.md +0 -101
- robotframework_odoofx-0.1.0/src/robotframework_odoofx.egg-info/PKG-INFO +0 -139
- robotframework_odoofx-0.1.0/src/robotframework_odoofx.egg-info/SOURCES.txt +0 -12
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/LICENSE +0 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/setup.cfg +0 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/robotframework_odoofx.egg-info/dependency_links.txt +0 -0
- {robotframework_odoofx-0.1.0 → robotframework_odoofx-0.3.0}/src/robotframework_odoofx.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
ODOOFX
|
|
2
|
+
Copyright 2026 Cyril Montiel
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (see LICENSE file).
|
|
5
|
+
|
|
6
|
+
================================================================================
|
|
7
|
+
THIRD-PARTY COMPONENTS
|
|
8
|
+
================================================================================
|
|
9
|
+
|
|
10
|
+
The robotframework-odoofx package contains code derived from one third-party
|
|
11
|
+
project, listed under ABSORBED CODE below. It depends on the following
|
|
12
|
+
projects, installed from PyPI under their own licenses:
|
|
13
|
+
|
|
14
|
+
1. Robot Framework
|
|
15
|
+
- Project: https://robotframework.org/
|
|
16
|
+
- License: Apache License 2.0
|
|
17
|
+
- Used for: keyword library API, typed secrets, test execution
|
|
18
|
+
|
|
19
|
+
2. Requests
|
|
20
|
+
- Project: https://requests.readthedocs.io/
|
|
21
|
+
- License: Apache License 2.0
|
|
22
|
+
- Used for: the JSON-2 channel (Odoo 19 and later) and the HTTP keywords
|
|
23
|
+
|
|
24
|
+
3. Robot Framework Browser library (optional, `web` extra)
|
|
25
|
+
- Project: https://github.com/MarketSquare/robotframework-browser
|
|
26
|
+
- License: Apache License 2.0
|
|
27
|
+
- Used for: the web channel, through Playwright
|
|
28
|
+
(https://playwright.dev/, Apache License 2.0)
|
|
29
|
+
|
|
30
|
+
4. pypdf (optional, `pdf` extra)
|
|
31
|
+
- Project: https://github.com/py-pdf/pypdf
|
|
32
|
+
- License: BSD 3-Clause License
|
|
33
|
+
- Used for: reading the text of a report PDF
|
|
34
|
+
|
|
35
|
+
5. requests_ntlm (optional, `ntlm` extra)
|
|
36
|
+
- Project: https://github.com/requests/requests-ntlm
|
|
37
|
+
- License: ISC License
|
|
38
|
+
- Used for: the NTLM authenticated HTTP sessions
|
|
39
|
+
|
|
40
|
+
================================================================================
|
|
41
|
+
ABSORBED CODE
|
|
42
|
+
================================================================================
|
|
43
|
+
|
|
44
|
+
robotframework-requests (RequestsLibrary) 0.9.7
|
|
45
|
+
- Project: https://github.com/MarketSquare/robotframework-requests
|
|
46
|
+
- License: MIT License
|
|
47
|
+
- Absorbed: its session, request and log code is rewritten in
|
|
48
|
+
src/OdooFxLibrary/http_sessions.py, http_authenticated_sessions.py,
|
|
49
|
+
http_requests.py, http_requests_without_session.py,
|
|
50
|
+
http_status_assertions.py and http_log.py (each module names its
|
|
51
|
+
origin); the keyword names and their parameters
|
|
52
|
+
are kept, so that a suite written for RequestsLibrary keeps working.
|
|
53
|
+
|
|
54
|
+
Copyright (c) 2016 Bulkan Evcimen
|
|
55
|
+
|
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
57
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
58
|
+
in the Software without restriction, including without limitation the rights
|
|
59
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
60
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
61
|
+
furnished to do so, subject to the following conditions:
|
|
62
|
+
|
|
63
|
+
The above copyright notice and this permission notice shall be included in
|
|
64
|
+
all copies or substantial portions of the Software.
|
|
65
|
+
|
|
66
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
67
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
68
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
69
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
70
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
71
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
72
|
+
THE SOFTWARE.
|
|
73
|
+
|
|
74
|
+
================================================================================
|
|
75
|
+
DESIGN LINEAGE
|
|
76
|
+
================================================================================
|
|
77
|
+
|
|
78
|
+
The method around the library (spec-driven test agents, guards) follows
|
|
79
|
+
rf-test-agents (https://github.com/CyrilM29/rf-test-agents, Apache License
|
|
80
|
+
2.0, same author). No code of it is part of this package.
|
|
81
|
+
|
|
82
|
+
================================================================================
|
|
83
|
+
TRADEMARKS
|
|
84
|
+
================================================================================
|
|
85
|
+
|
|
86
|
+
Odoo is a trademark of Odoo S.A. Robot Framework is a trademark of the Robot
|
|
87
|
+
Framework Foundation. ODOOFX is an independent project, not affiliated with,
|
|
88
|
+
sponsored or endorsed by Odoo S.A. or the Robot Framework Foundation.
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robotframework-odoofx
|
|
3
|
+
Version: 0.3.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: ntlm
|
|
36
|
+
Requires-Dist: requests_ntlm>=1.1; extra == "ntlm"
|
|
37
|
+
Provides-Extra: pdf
|
|
38
|
+
Requires-Dist: pypdf>=4.0; extra == "pdf"
|
|
39
|
+
Provides-Extra: all
|
|
40
|
+
Requires-Dist: robotframework-odoofx[web]; extra == "all"
|
|
41
|
+
Requires-Dist: robotframework-odoofx[pdf]; extra == "all"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# ODOOFX: Odoo library for Robot Framework
|
|
45
|
+
|
|
46
|
+
[](https://pypi.org/project/robotframework-odoofx/)
|
|
47
|
+
[](https://pypi.org/project/robotframework-odoofx/)
|
|
48
|
+
[](https://github.com/CyrilM29/robotframework-odoofx/blob/main/LICENSE)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install robotframework-odoofx
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`OdooFxLibrary` brings Odoo test automation to Robot Framework through **two
|
|
55
|
+
channels under one keyword vocabulary**: the Odoo web client, driven through
|
|
56
|
+
the [Browser](https://robotframework-browser.org/) library, and Odoo's
|
|
57
|
+
external API (XML-RPC up to Odoo 18, JSON-2 from Odoo 19). A suite can cross
|
|
58
|
+
them: prepare or check data over the API, drive the screen for what you
|
|
59
|
+
actually test. It targets Odoo Community and Enterprise, and is **proven live
|
|
60
|
+
on Odoo 16 and Odoo 19 Community** (it is designed for Odoo 14 and later; 14,
|
|
61
|
+
15, 17 and 18 are not measured yet).
|
|
62
|
+
|
|
63
|
+
> **Status: alpha.** Both channels work and are proven live on Odoo 16 and 19,
|
|
64
|
+
> with an HTTP channel (the keywords of RequestsLibrary, absorbed) and the report
|
|
65
|
+
> PDFs Odoo prints. Not covered yet: the kanban, calendar, pivot and graph views,
|
|
66
|
+
> the chatter, the mass actions of a list, Odoo's legacy `/jsonrpc` route.
|
|
67
|
+
> Signatures may still change before 1.0.
|
|
68
|
+
|
|
69
|
+
## Install
|
|
70
|
+
|
|
71
|
+
Requirements: Python 3.10 or later, Robot Framework 7.4 or later, and an Odoo
|
|
72
|
+
instance reachable over HTTP. The RPC channel needs nothing more. The `web`
|
|
73
|
+
extra (`pip install "robotframework-odoofx[web]"`, then `rfbrowser init` once
|
|
74
|
+
for the Playwright browsers) brings the Browser library the web channel is
|
|
75
|
+
built on; the `pdf` extra (`pypdf`) reads the text of a report; `all` installs every extra.
|
|
76
|
+
|
|
77
|
+
Keyword documentation:
|
|
78
|
+
[cyrilm29.github.io/robotframework-odoofx](https://cyrilm29.github.io/robotframework-odoofx/).
|
|
79
|
+
|
|
80
|
+
## Quick start
|
|
81
|
+
|
|
82
|
+
Over the API, reading a quotation's state:
|
|
83
|
+
|
|
84
|
+
```robotframework
|
|
85
|
+
*** Settings ***
|
|
86
|
+
Library OdooFxLibrary
|
|
87
|
+
|
|
88
|
+
*** Test Cases ***
|
|
89
|
+
Read A Quotation State
|
|
90
|
+
Connect To Odoo http://localhost:8069 my_database admin ${PASSWORD} channel=xmlrpc
|
|
91
|
+
Assert Quotation Status Is sale S00004
|
|
92
|
+
[Teardown] Disconnect From Odoo
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
On screen, entering a contact in the web client and reading it back
|
|
96
|
+
independently:
|
|
97
|
+
|
|
98
|
+
```robotframework
|
|
99
|
+
*** Settings ***
|
|
100
|
+
Library Browser
|
|
101
|
+
Library OdooFxLibrary
|
|
102
|
+
|
|
103
|
+
*** Test Cases ***
|
|
104
|
+
Enter A Company Contact
|
|
105
|
+
${marker}= New Odoo Run Marker prefix=DEMO
|
|
106
|
+
New Browser chromium headless=${TRUE}
|
|
107
|
+
New Page about:blank
|
|
108
|
+
Log In To Odoo Web Client http://localhost:8069 my_database admin ${PASSWORD}
|
|
109
|
+
... expected_series=19 allow_write=${TRUE}
|
|
110
|
+
Navigate To Menu contacts.menu_contacts
|
|
111
|
+
Open New Odoo Web Form
|
|
112
|
+
Fill Odoo Web Field company_type company
|
|
113
|
+
Fill Odoo Web Field name ${marker} Company
|
|
114
|
+
${contact_id}= Save Odoo Web Record
|
|
115
|
+
${found}= Search Read Odoo Records Through Web Session res.partner
|
|
116
|
+
... ${{[["id", "=", $contact_id]]}} fields=${{["name"]}}
|
|
117
|
+
Should Be Equal ${found}[0][name] ${marker} Company
|
|
118
|
+
[Teardown] Run Keywords Run Keyword And Ignore Error Discard Odoo Web Changes
|
|
119
|
+
... AND Close Browser
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Credentials never live in a suite: pass them on the command line
|
|
123
|
+
(`robot -v "PASSWORD: Secret:..." suite.robot`, the Robot Framework 7.4 typed
|
|
124
|
+
variable keeps them out of the logs) or through the environment.
|
|
125
|
+
|
|
126
|
+
## How it behaves
|
|
127
|
+
|
|
128
|
+
- **The target is proven first.** `Get Odoo Server Version` needs no session;
|
|
129
|
+
`Connect To Odoo` and `Log In To Odoo Web Client` check the database and the
|
|
130
|
+
Odoo series, and `expected_series` refuses another Odoo version before
|
|
131
|
+
anything happens (two Odoo versions often run side by side).
|
|
132
|
+
- **Technical names and codes, never labels.** Labels are translated and change
|
|
133
|
+
between versions. Menus are opened by external id (`sale.sale_menu_root`),
|
|
134
|
+
fields are named by technical name, a radio or selection option is given by
|
|
135
|
+
its code (`one`, not its label), states are compared by code (`draft`,
|
|
136
|
+
`sent`, `sale`, `cancel`). A label fails an assertion as "not a state code".
|
|
137
|
+
- **Writes are off unless you opt in** (`allow_write`), on both channels, and
|
|
138
|
+
every write is journaled with its phase: `planned`, `done`, `failed` or
|
|
139
|
+
`unknown`. An `unknown` write (the answer was lost) is read back and
|
|
140
|
+
reconciled, never sent again.
|
|
141
|
+
- **A value is read back as it is typed.** A field the web client did not take
|
|
142
|
+
fails the keyword at once. Relational values are picked among the client's
|
|
143
|
+
proposals, never through Create or Search more, which would write or open a
|
|
144
|
+
dialog.
|
|
145
|
+
- **A form left half-typed is never saved by accident.** Odoo saves a form it
|
|
146
|
+
leaves, so `Navigate To Menu`, `Go Back Through Odoo Web Breadcrumb` and
|
|
147
|
+
`Log Out Of Odoo Web Client` refuse to leave one with unsaved changes (save
|
|
148
|
+
or discard first): a failed test never writes what it left behind.
|
|
149
|
+
|
|
150
|
+
## Keywords
|
|
151
|
+
|
|
152
|
+
**Connection, reads and state codes** (RPC channel):
|
|
153
|
+
|
|
154
|
+
| Keyword | Purpose |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `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 |
|
|
157
|
+
| `Get Odoo Connection Info` | The proven target of the current connection, never the secret |
|
|
158
|
+
| `Count Odoo Records` | Count the records of a model matching a domain |
|
|
159
|
+
| `Search Read Odoo Records` | Read the records of a model matching a domain |
|
|
160
|
+
| `Get Odoo Record` | One identified record, whole or by fields |
|
|
161
|
+
| `Odoo Record Exists` | Whether a record exists (archived ones count) |
|
|
162
|
+
| `Odoo Record Should Exist`, `Odoo Record Should Not Exist` | Prove a presence or a removal on the identified record |
|
|
163
|
+
| `Get Field Selection Values` | The technical codes of a selection field |
|
|
164
|
+
| `Count Odoo Records By State` | Record count per state code |
|
|
165
|
+
| `Get Odoo Record State` | The state code of one identified record |
|
|
166
|
+
| `Odoo Record State Should Be` | Fail unless the identified record is in the expected state code |
|
|
167
|
+
| `Assert Quotation Status Is` | Check a quotation's state code, by order reference or id |
|
|
168
|
+
| `Get Odoo Config Parameter` | A system parameter such as `web.base.url` (administrator) |
|
|
169
|
+
| `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 |
|
|
170
|
+
| `Resolve Odoo External Id` | The database id behind an external id such as `product.product_product_1`, proved to be of the expected model |
|
|
171
|
+
| `Get Odoo Server Time` | The server's clock (UTC, one second), to bracket what a run created |
|
|
172
|
+
| `New Odoo Run Marker` | A unique label to put in a free-text field of the records a run creates, to find them again |
|
|
173
|
+
| `Disconnect From Odoo` | Close the connection |
|
|
174
|
+
|
|
175
|
+
**Writes and their journal** (both channels journal):
|
|
176
|
+
|
|
177
|
+
| Keyword | Purpose |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `Create Odoo Record`, `Update Odoo Record`, `Delete Odoo Record` | Write a record (needs `allow_write`) |
|
|
180
|
+
| `Call Odoo Record Method` | Call a model method such as `action_confirm` or `action_cancel` (needs `allow_write`) |
|
|
181
|
+
| `Get Odoo Write Journal` | Every write (after entry `since`) with its phase: `planned`, `done`, `failed` or `unknown` (to read back, never to resend) |
|
|
182
|
+
| `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 |
|
|
183
|
+
| `Reconcile Odoo Write` | Settle a `planned` or `unknown` journal entry after reading the record back |
|
|
184
|
+
|
|
185
|
+
**Structure of the database** (RPC channel):
|
|
186
|
+
|
|
187
|
+
| Keyword | Purpose |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| `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) |
|
|
190
|
+
| `Get Odoo Model Relations` | The many2one, one2many and many2many fields of a model, with the model they point at |
|
|
191
|
+
| `Search Odoo Models` | The models whose technical name contains a text, wizards told apart |
|
|
192
|
+
| `Get Odoo Module State`, `Odoo Module Should Be Installed` | The state code of a module; fail unless installed |
|
|
193
|
+
| `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 |
|
|
194
|
+
|
|
195
|
+
**Session context** (RPC channel: Odoo applies no preference of the user to an RPC call):
|
|
196
|
+
|
|
197
|
+
| Keyword | Purpose |
|
|
198
|
+
| --- | --- |
|
|
199
|
+
| `Set Odoo Session Context` | A language, time zone or companies sent with every RPC call of the connection, under the context a keyword passes; an inactive language, an unknown time zone or a company the user does not have is refused at once |
|
|
200
|
+
| `Get Odoo Session Context`, `Clear Odoo Session Context` | Read or empty the session context (a new connection starts empty) |
|
|
201
|
+
| `Get Odoo User Context` | The preferences of the connected user as Odoo gives them (`lang`, `tz`) |
|
|
202
|
+
|
|
203
|
+
**HTTP** (the session and request keywords of RequestsLibrary, absorbed under their names and arguments, the secrets they recognize masked in the log):
|
|
204
|
+
|
|
205
|
+
| Keyword | Purpose |
|
|
206
|
+
| --- | --- |
|
|
207
|
+
| `Create Session`, `Update Session`, `Session Exists`, `Delete All Sessions` | Open an HTTP session towards a server under an alias, merge headers or cookies into it, find it, close them all |
|
|
208
|
+
| `Create Custom Session`, `Create Digest Session`, `Create Client Cert Session`, `Create Ntlm Session` | Open a session authenticated by any requests authentication, HTTP Digest, a client certificate, or NTLM (optional extra `ntlm`) |
|
|
209
|
+
| `GET On Session`, `POST On Session`, `PUT On Session`, `PATCH On Session`, `DELETE On Session`, `HEAD On Session`, `OPTIONS On Session` | Send a request on a session; without `expected_status` a 4xx or 5xx fails, as in RequestsLibrary; HEAD does not follow a redirect, the other verbs do |
|
|
210
|
+
| `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS` | Send a request to a full URL without a session; unlike RequestsLibrary, no cookie nor timeout of another session goes with it |
|
|
211
|
+
| `Status Should Be`, `Request Should Be Successful`, `Get File For Streaming Upload` | Assert the status of the response given, or of the last one (a failed response given is judged, unlike RequestsLibrary); open a file to stream as a request body |
|
|
212
|
+
| `Create Odoo Http Session` | An authenticated Odoo web session on the proven target, proven by its database, series and user, for the routes a logged user reaches (a report PDF) |
|
|
213
|
+
|
|
214
|
+
A write on Odoo through these keywords (a call of its RPC routes or a website form whose method is not a read) is refused before it is sent unless `Connect To Odoo` proved that target and opened it with `allow_write=${TRUE}`; it then enters the write journal and is sent once.
|
|
215
|
+
|
|
216
|
+
Coming from RequestsLibrary? The [migration guide](https://github.com/CyrilM29/robotframework-odoofx/blob/main/docs/migrating-from-requestslibrary.md) gives each deliberate change, its effect on a suite and its remedy.
|
|
217
|
+
|
|
218
|
+
**Reports** (the PDF Odoo prints, through a web session of `Create Odoo Http Session`; its text needs the `pdf` extra):
|
|
219
|
+
|
|
220
|
+
| Keyword | Purpose |
|
|
221
|
+
| --- | --- |
|
|
222
|
+
| `Get Odoo Report Pdf` | The PDF of a report action on records, by Odoo's report route without following a redirect, a redirect, another status or another type named; refused before any request when the action would save the PDF as an attachment, unless accepted on a writing connection |
|
|
223
|
+
| `Get Pdf Text`, `Pdf Should Contain`, `Pdf Should Not Contain` | The text of the PDF, normalized on both sides (Unicode spaces, line breaks, a reference the template wrapped at its hyphen), and a value asserted in it or absent from it; a PDF without a text layer fails saying so |
|
|
224
|
+
| `Get Odoo Formatted Amount` | An amount as Odoo writes it in a document of a language and a currency, read from `res.lang` and `res.currency` |
|
|
225
|
+
|
|
226
|
+
**Web client: session, navigation and reads** (built on the Browser library,
|
|
227
|
+
which opens the browser, the context and the page):
|
|
228
|
+
|
|
229
|
+
| Keyword | Purpose |
|
|
230
|
+
| --- | --- |
|
|
231
|
+
| `Get Odoo Server Version` | The server's version and series, without session nor secret: the proof a suite opens with |
|
|
232
|
+
| `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 |
|
|
233
|
+
| `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 |
|
|
234
|
+
| `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 |
|
|
235
|
+
| `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 |
|
|
236
|
+
| `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 |
|
|
237
|
+
| `Search Odoo Web View`, `Select Odoo Web Search Filter`, `Remove Odoo Web Search Facet`, `Switch Odoo Web View` | Search a list through its search bar: a text on a field, or a filter, of the search view, named by its technical name (found at its place in the view's arch, the domain the client sends checked against the arch); remove a facet; switch the action's view (list, kanban). Each waits for the list Odoo shows, returns the count it answered, and writes nothing |
|
|
238
|
+
| `Open Odoo Web Record`, `Open Odoo Web Record By Id`, `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), or any record by its model and id (one a suite created over RPC), read a list cell, read and walk back the breadcrumb |
|
|
239
|
+
| `Get Odoo Web Statusbar Value`, `Odoo Web Form Should Be Saved` | The technical code of the form's current step; no pending change |
|
|
240
|
+
| `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 |
|
|
241
|
+
| `Log Out Of Odoo Web Client` | Log out through the user menu |
|
|
242
|
+
|
|
243
|
+
**Web client: form entry** (screen writes need `allow_write` at the login and
|
|
244
|
+
are journaled):
|
|
245
|
+
|
|
246
|
+
| Keyword | Purpose |
|
|
247
|
+
| --- | --- |
|
|
248
|
+
| `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 |
|
|
249
|
+
| `Fill Odoo Web Field`, `Get Odoo Web Field Value` | Enter a value and read it back on the screen at once: text, numbers and dates (given as `2.5` and 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, a number field as a number |
|
|
250
|
+
| `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 |
|
|
251
|
+
| `Add Odoo Web Line`, `Fill Odoo Web Line Field`, `Get Odoo Web Lines`, `Get Odoo Web Line Field Value`, `Delete Odoo Web Line` | Add a line to a one2many field (the lines of a sales order), a section or a note by its `display_type`; fill a field of the line in edition (the text of a section or a note on Odoo 16 and 19 alike); read the lines once shown as stored, with their type; read one field of a line, a number as a number in the user's format; delete a line by its position |
|
|
252
|
+
| `Delete Odoo Web Section` | Delete a section of a list of lines with the lines Odoo attaches to it, by its menu as Odoo 19 does (a subsection up to the next section or subsection); refused before any click on Odoo 16, whose delete button of a section removes its row alone |
|
|
253
|
+
| `Click Odoo Web Form Button` | Press a button that calls a method of the record (`action_confirm`), by its technical name, waiting until Odoo answered and reloaded the record (needs `allow_write`, journaled); or a button that opens a window action, by the action's external id, without writing |
|
|
254
|
+
| `Archive Odoo Web Record`, `Unarchive Odoo Web Record`, `Delete Odoo Web Record`, `Odoo Web Confirmation Is Open` | Archive, unarchive or delete the record of the form through its Actions menu, the entry told by its icon (Odoo 19) or by the place the code of Odoo gives it (Odoo 16), never by its label; Odoo's question accepted, or refused with `confirm=${FALSE}`; journaled, Odoo's refusal reported with the class of its exception; whether a question of Odoo is open |
|
|
255
|
+
| `Odoo Web Dialog Is Open`, `Fill Odoo Web Dialog Field`, `Get Odoo Web Dialog Field Value`, `Click Odoo Web Dialog Button`, `Close Odoo Web Dialog` | Work in the dialog a button opened (a wizard): whether one is shown, enter and read its fields on the wizard's model, press a button of its footer by its technical name (and its id when several share it; needs `allow_write`, journaled) and get the view it opens, close it without writing |
|
|
256
|
+
|
|
257
|
+
`Create New Quotation` is a skeleton that only warns: do not rely on it.
|
|
258
|
+
|
|
259
|
+
## Layout
|
|
260
|
+
|
|
261
|
+
```text
|
|
262
|
+
src/OdooFxLibrary/ the library
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Issues
|
|
266
|
+
|
|
267
|
+
Bug reports and suggestions are welcome as
|
|
268
|
+
[GitHub issues](https://github.com/CyrilM29/robotframework-odoofx/issues).
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
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).
|
|
273
|
+
|
|
274
|
+
## Trademarks
|
|
275
|
+
|
|
276
|
+
Odoo is a trademark of Odoo S.A. Robot Framework is a trademark of the Robot
|
|
277
|
+
Framework Foundation. ODOOFX is an independent project, not affiliated with,
|
|
278
|
+
sponsored or endorsed by Odoo S.A. or the Robot Framework Foundation.
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# ODOOFX: Odoo library for Robot Framework
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/robotframework-odoofx/)
|
|
4
|
+
[](https://pypi.org/project/robotframework-odoofx/)
|
|
5
|
+
[](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
|
+
> with an HTTP channel (the keywords of RequestsLibrary, absorbed) and the report
|
|
22
|
+
> PDFs Odoo prints. Not covered yet: the kanban, calendar, pivot and graph views,
|
|
23
|
+
> the chatter, the mass actions of a list, Odoo's legacy `/jsonrpc` route.
|
|
24
|
+
> Signatures may still change before 1.0.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
Requirements: Python 3.10 or later, Robot Framework 7.4 or later, and an Odoo
|
|
29
|
+
instance reachable over HTTP. The RPC channel needs nothing more. The `web`
|
|
30
|
+
extra (`pip install "robotframework-odoofx[web]"`, then `rfbrowser init` once
|
|
31
|
+
for the Playwright browsers) brings the Browser library the web channel is
|
|
32
|
+
built on; the `pdf` extra (`pypdf`) reads the text of a report; `all` installs every extra.
|
|
33
|
+
|
|
34
|
+
Keyword documentation:
|
|
35
|
+
[cyrilm29.github.io/robotframework-odoofx](https://cyrilm29.github.io/robotframework-odoofx/).
|
|
36
|
+
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
Over the API, reading a quotation's state:
|
|
40
|
+
|
|
41
|
+
```robotframework
|
|
42
|
+
*** Settings ***
|
|
43
|
+
Library OdooFxLibrary
|
|
44
|
+
|
|
45
|
+
*** Test Cases ***
|
|
46
|
+
Read A Quotation State
|
|
47
|
+
Connect To Odoo http://localhost:8069 my_database admin ${PASSWORD} channel=xmlrpc
|
|
48
|
+
Assert Quotation Status Is sale S00004
|
|
49
|
+
[Teardown] Disconnect From Odoo
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
On screen, entering a contact in the web client and reading it back
|
|
53
|
+
independently:
|
|
54
|
+
|
|
55
|
+
```robotframework
|
|
56
|
+
*** Settings ***
|
|
57
|
+
Library Browser
|
|
58
|
+
Library OdooFxLibrary
|
|
59
|
+
|
|
60
|
+
*** Test Cases ***
|
|
61
|
+
Enter A Company Contact
|
|
62
|
+
${marker}= New Odoo Run Marker prefix=DEMO
|
|
63
|
+
New Browser chromium headless=${TRUE}
|
|
64
|
+
New Page about:blank
|
|
65
|
+
Log In To Odoo Web Client http://localhost:8069 my_database admin ${PASSWORD}
|
|
66
|
+
... expected_series=19 allow_write=${TRUE}
|
|
67
|
+
Navigate To Menu contacts.menu_contacts
|
|
68
|
+
Open New Odoo Web Form
|
|
69
|
+
Fill Odoo Web Field company_type company
|
|
70
|
+
Fill Odoo Web Field name ${marker} Company
|
|
71
|
+
${contact_id}= Save Odoo Web Record
|
|
72
|
+
${found}= Search Read Odoo Records Through Web Session res.partner
|
|
73
|
+
... ${{[["id", "=", $contact_id]]}} fields=${{["name"]}}
|
|
74
|
+
Should Be Equal ${found}[0][name] ${marker} Company
|
|
75
|
+
[Teardown] Run Keywords Run Keyword And Ignore Error Discard Odoo Web Changes
|
|
76
|
+
... AND Close Browser
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Credentials never live in a suite: pass them on the command line
|
|
80
|
+
(`robot -v "PASSWORD: Secret:..." suite.robot`, the Robot Framework 7.4 typed
|
|
81
|
+
variable keeps them out of the logs) or through the environment.
|
|
82
|
+
|
|
83
|
+
## How it behaves
|
|
84
|
+
|
|
85
|
+
- **The target is proven first.** `Get Odoo Server Version` needs no session;
|
|
86
|
+
`Connect To Odoo` and `Log In To Odoo Web Client` check the database and the
|
|
87
|
+
Odoo series, and `expected_series` refuses another Odoo version before
|
|
88
|
+
anything happens (two Odoo versions often run side by side).
|
|
89
|
+
- **Technical names and codes, never labels.** Labels are translated and change
|
|
90
|
+
between versions. Menus are opened by external id (`sale.sale_menu_root`),
|
|
91
|
+
fields are named by technical name, a radio or selection option is given by
|
|
92
|
+
its code (`one`, not its label), states are compared by code (`draft`,
|
|
93
|
+
`sent`, `sale`, `cancel`). A label fails an assertion as "not a state code".
|
|
94
|
+
- **Writes are off unless you opt in** (`allow_write`), on both channels, and
|
|
95
|
+
every write is journaled with its phase: `planned`, `done`, `failed` or
|
|
96
|
+
`unknown`. An `unknown` write (the answer was lost) is read back and
|
|
97
|
+
reconciled, never sent again.
|
|
98
|
+
- **A value is read back as it is typed.** A field the web client did not take
|
|
99
|
+
fails the keyword at once. Relational values are picked among the client's
|
|
100
|
+
proposals, never through Create or Search more, which would write or open a
|
|
101
|
+
dialog.
|
|
102
|
+
- **A form left half-typed is never saved by accident.** Odoo saves a form it
|
|
103
|
+
leaves, so `Navigate To Menu`, `Go Back Through Odoo Web Breadcrumb` and
|
|
104
|
+
`Log Out Of Odoo Web Client` refuse to leave one with unsaved changes (save
|
|
105
|
+
or discard first): a failed test never writes what it left behind.
|
|
106
|
+
|
|
107
|
+
## Keywords
|
|
108
|
+
|
|
109
|
+
**Connection, reads and state codes** (RPC channel):
|
|
110
|
+
|
|
111
|
+
| Keyword | Purpose |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `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 |
|
|
114
|
+
| `Get Odoo Connection Info` | The proven target of the current connection, never the secret |
|
|
115
|
+
| `Count Odoo Records` | Count the records of a model matching a domain |
|
|
116
|
+
| `Search Read Odoo Records` | Read the records of a model matching a domain |
|
|
117
|
+
| `Get Odoo Record` | One identified record, whole or by fields |
|
|
118
|
+
| `Odoo Record Exists` | Whether a record exists (archived ones count) |
|
|
119
|
+
| `Odoo Record Should Exist`, `Odoo Record Should Not Exist` | Prove a presence or a removal on the identified record |
|
|
120
|
+
| `Get Field Selection Values` | The technical codes of a selection field |
|
|
121
|
+
| `Count Odoo Records By State` | Record count per state code |
|
|
122
|
+
| `Get Odoo Record State` | The state code of one identified record |
|
|
123
|
+
| `Odoo Record State Should Be` | Fail unless the identified record is in the expected state code |
|
|
124
|
+
| `Assert Quotation Status Is` | Check a quotation's state code, by order reference or id |
|
|
125
|
+
| `Get Odoo Config Parameter` | A system parameter such as `web.base.url` (administrator) |
|
|
126
|
+
| `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 |
|
|
127
|
+
| `Resolve Odoo External Id` | The database id behind an external id such as `product.product_product_1`, proved to be of the expected model |
|
|
128
|
+
| `Get Odoo Server Time` | The server's clock (UTC, one second), to bracket what a run created |
|
|
129
|
+
| `New Odoo Run Marker` | A unique label to put in a free-text field of the records a run creates, to find them again |
|
|
130
|
+
| `Disconnect From Odoo` | Close the connection |
|
|
131
|
+
|
|
132
|
+
**Writes and their journal** (both channels journal):
|
|
133
|
+
|
|
134
|
+
| Keyword | Purpose |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `Create Odoo Record`, `Update Odoo Record`, `Delete Odoo Record` | Write a record (needs `allow_write`) |
|
|
137
|
+
| `Call Odoo Record Method` | Call a model method such as `action_confirm` or `action_cancel` (needs `allow_write`) |
|
|
138
|
+
| `Get Odoo Write Journal` | Every write (after entry `since`) with its phase: `planned`, `done`, `failed` or `unknown` (to read back, never to resend) |
|
|
139
|
+
| `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 |
|
|
140
|
+
| `Reconcile Odoo Write` | Settle a `planned` or `unknown` journal entry after reading the record back |
|
|
141
|
+
|
|
142
|
+
**Structure of the database** (RPC channel):
|
|
143
|
+
|
|
144
|
+
| Keyword | Purpose |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| `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) |
|
|
147
|
+
| `Get Odoo Model Relations` | The many2one, one2many and many2many fields of a model, with the model they point at |
|
|
148
|
+
| `Search Odoo Models` | The models whose technical name contains a text, wizards told apart |
|
|
149
|
+
| `Get Odoo Module State`, `Odoo Module Should Be Installed` | The state code of a module; fail unless installed |
|
|
150
|
+
| `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 |
|
|
151
|
+
|
|
152
|
+
**Session context** (RPC channel: Odoo applies no preference of the user to an RPC call):
|
|
153
|
+
|
|
154
|
+
| Keyword | Purpose |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `Set Odoo Session Context` | A language, time zone or companies sent with every RPC call of the connection, under the context a keyword passes; an inactive language, an unknown time zone or a company the user does not have is refused at once |
|
|
157
|
+
| `Get Odoo Session Context`, `Clear Odoo Session Context` | Read or empty the session context (a new connection starts empty) |
|
|
158
|
+
| `Get Odoo User Context` | The preferences of the connected user as Odoo gives them (`lang`, `tz`) |
|
|
159
|
+
|
|
160
|
+
**HTTP** (the session and request keywords of RequestsLibrary, absorbed under their names and arguments, the secrets they recognize masked in the log):
|
|
161
|
+
|
|
162
|
+
| Keyword | Purpose |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `Create Session`, `Update Session`, `Session Exists`, `Delete All Sessions` | Open an HTTP session towards a server under an alias, merge headers or cookies into it, find it, close them all |
|
|
165
|
+
| `Create Custom Session`, `Create Digest Session`, `Create Client Cert Session`, `Create Ntlm Session` | Open a session authenticated by any requests authentication, HTTP Digest, a client certificate, or NTLM (optional extra `ntlm`) |
|
|
166
|
+
| `GET On Session`, `POST On Session`, `PUT On Session`, `PATCH On Session`, `DELETE On Session`, `HEAD On Session`, `OPTIONS On Session` | Send a request on a session; without `expected_status` a 4xx or 5xx fails, as in RequestsLibrary; HEAD does not follow a redirect, the other verbs do |
|
|
167
|
+
| `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS` | Send a request to a full URL without a session; unlike RequestsLibrary, no cookie nor timeout of another session goes with it |
|
|
168
|
+
| `Status Should Be`, `Request Should Be Successful`, `Get File For Streaming Upload` | Assert the status of the response given, or of the last one (a failed response given is judged, unlike RequestsLibrary); open a file to stream as a request body |
|
|
169
|
+
| `Create Odoo Http Session` | An authenticated Odoo web session on the proven target, proven by its database, series and user, for the routes a logged user reaches (a report PDF) |
|
|
170
|
+
|
|
171
|
+
A write on Odoo through these keywords (a call of its RPC routes or a website form whose method is not a read) is refused before it is sent unless `Connect To Odoo` proved that target and opened it with `allow_write=${TRUE}`; it then enters the write journal and is sent once.
|
|
172
|
+
|
|
173
|
+
Coming from RequestsLibrary? The [migration guide](https://github.com/CyrilM29/robotframework-odoofx/blob/main/docs/migrating-from-requestslibrary.md) gives each deliberate change, its effect on a suite and its remedy.
|
|
174
|
+
|
|
175
|
+
**Reports** (the PDF Odoo prints, through a web session of `Create Odoo Http Session`; its text needs the `pdf` extra):
|
|
176
|
+
|
|
177
|
+
| Keyword | Purpose |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `Get Odoo Report Pdf` | The PDF of a report action on records, by Odoo's report route without following a redirect, a redirect, another status or another type named; refused before any request when the action would save the PDF as an attachment, unless accepted on a writing connection |
|
|
180
|
+
| `Get Pdf Text`, `Pdf Should Contain`, `Pdf Should Not Contain` | The text of the PDF, normalized on both sides (Unicode spaces, line breaks, a reference the template wrapped at its hyphen), and a value asserted in it or absent from it; a PDF without a text layer fails saying so |
|
|
181
|
+
| `Get Odoo Formatted Amount` | An amount as Odoo writes it in a document of a language and a currency, read from `res.lang` and `res.currency` |
|
|
182
|
+
|
|
183
|
+
**Web client: session, navigation and reads** (built on the Browser library,
|
|
184
|
+
which opens the browser, the context and the page):
|
|
185
|
+
|
|
186
|
+
| Keyword | Purpose |
|
|
187
|
+
| --- | --- |
|
|
188
|
+
| `Get Odoo Server Version` | The server's version and series, without session nor secret: the proof a suite opens with |
|
|
189
|
+
| `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 |
|
|
190
|
+
| `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 |
|
|
191
|
+
| `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 |
|
|
192
|
+
| `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 |
|
|
193
|
+
| `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 |
|
|
194
|
+
| `Search Odoo Web View`, `Select Odoo Web Search Filter`, `Remove Odoo Web Search Facet`, `Switch Odoo Web View` | Search a list through its search bar: a text on a field, or a filter, of the search view, named by its technical name (found at its place in the view's arch, the domain the client sends checked against the arch); remove a facet; switch the action's view (list, kanban). Each waits for the list Odoo shows, returns the count it answered, and writes nothing |
|
|
195
|
+
| `Open Odoo Web Record`, `Open Odoo Web Record By Id`, `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), or any record by its model and id (one a suite created over RPC), read a list cell, read and walk back the breadcrumb |
|
|
196
|
+
| `Get Odoo Web Statusbar Value`, `Odoo Web Form Should Be Saved` | The technical code of the form's current step; no pending change |
|
|
197
|
+
| `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 |
|
|
198
|
+
| `Log Out Of Odoo Web Client` | Log out through the user menu |
|
|
199
|
+
|
|
200
|
+
**Web client: form entry** (screen writes need `allow_write` at the login and
|
|
201
|
+
are journaled):
|
|
202
|
+
|
|
203
|
+
| Keyword | Purpose |
|
|
204
|
+
| --- | --- |
|
|
205
|
+
| `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 |
|
|
206
|
+
| `Fill Odoo Web Field`, `Get Odoo Web Field Value` | Enter a value and read it back on the screen at once: text, numbers and dates (given as `2.5` and 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, a number field as a number |
|
|
207
|
+
| `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 |
|
|
208
|
+
| `Add Odoo Web Line`, `Fill Odoo Web Line Field`, `Get Odoo Web Lines`, `Get Odoo Web Line Field Value`, `Delete Odoo Web Line` | Add a line to a one2many field (the lines of a sales order), a section or a note by its `display_type`; fill a field of the line in edition (the text of a section or a note on Odoo 16 and 19 alike); read the lines once shown as stored, with their type; read one field of a line, a number as a number in the user's format; delete a line by its position |
|
|
209
|
+
| `Delete Odoo Web Section` | Delete a section of a list of lines with the lines Odoo attaches to it, by its menu as Odoo 19 does (a subsection up to the next section or subsection); refused before any click on Odoo 16, whose delete button of a section removes its row alone |
|
|
210
|
+
| `Click Odoo Web Form Button` | Press a button that calls a method of the record (`action_confirm`), by its technical name, waiting until Odoo answered and reloaded the record (needs `allow_write`, journaled); or a button that opens a window action, by the action's external id, without writing |
|
|
211
|
+
| `Archive Odoo Web Record`, `Unarchive Odoo Web Record`, `Delete Odoo Web Record`, `Odoo Web Confirmation Is Open` | Archive, unarchive or delete the record of the form through its Actions menu, the entry told by its icon (Odoo 19) or by the place the code of Odoo gives it (Odoo 16), never by its label; Odoo's question accepted, or refused with `confirm=${FALSE}`; journaled, Odoo's refusal reported with the class of its exception; whether a question of Odoo is open |
|
|
212
|
+
| `Odoo Web Dialog Is Open`, `Fill Odoo Web Dialog Field`, `Get Odoo Web Dialog Field Value`, `Click Odoo Web Dialog Button`, `Close Odoo Web Dialog` | Work in the dialog a button opened (a wizard): whether one is shown, enter and read its fields on the wizard's model, press a button of its footer by its technical name (and its id when several share it; needs `allow_write`, journaled) and get the view it opens, close it without writing |
|
|
213
|
+
|
|
214
|
+
`Create New Quotation` is a skeleton that only warns: do not rely on it.
|
|
215
|
+
|
|
216
|
+
## Layout
|
|
217
|
+
|
|
218
|
+
```text
|
|
219
|
+
src/OdooFxLibrary/ the library
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Issues
|
|
223
|
+
|
|
224
|
+
Bug reports and suggestions are welcome as
|
|
225
|
+
[GitHub issues](https://github.com/CyrilM29/robotframework-odoofx/issues).
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
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).
|
|
230
|
+
|
|
231
|
+
## Trademarks
|
|
232
|
+
|
|
233
|
+
Odoo is a trademark of Odoo S.A. Robot Framework is a trademark of the Robot
|
|
234
|
+
Framework Foundation. ODOOFX is an independent project, not affiliated with,
|
|
235
|
+
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.
|
|
8
|
-
description = "ODOOFX: Robot Framework library for testing Odoo
|
|
7
|
+
version = "0.3.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",
|
|
@@ -40,8 +40,11 @@ dependencies = [
|
|
|
40
40
|
|
|
41
41
|
[project.optional-dependencies]
|
|
42
42
|
web = ["robotframework-browser>=20.0,<21"]
|
|
43
|
+
ntlm = ["requests_ntlm>=1.1"]
|
|
44
|
+
pdf = ["pypdf>=4.0"]
|
|
43
45
|
all = [
|
|
44
46
|
"robotframework-odoofx[web]",
|
|
47
|
+
"robotframework-odoofx[pdf]",
|
|
45
48
|
]
|
|
46
49
|
|
|
47
50
|
[project.urls]
|