Runscope复杂的初始变量

时间:2015-10-05 13:44:17

标签: javascript variables md5 runscope

如何为我的测试初始化​​复杂的初始变量。类似的东西:

variables.set("token", md5("something" + md5("something" + somevalue + "some other value") + "some value one more time" + someVal));

1 个答案:

答案 0 :(得分:2)

Dmytro,几乎就是你所描述的方式。 Runscope提供CryptoJS库,您可以这样做:

var someValue = "woot";
variables.set("token", CryptoJS.MD5("something" + 
  CryptoJS.MD5("foo1" + someValue + "someOtherValue").toString() +
  "foo2" + someValue).toString());

完整的Runscope脚本文档为here