WebdriverIO:如何编写 if else if 语句 javascript

时间:2021-02-10 20:07:12

标签: javascript if-statement jasmine ui-automation webdriver-io

我需要根据 url 的第一部分所说的内容在不同的 url 之间切换。

例如: https://prod.com/ 然后我需要添加 form/address/type/etc?stuff 要么 https://test.com/ 然后我需要添加一个不同的表单/地址/类型/等?东西

我做了这样的事情

<script> this.history.forward(-1); </script>

到目前为止,qa 和 prod 一个有效,但 else if 中间一个无效。 在 Javscript 中使用 WDIO 和 jasmine

1 个答案:

答案 0 :(得分:0)

我使用了 else if (this.url.to.include "testing_environment") {