实习生实习协议
SitePen's excellent client side testing tool, Intern, comes with an excellent command line utility to run tests and customize how those tests are run. The options provided are great but what if I want to make the command line more dynamic? What if I want to add custom command line arguments, available to tests, to pass along important information like sensitive credentials (which you don't want hard-coded in config files) or you simply want to allow overwriting of values within the static config file? It's actually quite easy:
SitePen出色的客户端测试工具Intern带有出色的命令行实用程序,可以运行测试并自定义这些测试的运行方式。 提供的选项很棒,但是如果我想让命令行更加动态怎么办? 如果我想添加可用于测试的自定义命令行参数,以传递重要信息(如敏感凭据)(您不希望在配置文件中进行硬编码),或者只想允许覆盖静态配置中的值,该怎么办?文件? 实际上很简单:
define(['intern'], function(intern) { if(intern.args.someCustomArg != undefined) { /* use the custom command line arg */ } });The intern module provides you the provided arguments via the args property. From there you can pick off the argument values as you wish. So what do I pass in via the command line?
intern模块通过args属性为您提供了所提供的参数。 在这里,您可以根据需要选择参数值。 那么我该如何通过命令行传递信息呢?
Login credentials for the test to use 测试使用的登录凭据 The domain I want to test (local dev, staging, production) 我要测试的域(本地开发,暂存,生产) Select browsers I want to test (i.e. I don't want to run all of them cited in the config) 选择我要测试的浏览器(即,我不想运行配置中引用的所有浏览器)What you could add is specific to your app, but be glad it's so easy to do!
您可以添加的内容特定于您的应用程序,但是很高兴它很容易做到!
翻译自: https://davidwalsh.name/intern-command-line
实习生实习协议
相关资源:jdk-8u281-windows-x64.exe