I am attempting to establish a connection with an SQL database using Cypress following the guidelines provided in the NPM guide. I have ensured that all dependencies are installed as specified, however, when I run the following query:
cy.sqlServer('SELECT Email FROM [MyDB].[dbo].[User] WHERE Name ="test"')
I encounter the following error message:
CypressError: The execution of cy.task('sqlServer:execute') failed with the following error:
TypeError: No connection configuration was provided.
It is worth mentioning that my cypress.json file includes the necessary database connection string details. Here is a snippet from the cypress.json file:
{
"baseUrl": "myurl",
"db": {
"userName": "test",
"password": "test",
"server": "test\\test",
"options": {
"database": "test",
"encrypt": true,
"rowCollectionOnRequestCompletion": true
}
}
}
In addition to this, here is a snippet from my plugins/index.js file:
const sqlServer = require('cypress-sql-server');
module.exports = (on, config) => {
tasks = sqlServer.loadDBPlugin(config.db);
on('task', tasks);
}