0
我有A/B测试的某些动作,有时会注册到页面A,有时会注册到页面B.量角器 - A/B测试 - 是否有可能通过或期望2个条件?
是否有任何选项为“expect”测试设置2个条件?
喜欢的东西:
expect(browser.driver.getCurrentUrl()).toEqual('https://wwww.pageA.com' || 'https://www.pageB.com');
我有A/B测试的某些动作,有时会注册到页面A,有时会注册到页面B.量角器 - A/B测试 - 是否有可能通过或期望2个条件?
是否有任何选项为“expect”测试设置2个条件?
喜欢的东西:
expect(browser.driver.getCurrentUrl()).toEqual('https://wwww.pageA.com' || 'https://www.pageB.com');
我在做这样的事情,和它的作品..
var currentURL = browser.driver.getCurrentUrl();
var pageA = 'https://wwww.pageA.com';
var pageB = 'https://www.pageB.com';
expect(currentURL == pageA || currentURL == pageB).toEqual(true, 'Not Matching!');
的可能的复制[期望在数组项(http://stackoverflow.com/questions/28747161/expect-item-in-array) –
谢谢,类似于:var expectConditions = [“www.a.com”,“www.b.com”]? –
是的,如果其中一个数组项与实际值匹配,那么您将通过测试。 (考虑到您使用重复问题中的某个方法) –