javascript - 不能再在 groovy 中使用 format() 和 plus() 进行 ReadyAPI 测试
问题描述
嗨,我之前在为 ReadyAPi 编写 groovy 脚本时通过例如 data().plus(1).format('dd-mmm-yyyy') 添加了日期,我已将 Ready API 更新到 3.3.2 版并且这些停止工作为了我。我不能再使用这些方法了。有没有其他方法可以获得相同的结果
def startdate = new Date().plus(1).format("yyyy-MM-dd")
log.info startdate
def enddate = new Date().plus(2).format('yyyy-MM-dd')
log.info enddate
收到以下错误
groovy.lang.MissingMethodException: No signature of method: java.util.Date.plus() is applicable for argument types: (Integer) values: [1] Possible solutions: parse(java.lang.String), is(java.lang.Object), split(groovy.lang.Closure), use([Ljava.lang.Object;), wait(), clone() error at line: 1
请帮忙。它完全破坏了我的测试套件
解决方案
推荐阅读
- sql - 连接表并在单行内连接多行
- java - 如何在不需要授权的端点上启用 CORS
- wordpress - 手动更新我的 Wordpress 站点(使用 FTP)后,在我的 wordpress 仪表板上,我仍然得到“WordPress 的更新版本可用”。
- c# - MSBuild - 将来自 editorconfig 的警告视为错误(在构建期间强制执行)
- docker - 如何用很少的端口构建 dockerfile
- node.js - 错误:传入的参数必须是 12 个字节的单个字符串或 24 个十六进制字符的字符串,同时使用自己生成的 id 插入
- sql - Oracle SQL 将日期维度表与另一个关于日期值的表连接起来
- angularjs - 使用 - injector.get() 实例化 Angular JS 服务
- python - Python中的编译时常量
- excel - Excel VBA 多行文本框以 RTL 语言添加额外的行