'Cypress MSSQL Server Connectivity - Facing "No connection configuration given" Error
I have attached the error image
cypress.json
"db": {
"userName": "test",
"password": "test",
"server": "test",
"options": {
"database": "test",
"encrypt": true,
"rowCollectionOnRequestCompletion" : true
}
}
plugin/index.js
const sqlServer = require('cypress-sql-server');
module.exports = (on, config) => {
tasks = sqlServer.loadDBPlugin(config.db);
on('task', tasks);
};
support/index.js
import sqlServer from 'cypress-sql-server';
sqlServer.loadDBCommands();
test file
it('db connection', () => {
const query = '`SELECT COUNT(*) FROM people';
cy.sqlServer(query).should((res) => { console.log(res); });
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
