在量角器预期条件中使用“或" [英] Using 'or' in Protractor expected conditions

查看:74
本文介绍了在量角器预期条件中使用“或"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在使用或预期状况.但是,文档中没有有关如何在这些块中使用或"或与"的任何示例.

I am trying to write an expects statement in Protractor that uses the or expected condition. However, the documentation does not have any examples of how to use 'or' or 'and' with these blocks.

我尝试做

expect(myString).or.toEqual('a string').toEqual('another string')

expect(myString).toEqual('a string').or.toEqual('another string')

只是为了踢

expect(myString).toEqual('a string', 'another string')

以前,曾经被问过这个问题,但只有一个已给出解决方法.

This question has been asked previously but only a workaround was given.

我想实际使用Protractor内置的or函数,因为它应该允许消息读取类似

I would like to actually use the or function that is built into Protractor as it should allow the message to read something like

Expected 'a totally different string' to be 'a string' or 'another string'

推荐答案

此处提供了示例:

Examples are provided here: http://angular.github.io/protractor/#/api?view=ExpectedConditions. However, you're confusing the use of expected conditions, which is used for browser.wait and not expects.

这篇关于在量角器预期条件中使用“或"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆