From 10314450d1486c1c8cfe0b17a23134dfc35368c9 Mon Sep 17 00:00:00 2001 From: Jose Fernandez Date: Sat, 9 Jul 2022 13:04:37 +0200 Subject: [PATCH] Removed unnecessary references to @sql tag --- README.md | 2 +- src/main/java/com/privalia/qa/specs/SqlDatabaseGSpec.java | 6 ++---- src/test/resources/features/sqlDatabaseSteps.feature | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e2fa09b5..a820f6f6 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ _[Testing Rest services](https://veepee-oss.github.io/gingerspec/steps-for-testi _[Testing a web page](https://veepee-oss.github.io/gingerspec/steps-for-testing-web-pages.html)_ ``` + @web Scenario: Fill the form and click the submit button Given I go to 'http://demoqa.com/text-box' And I type 'John' on the element with 'id:userName' @@ -189,7 +190,6 @@ _[Testing a web page](https://veepee-oss.github.io/gingerspec/steps-for-testing- _[Testing database](https://veepee-oss.github.io/gingerspec/steps-for-testing-relational-databases.html)_ ``` - @sql Scenario: Executing SELECT statements on a MySQL database Given I connect with JDBC to database 'mysql' type 'mysql' on host '${MYSQL_HOST}' and port '3306' with user 'root' and password 'mysql' Then I execute query 'CREATE TABLE IF NOT EXISTS weather1 (city varchar(80), temp_lo int, temp_hi int, prcp real, date date);' diff --git a/src/main/java/com/privalia/qa/specs/SqlDatabaseGSpec.java b/src/main/java/com/privalia/qa/specs/SqlDatabaseGSpec.java index 3ba6aaf7..fecc1bf9 100644 --- a/src/main/java/com/privalia/qa/specs/SqlDatabaseGSpec.java +++ b/src/main/java/com/privalia/qa/specs/SqlDatabaseGSpec.java @@ -54,8 +54,7 @@ public SqlDatabaseGSpec(CommonG spec) { *

* The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers. * All subsequent steps that interact with the database will be performed on this connection. You can also use the - * step {@link #disconnectDatabase()} to close this connection at the end of your scenarios, however, it is recommended - * to include the @sql tag in your scenarios to allow gingerspec to do this automatically. The current supported types of + * step {@link #disconnectDatabase()} to close this connection at the end of your scenarios. The current supported types of * databases are postgresql/mysql *

{@code
      * Example:
@@ -104,8 +103,7 @@ public void connectDatabase(String isSecured, String database, String dataBaseTy
      * Close the Database connection
      * 

* Closes the active database connection. To create a database connection use the step {@link #connectDatabase(String, String, String, String, String, String, String)} - * You can use this step to close the database connection at the end of your scenarios, however, it is recommended to include - * the @sql tag in your scenarios to allow gingerspec to do this automatically. + * You can use this step to close the database connection at the end of your scenarios. *

{@code
      * Example:
      *
diff --git a/src/test/resources/features/sqlDatabaseSteps.feature b/src/test/resources/features/sqlDatabaseSteps.feature
index 32f5e524..9a446984 100644
--- a/src/test/resources/features/sqlDatabaseSteps.feature
+++ b/src/test/resources/features/sqlDatabaseSteps.feature
@@ -1,11 +1,9 @@
 Feature: Steps for testing relational databases
 
-  Steps related to working with SQL relational databases (currently supports postgresql and mysql). In Scenarios that create connections
-  to a database, you can also use the @sql tag to automatically close any open sql connection after the Scenario completes, so is not necessary to
-  use the step "Then I close database connection" at the end.
+  Steps related to working with SQL relational databases (currently supports postgresql and mysql). GingerSpec automatically
+  detects if a database connection was left open at the end of each scenario and automatically tries to close it, so is not
+  necessary to use the step "Then I close database connection" at the end.
 
-  For more information check out:
-  https://github.com/veepee-oss/gingerspec/wiki/Gherkin-tags#sql-tag
 
   Rule: Opening and closing a connection to a database