Repository navigation
Releases: MobyNL/robotframework-mongodblibrary
Release list
1.1.0
Widens the supported versions to Robot Framework 5.0 – 7.x on Python 3.10 – 3.14, adds Secret support for credentials, and documents how to actually enable AWS authentication.
pip install robotframework-mongodbRobot Framework 5.0 and later
The constraints previously allowed only Robot Framework 7.3+ on Python 3.12+. The library needed no code change for this — everything it imports from robot other than Secret predates 5.0, Secret was already imported conditionally, and the keyword annotations are ones 5.0 converts. The pins were the only thing keeping older versions out.
On 5.0 through 6.0, pair it with the assertion engine's 2.x line, because 3.x requires Robot Framework 6.1.1:
pip install robotframework-mongodb "robotframework==5.0.1" "robotframework-assertion-engine==2.0.0"The upper end of the range matters as much as the lower: the previous ^3.0.3 excluded the assertion engine's 4.x and 5.x lines, which work and which other Robot Framework libraries depend on — installing alongside Browser would have been an unsatisfiable conflict.
Secrets for credentials
On Robot Framework 7.4 and later, db_password and db_conn_string accept a Secret, so the value is written to log.html and output.xml as <secret> rather than as itself. A secret can only be built from an environment variable, so there is no way to write the value into the suite by accident. Below 7.4 both arguments take a plain string, exactly as before.
The AWS documentation was wrong
If you tried to use AWS authentication before this release, it silently did not work.
- Enabling it was never documented. It needs
authMechanism=MONGODB-AWStogether withauthSource=$external, and neither appeared in the README or the keyword documentation. The documented example was a connection string with nothing AWS-specific in it, so it authenticated with SCRAM instead. Both are now documented, including thatauth_mechanismandauth_sourcealready reach them as keyword arguments — no connection string is required for IAM. - Amazon DocumentDB and AWS IAM are now separate sections, because they are independent choices rather than one path. DocumentDB's own requirements are documented for the first time: TLS against Amazon's CA bundle, and
retryWrites=false, which is required and without which every write fails. - The keyword documentation claimed the library reads
AWS_ACCESS_KEY_IDand friends. It reads none of them:pymongo-auth-awsresolves credentials, and an EC2, ECS, EKS or Lambda role is used with no credentials at all. It also told you to installpymongo[aws], which installs pymongo's extra and leaves this package's alone — the extra it meant isrobotframework-mongodb[aws].
Also
- A new Importing section documents
coerce_object_ids, the only import-time argument, and theGLOBALscope — including that two suites importing with different values get separate instances, and therefore separate connection pools rather than shared connections. - Fixed: the unit test file covering the keywords ran no tests at all on Robot Framework 7.3 and older. A module-level
pytest.importorskipforSecretraised at import, so all 126 tests were skipped and reported as a single skip.
The changelog has the full detail.
1.0.0
First release the version number claims is stable. It collects the work staged as 0.3.0, which was never published, and completes the keyword surface: 50 keywords covering the parts of pymongo a test suite actually reaches for.
pip install robotframework-mongodbRead this before upgrading
Several fixes change behaviour that previously failed silently, so suites that appeared to pass may start reporting real failures. That is the point of the release.
Switch Databasehad no effect. It set an attribute no other keyword read, so every later keyword kept using the previous connection — writing to the wrong database, or failing withKeyError: 'default'.Delete DocumentandDelete Manycoerced every query value to a string.Delete Many coll count=${5}searched for"5", deleted nothing and reported success.- A document could not be found by its
_idin string form.Insert Documentreturns anObjectId; once that value passed through a Robot variable, a CSV or a JSON fixture it became text and no longer matched. A string_idin a query is now converted automatically, including inside$in. This rewrites part of your query, so it is documented in full and can be turned off withcoerce_object_ids=${False}. - The assertion keywords could loop forever. The retry deadline was advanced by adding
retry_pauseto a counter, soretry_pause=0 secondsnever reached the timeout. - Connecting reported success against an unreachable server, because pymongo connects lazily. Both connect keywords now verify before passing.
Nothing that worked before is removed or renamed, and every new argument defaults to the previous behaviour, so upgrading from 0.2.2 needs no changes to a suite beyond those the fixes force.
New in this release
Collections and databases — Create Collection, Drop Collection, List Collections, List Databases, Drop Database, Get Server Info. Emptying a collection leaves its indexes and options behind, so a unique index created by one test still rejected the next one's fixtures; dropping it is what actually resets it.
Writing — Replace Document, and upsert on all four Update keywords. "Ensure this document exists with these values" previously had no expression, so fixture setup could not be written to run twice.
Reading — Get Distinct Values, Get Estimated Document Count, Delete Document And Return It, plus limit/skip on counting and allow_disk_use on aggregation.
Retrying assertions — Document Should Exist, Document Should Not Exist, Check Distinct Values, Check Collection Exists, Check Index Exists. They carry the retry loop, which is the part a suite gets wrong when it hand-rolls a wait.
Indexes — Get Index Information, Drop All Indexes, and sparse, expire_after_seconds and partial_filter_expression on Create Index.
Connections — replica_set, direct_connection, read_preference and auth_mechanism, previously reachable only by writing a connection string.
Run Database Command reaches everything left unwrapped: collStats, dbStats, explain, the administrative commands.
Transactions, change streams, GridFS and client-side encryption are deliberately absent — none of them fit a synchronous keyword taken one at a time.
Compatibility
Python 3.12–3.14, pymongo 4.x, Robot Framework 7. CI runs the acceptance suite against a MongoDB 8 replica set on every change, and the connection suite against MongoDB Atlas for mongodb+srv and TLS.
Full detail in the changelog.
0.2.0
Full Changelog: 0.1.0...0.2.0
0.2.0 – Feature Update
What’s New
- ✨ Enhance
MongoDBKeywordswith new document update and deletion keywords (c7532dd)
This release adds new keywords for updating and deleting documents, expanding the library’s capabilities for MongoDB test automation.
Thank you for using MongoDBLibrary! Feedback and contributions are always welcome.****
0.1.0
Full Changelog: 0.1.0...0.1.0
0.1.0 – Initial Release
This is the first public release of MongoDBLibrary for Robot Framework.
Highlights
- 🚀 Initial implementation: Provides core keywords for connecting to MongoDB and performing basic database operations in Robot Framework test suites.
- 🛠️ Refactored code structure: Improved readability and maintainability, making it easier to extend and contribute.
- 🔒 Enhanced connection management: More robust handling of MongoDB connections, including better resource management and error handling.
- 🧪 Testing improvements: Added and improved tests to ensure reliability and correctness of the library.
Getting Started
See the README for installation and usage instructions.
Thank you for trying out MongoDBLibrary! Feedback and contributions are welcome.