Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 我可以在plugin/index.js文件中传递Cypress.env吗?_Sql_Sql Server_Cypress - Fatal编程技术网

Sql 我可以在plugin/index.js文件中传递Cypress.env吗?

Sql 我可以在plugin/index.js文件中传递Cypress.env吗?,sql,sql-server,cypress,Sql,Sql Server,Cypress,我已经创建了一个cypress“任务”来从数据库中获取数据,我不想在索引文件中存储configDB的凭据,而是想通过cypress.json传递它。Cypress.env不起作用有解决办法吗 const configDB = { server: "xxx", port: xxx, domain: "US", user: "username", password: "password", database: "database

我已经创建了一个cypress“任务”来从数据库中获取数据,我不想在索引文件中存储configDB的凭据,而是想通过cypress.json传递它。Cypress.env不起作用有解决办法吗

const configDB = {
      server: "xxx",
      port: xxx,
      domain: "US",
      user: "username",
      password: "password",
      database: "database",
      driver: "tedious",
      options: {
        enableArithAbort: true,
      },
    };
    const sql = require("mssql");

参考

plugins/index.js
文件中,将其设置为
config.env

module.exports = (on, config) => {
  // `on` is used to hook into various events Cypress emits
  // `config` is the resolved Cypress config

  // modify env var value
  config.env.ENVIRONMENT = 'dev';

  // return config to update the global configuration
  return config
}