Tag: 引导

几个元素之后的连锁操作已被检索

为了testing,我们必须填写一个复杂的页面使用实习生/ leadfoot。 页面的每个部分都由一个单独的函数来处理,它接收必要的元素和input数据。 现在我们有这个问题,子function中这些元素的行为不能再链接了,因为它们是元素而不是命令。 是否有可能再次链接操作? 我尝试了很多,使用setContext()或自定义命令创build一个新的命令,但到目前为止还没有成功。 let inputs; return this.remote .get('some/url') .findAllByTagName('input') // Finds two input elements .then(inputElements=> inputs = inputElements) .then(()=> Promise.all([ inputs[0].clearValue(), // I would like to be able to write: inputs[0].clearValue().type('a') inputs[1].clearValue(), ])) .then(()=> Promise.all([ inputs[0].type('a'), inputs[1].type('b'), ]))