-
Notifications
You must be signed in to change notification settings - Fork 179
Open
Labels
Description
One of the major problems with using libraries like DatabaseLibrary is managing the connection. If we implement #149, it could cause additional problems. Typically QA need to implement following logic:
Connect To Database (...)
Query
[Teardown] Disconnect Connection
But often Disconnect Connection is not in teardown (so the connection can remain open after test fails), we could several long running connections even if we're not querying for anything. For that reason we could add optional option for 'self managed connection' - in short, we could open and close connection each time we perform an query.
The default behaviour of the library will not change, it will be only extra option that will open/close connection if it doesn't exist.
*** Settings ***
Library DatabaseLibrary auto_connect=${True}
Suite Setup Configure Connection ${params} # need to configure default connection
*** Test Cases ***
Test 1
Query SELECT * FROM table1 # will open and close connection on its own
Test 2
Query SELECT * FROM table2 # will open and close connection on its own