selenium - 是否可以从命令行向 Nightwatch 发送参数?
问题描述
我有一个 jenkins 工作,它发出一个 XML 请求并返回一个答案。从这个答案中,我有一个我需要在夜间开始测试的字符串。
有谁知道我如何将这个字符串发送到守夜人?也许通过命令行参数?但是接下来怎么读呢?
解决方案
Since you're using a NodeJS-based framework, why not make use of a process.env variable?
Suppose you need to tell your script what environment you want to run your checks agains. Let's call our system variable ENV
. Your command will become:
ENV=prod nightwatch nightwatch.conf.js --yourOtherSwitches
In your page-objects/feature-files, you call the variable using process.env.ENV
.
推荐阅读
- cuda - CUDA 原子操作线程或块级别?
- r - 如何在数据框中使用 R 中的循环来获取许多 URL 的内容?
- python - 如何在 plotly 中更新来自多个跟踪的数据?
- c# - 我可以使用 Dynamics 365 中的 SharedVariables 在 CodeActivity(工作流)和插件之间传递信息吗?
- javascript - 使用表中的引导按钮插件突出显示多个选项
- android - Android Studio:仅过滤消息窗口或构建窗口中的错误?
- java - 如何通过 Java 代码通过从 Java 中的文本字段中获取值来重命名 MySQL 中的列名?
- hive - 失败:执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 -101。com/yammer/metrics/core/MetricsRegistry
- laravel - Laravel 5.8 Vue 组件在安装后不更新
- algorithm - 这是什么排序算法,可以改进吗?