diff --git a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature index d4a7427c6..e1a016a65 100644 --- a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature +++ b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature @@ -25,6 +25,7 @@ Feature: DataBase Connections Main Tests Mysql # POST /api/1.0/{workspace}/project//database-connection/test # Test DataBase Connection + @MysqlDbConnection Scenario Outline: Test database connection to test Given POST this data: """ @@ -53,6 +54,7 @@ Feature: DataBase Connections Main Tests Mysql # POST /api/1.0/{workspace}/project//database-connection # Create new DataBase Connection + @MysqlDbConnection Scenario Outline: Create a new database connection Given database-connection with id "" is active And POST this data: @@ -98,6 +100,7 @@ Feature: DataBase Connections Main Tests Mysql # PUT /api/1.0/{workspace}/project//database-connection # Update a DataBase Connection + @MysqlDbConnection Scenario Outline: Update a database connection Given database-connection with id "" is active And PUT this data: @@ -127,6 +130,7 @@ Feature: DataBase Connections Main Tests Mysql # GET /api/1.0/{workspace}/project//database-connection # Get a single DataBase Connection and their properties + @MysqlDbConnection Scenario Outline: Get a single database connection and check some properties Given database-connection with id "" is active And that I want to get a resource with the key "dbs_uid" stored in session array as variable "dbs_uid_" diff --git a/features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature b/features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature index 6081e43a7..2fb272877 100644 --- a/features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature +++ b/features/backend/projects/database_connections/main_tests_database_connections_sqlserver.feature @@ -25,6 +25,7 @@ Feature: DataBase Connections Main Tests SQL Server # POST /api/1.0/{workspace}/project//database-connection/test # Test DataBase Connection + @SqlServerDbConnection Scenario Outline: Test database connection to test Given POST this data: """ @@ -53,6 +54,7 @@ Feature: DataBase Connections Main Tests SQL Server # POST /api/1.0/{workspace}/project//database-connection # Create new DataBase Connection + @SqlServerDbConnection Scenario Outline: Create a new database connection Given database-connection with id "" is active And POST this data: @@ -98,6 +100,7 @@ Feature: DataBase Connections Main Tests SQL Server # PUT /api/1.0/{workspace}/project//database-connection # Update a DataBase Connection + @SqlServerDbConnection Scenario Outline: Update a database connection Given database-connection with id "" is active And PUT this data: @@ -127,6 +130,7 @@ Feature: DataBase Connections Main Tests SQL Server # GET /api/1.0/{workspace}/project//database-connection # Get a single DataBase Connection and their properties + @SqlServerDbConnection Scenario Outline: Get a single database connection and check some properties Given database-connection with id "" is active And that I want to get a resource with the key "dbs_uid" stored in session array as variable "dbs_uid_" diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 3dd903424..4c4407f52 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -87,6 +87,52 @@ class RestContext extends BehatContext } } + /** + * @BeforeScenario @MysqlDbConnection + */ + public function verifyAllRequiredDataToConnectMysqlDB() + { + $db_parameters = array( + 'mys_db_type', + 'mys_db_server', + 'mys_db_name', + 'mys_db_username', + 'mys_db_password', + 'mys_db_port', + 'mys_db_encode', + 'mys_db_description'); + + foreach ($db_parameters as $value) { + $param = $this->getParameter($value); + if (!isset($param)){ + throw new PendingException("Parameter ".$value." is not defined or is empty, please review behat.yml file!"); + } + } + } + + /** + * @BeforeScenario @SqlServerDbConnection + */ + public function verifyAllRequiredDataToConnectSqlServerDB() + { + $db_parameters = array( + 'sqlsrv_db_type', + 'sqlsrv_db_server', + 'sqlsrv_db_name', + 'sqlsrv_db_username', + 'sqlsrv_db_password', + 'sqlsrv_db_port', + 'sqlsrv_db_encode', + 'sqlsrv_db_description'); + + foreach ($db_parameters as $value) { + $param = $this->getParameter($value); + if (!isset($param)){ + throw new PendingException("Parameter ".$value." is not defined or is empty, please review behat.yml file!"); + } + } + } + /** * ============ json array =================== * @Given /^that I send (\[[^]]*\])$/