QA-Automation-Starter / qa-automation

QA automation utilities and project generator
https://qa-automation-starter.aherscu.dev
Other
6 stars 4 forks source link

overhaul database support #207

Closed adrian-herscu closed 10 months ago

adrian-herscu commented 10 months ago

Current State Current Unitils functionality of connecting a database by configuration and applying datasets to its tables is not tested.

How to make it better Add tests demonstrating the database testing facilities, e.g. initializing with a dataset and performing verification queries.

adrian-herscu commented 10 months ago

Current db support is via Unitils -- it never worked well, especially with multiple databases and schemas. Now, in the last PR , discovered that it does not work with TestNG in any of its parallel modes. See closing comments of #208.

There should be a separate qa-jgiven-jdbc module to provide following steps:

Example script:

given()
  .a_data_source(configuration().dataSource("db-1"))

when()
 .executing("insert/select/whatever");

then()
  .the_last_result_matches(hasItems(...));

In test.properties, there should be:

datasource.db-1.name = db-1
datasource.db-1.url = jdbc:....
datasource.db-1.init = init-db-1.sql
datasource.db-2.name = db-2
datasource.db-2.url = jdbc:....
datasource.db-2.init = init-db-2.sql

All this can be implemented with just DBUtils (which is test-framework agnostic).

adrian-herscu commented 10 months ago

Unitils should be removed completely. see #210 and #209

adrian-herscu commented 10 months ago

Work should branch out of 1_0.