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
If I run using Cypress Runner same query simple .js file it is working fine. ONLY I am facing issue while Running Cucumber. Kindly provide solution.
[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.
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.