I am not able connect DB connection using Cypress.
DBConnection.feature
Scenanrio: Connect DB using SQL Server
Given Update the Agent Details
Package.json
npx cypress run –spec cypress/integrtation/bddtest/welcome.feature
e2e.js
import sqlServer from 'cypress-sql-server'; sqlServer.loadDBCommands()
Step Definition:
cy.SqlServer("Update Agent set Agent_Name='Antony' where Agent id=123")
cypress.config.js
`config.db = {
userName: "username",
password: "bbbbbbb!10",
server: "Server",
options: {
database: "DatabaseName",
encrypt: true,
rowCollectionOnRequestCompletion : true
}
}
tasks = sqlServer.loadDBPlugin(config.db);
on('task', tasks);`
I am getting error in the cypress log when I run npx cypress run –spec cypress/integrtation/bddtest/welcome.feature
[ERRO] Could no resolve “crypto”
node_modules/tedious/lib/connection.js
5| const crypto = require(‘crypto’)
The package “crypto” was not found on the file system but is built into node. Are you trying to bundle for node? You can use “platform: node to do that which will remove this error.
[ERRO] Could no resolve “io”
While I run code through Cypress Terminal and I getting above error.
Thank you
sakthivel j is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.