Algunos Hooks ha sido adicionados para evitar errores al ejecutar los behats de conexión a las base de datos.
This commit is contained in:
@@ -25,6 +25,7 @@ Feature: DataBase Connections Main Tests Mysql
|
||||
|
||||
# POST /api/1.0/{workspace}/project/<project-id>/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/<project-id>/database-connection
|
||||
# Create new DataBase Connection
|
||||
@MysqlDbConnection
|
||||
Scenario Outline: Create a new database connection
|
||||
Given database-connection with id "<dbs_uid_number>" is active
|
||||
And POST this data:
|
||||
@@ -98,6 +100,7 @@ Feature: DataBase Connections Main Tests Mysql
|
||||
|
||||
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
|
||||
# Update a DataBase Connection
|
||||
@MysqlDbConnection
|
||||
Scenario Outline: Update a database connection
|
||||
Given database-connection with id "<dbs_uid_number>" is active
|
||||
And PUT this data:
|
||||
@@ -127,6 +130,7 @@ Feature: DataBase Connections Main Tests Mysql
|
||||
|
||||
# GET /api/1.0/{workspace}/project/<project-id>/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 "<dbs_uid_number>" is active
|
||||
And that I want to get a resource with the key "dbs_uid" stored in session array as variable "dbs_uid_<dbs_uid_number>"
|
||||
|
||||
@@ -25,6 +25,7 @@ Feature: DataBase Connections Main Tests SQL Server
|
||||
|
||||
# POST /api/1.0/{workspace}/project/<project-id>/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/<project-id>/database-connection
|
||||
# Create new DataBase Connection
|
||||
@SqlServerDbConnection
|
||||
Scenario Outline: Create a new database connection
|
||||
Given database-connection with id "<dbs_uid_number>" is active
|
||||
And POST this data:
|
||||
@@ -98,6 +100,7 @@ Feature: DataBase Connections Main Tests SQL Server
|
||||
|
||||
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
|
||||
# Update a DataBase Connection
|
||||
@SqlServerDbConnection
|
||||
Scenario Outline: Update a database connection
|
||||
Given database-connection with id "<dbs_uid_number>" is active
|
||||
And PUT this data:
|
||||
@@ -127,6 +130,7 @@ Feature: DataBase Connections Main Tests SQL Server
|
||||
|
||||
# GET /api/1.0/{workspace}/project/<project-id>/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 "<dbs_uid_number>" is active
|
||||
And that I want to get a resource with the key "dbs_uid" stored in session array as variable "dbs_uid_<dbs_uid_number>"
|
||||
|
||||
@@ -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 (\[[^]]*\])$/
|
||||
|
||||
Reference in New Issue
Block a user