
[英]Reference to database and/or server name is not supported in this version of SQL Server
[英]cy.task('sqlServer:execute') failed with the following error: Reference to db and server name in DB' is not supported in this version of SQL Server [closed]
SQL 服务器托管在云中。
环境:集成
SQL 服务器不在本地运行。 我已经更新了所有细节。
赛普拉斯.json
"db": {
"userName": "myusername",
"password": "password",
"server": "xx-i-xxx-xx-sql.database.windows.net",
"options": {
"database": "",
"encrypt": true,
"rowCollectionOnRequestCompletion" : true
}
}
插件/index.js 文件:
const sqlServer = require('cypress-sql-server');
const dbConfig = require('../../cypress.json');
module.exports = (on, config) => {
tasks = sqlServer.loadDBPlugin(dbConfig.db);
on('task', tasks);
}
我的 package.json 具有以下依赖项:
"cypress-sql-server": "^1.0.0"
我在赛普拉斯的 JavaScript 测试文件是
describe('test', () => {
it('Connect to SQL database', () => {
cy.sqlServer("SELECT TOP (1000) [Id],[CompanyId] FROM [**DBNAME**]. [dbo].[Tenants]").then(result => {
cy.log(result)
})
})
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.