robotframework extension lib for test mongodb
Project description
robot-mongodb-library
robot framework extension for test connect mongodb
https://pypi.org/project/robot-mongodb-library/
How to Use
pip install robot-mongodb-library
Import into project file : example.robot
*** Settings ***
Library RobotMongoDBLibrary.Insert
Library RobotMongoDBLibrary.Update
Library RobotMongoDBLibrary.Find
Library RobotMongoDBLibrary.Delete
*** Variables ***
&{MONGODB_CONNECT_STRING} host=127.0.0.1 port=27017 username=admin password=password database=robotdb collection=customer
*** Test Cases ***
Test insert data into mongodb
&{DATA} Create Dictionary _id=X100001 name=Tarathep address=Thailand phone=8888888888
${MSG} InsertOne ${MONGODB_CONNECT_STRING} ${DATA}
Should Be Equal ${MSG} INSERTED SUCCESS
Test find by fillter data from mongodb
&{FILLTER} Create Dictionary name=Tarathep address=Thailand
${RESULTS} Find ${MONGODB_CONNECT_STRING} ${FILLTER}
FOR ${RESULT} IN @{RESULTS}
Log To Console ${RESULT["phone"]}
END
Test update data phone into mongodb by ID
&{NEWDATA} Create Dictionary phone=0649359xxx
${MSG} Update ${MONGODB_CONNECT_STRING} X100001 ${NEWDATA}
Should Be Equal ${MSG} UPDATED SUCCESS
Test find data by ID from mongodb
${RESULTS} FindOneByID ${MONGODB_CONNECT_STRING} X100001
Log To Console ${RESULTS}
Test delete data by ID into mongodb
${MSG} DeleteOneByID ${MONGODB_CONNECT_STRING} X100001
Should Be Equal ${MSG} DELETED SUCCESS
Example Result
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for robot-mongodb-library-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3c0a3bf4bb14650457b6b59e5f6b3bdbf6a7c1c2ce91520871f1d9845f2286 |
|
MD5 | 9e2f3b4ffb42ad4bd30718d7d36ccb84 |
|
BLAKE2b-256 | 71bcb465a1e1f6b503cbae72d0600430e5b6af0a902cf713c8174a0b8f70a0b1 |
Close
Hashes for robot_mongodb_library-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea64240083b4ea52ab8e13427518fa12beead5568a69eb0c2749e4b66f0ac38 |
|
MD5 | f518d9f314adfc062b5d7809a6e8f597 |
|
BLAKE2b-256 | 02a446e5149f7bb5a9a16b8fc94dee1350818a15ef69bf8fc16ce16ff478e6d9 |