--db-installplus the driver name. Example:
npx concordia --db-install mysql
Available driver names:
Database drivers are installed as development dependencies of your application.
--db-uninstallplus the driver name. Example:
npx concordia --db-uninstall mysql
Just uninstall and then install it again.
Database: My DB
- type is "mysql"
- host is "127.0.0.1"
- name is "acme"
- username is "tester"
- password is "secret"
Database: Another DB
- type is "json"
- path is "./db.json"
A database can be referenced inside UI properties and Test Events by its name between
[My DB]. To reference a database table, separate the table name from the database name with with a dot (
.) - e.g.
[My DB.profession]. Let's see an example:
# ... other declarations here ...
UI Element: Profession
- value comes from "SELECT name FROM [My DB.profession]"
Otherwise, I see "Profession not found."
Otherwise, I see "Please select the profession."
Before Each Scenario:
Given that I connect to [My DB]
When I run the script 'DELETE FROM profession'
and I run the script 'INSERT INTO profession (name) VALUES ("Enginner"), ("Accountant")'
Instead of reinventing the wheel, Concordia uses SQL to query and modify databases and files. Even JSON and INI files can be queried with SQL.
In the example above, the property
valuefrom the UI Element "Profession" indicates that its (valid) values are retrieved from the table "profession" that belongs to the database declared as "My DB". The test event
Before Each Scenariowas declared to connect to the database, clean the table "profession", and then insert new records that the UI Element "Profession" will use.